diff --git a/stage2/EXPORT_NOOBS b/stage2/EXPORT_NOOBS deleted file mode 100644 index 136cc77..0000000 --- a/stage2/EXPORT_NOOBS +++ /dev/null @@ -1,2 +0,0 @@ -NOOBS_NAME="Raspbian Lite" -NOOBS_DESCRIPTION="A port of Debian with no desktop environment" diff --git a/stage3/00-install-yunohost/00-run.sh b/stage3/00-install-yunohost/00-run.sh new file mode 100755 index 0000000..7a7c146 --- /dev/null +++ b/stage3/00-install-yunohost/00-run.sh @@ -0,0 +1,60 @@ +#!/bin/bash -e + +# Prevent dhcp setting the "search" thing in /etc/resolv.conf, leads to many +# weird stuff (e.g. with numericable) where any domain will ping >.> +on_chroot << EOF +echo 'supersede domain-name "";' >> /etc/dhcp/dhclient.conf +echo 'supersede domain-search "";' >> /etc/dhcp/dhclient.conf +echo 'supersede search ""; ' >> /etc/dhcp/dhclient.conf +EOF + +# Disable those damn supposedly "predictive" interface names +# c.f. https://unix.stackexchange.com/a/338730 +on_chroot << EOF +rm -f /etc/systemd/network/99-default.link +ln -s /dev/null /etc/systemd/network/99-default.link +EOF + +# Run the actual install +on_chroot << EOF +apt-get install insserv resolvconf -y +curl https://install.yunohost.org/stretch | bash -s -- -a +rm -f /etc/ssh/ssh_host_* +EOF + +echo "Enabling ssh login for root + setting default password" +on_chroot << EOF +sed -i '/PermitRootLogin/c\PermitRootLogin yes' /etc/ssh/sshd_config +echo "root:yunohost" | chpasswd +EOF + +echo "Cleaning ..." +on_chroot << EOF +apt-get clean +find /var/log -type f -exec rm {} \; +EOF + + +# Gotta manually kill those stuff which are some sort of daemon running +# for slapd / nscd / nslcd ... otherwise the script is unable to unmount +# the rootfs/image after that ? +while lsof 2>/dev/null | grep -q /root/rpi-image/work/*/export-image/rootfs/dev; +do + for PID in `ps -ef --forest | grep "qemu-arm-static" | grep -v "grep" | grep "nginx\|nscd\|slapd\|nslcd" | awk '{print $2}'` + do + echo "Killing $PID" + kill -9 $PID || true + sleep 1 + done + sleep 5 +done +while ps -ef --forest | grep "qemu-arm-static" | grep -v "grep" +do + for PID in `ps -ef --forest | grep "qemu-arm-static" | grep -v "grep" | grep "nginx\|nscd\|slapd\|nslcd" | awk '{print $2}'` + do + echo "Killing $PID" + kill -9 $PID || true + sleep 1 + done + sleep 5 +done diff --git a/stage2/EXPORT_IMAGE b/stage3/EXPORT_IMAGE similarity index 100% rename from stage2/EXPORT_IMAGE rename to stage3/EXPORT_IMAGE diff --git a/stage3/EXPORT_NOOBS b/stage3/EXPORT_NOOBS new file mode 100644 index 0000000..30f2f6e --- /dev/null +++ b/stage3/EXPORT_NOOBS @@ -0,0 +1,2 @@ +NOOBS_NAME="YunoHost Raspbian" +NOOBS_DESCRIPTION="A port of Debian for the Raspberry Pi with YunoHost pre-installed" diff --git a/stage3/prerun.sh b/stage3/prerun.sh new file mode 100755 index 0000000..ebb5d35 --- /dev/null +++ b/stage3/prerun.sh @@ -0,0 +1,5 @@ +#!/bin/bash -e + +if [ ! -d ${ROOTFS_DIR} ]; then + copy_previous +fi