From 5580fd41330c30c37cc934feda179687356da0d1 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 15 Dec 2015 10:08:04 +0100 Subject: [PATCH] add build_arm_image tools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit firstboot is copied form previous ARMĀ image verbatim, initial import. --- build_arm_image/README.md | 7 +++++ build_arm_image/etc/init.d/yunohost-firstboot | 27 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 build_arm_image/README.md create mode 100755 build_arm_image/etc/init.d/yunohost-firstboot diff --git a/build_arm_image/README.md b/build_arm_image/README.md new file mode 100644 index 0000000..87beb64 --- /dev/null +++ b/build_arm_image/README.md @@ -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 diff --git a/build_arm_image/etc/init.d/yunohost-firstboot b/build_arm_image/etc/init.d/yunohost-firstboot new file mode 100755 index 0000000..c90d35e --- /dev/null +++ b/build_arm_image/etc/init.d/yunohost-firstboot @@ -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