mirror of
https://github.com/YunoHost/install_script.git
synced 2024-09-03 20:06:25 +02:00
add build_arm_image tools
firstboot is copied form previous ARM image verbatim, initial import.
This commit is contained in:
parent
9d458cc88a
commit
5580fd4133
2 changed files with 34 additions and 0 deletions
7
build_arm_image/README.md
Normal file
7
build_arm_image/README.md
Normal 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
|
27
build_arm_image/etc/init.d/yunohost-firstboot
Executable file
27
build_arm_image/etc/init.d/yunohost-firstboot
Executable 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
|
Loading…
Add table
Reference in a new issue