add build_arm_image tools

firstboot is copied form previous ARM image verbatim, initial import.
This commit is contained in:
Sylvain 2015-12-15 10:08:04 +01:00
parent 9d458cc88a
commit 5580fd4133
2 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,7 @@
This folder contains helper script to build arm image for raspberry and derivative arm plateform.
the folder structure maps debian OS folders.
files are copied to the /root when finished.
See also: https://yunohost.org/#/build_arm_image

View file

@ -0,0 +1,27 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: expand rootfs and Generates new ssh host keys on first boot
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Generates new ssh host keys on first boot
# Description: Generatesapt-get --purge clean new ssh host keys on $
### END INIT INFO
echo "Expanding rootfs ..."
raspi-config --expand-rootfs
echo "Generating new ssh keys ..."
# Delete SSH keys
rm -f /etc/ssh/ssh_host_*
yes | ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa
yes | ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa
yes | ssh-keygen -f /etc/ssh/ssh_host_ecdsa_key -N '' -t ecdsa -b 521
echo "Deleting logs ..."
find /var/log -type f -exec echo > {} \;
echo "Purging apt ..."
apt-get --purge clean
echo "Removing myself ..."
echo > /etc/udev/rules.d/70-persistent-net.rules
update-rc.d -f yunohost-firstboot remove >/dev/null 2>&1
echo "Rebooting ..."
reboot