diff --git a/overlay/filesystem/etc/systemd/system/load-ubnt-modules.service b/overlay/filesystem/etc/systemd/system/ubnt-init.service similarity index 55% rename from overlay/filesystem/etc/systemd/system/load-ubnt-modules.service rename to overlay/filesystem/etc/systemd/system/ubnt-init.service index d3d0d16..198064b 100644 --- a/overlay/filesystem/etc/systemd/system/load-ubnt-modules.service +++ b/overlay/filesystem/etc/systemd/system/ubnt-init.service @@ -1,10 +1,10 @@ [Unit] -Description=Load UBNT kernel modules +Description=UBNT bootup init script [Service] User=root Type=oneshot -ExecStart=/usr/sbin/modprobe ubnthal +ExecStart=/usr/lib/init/boot/ubnt-init.sh RemainAfterExit=yes [Install] diff --git a/overlay/filesystem/etc/systemd/system/ulcmd-shutdown-hook.service b/overlay/filesystem/etc/systemd/system/ulcmd-shutdown-hook.service index d439387..933fd42 100644 --- a/overlay/filesystem/etc/systemd/system/ulcmd-shutdown-hook.service +++ b/overlay/filesystem/etc/systemd/system/ulcmd-shutdown-hook.service @@ -1,11 +1,11 @@ [Unit] Description=ulcmd shutdown hook DefaultDependencies=no -Before=shutdown.target halt.target +Before=shutdown.target halt.target poweroff.target [Service] ExecStart=/usr/bin/ulcmd --sender system-hook --command poweroff Type=oneshot [Install] -WantedBy=shutdown.target halt.target +WantedBy=shutdown.target halt.target poweroff.target diff --git a/overlay/filesystem/usr/lib/init/boot/ubnt-init.sh b/overlay/filesystem/usr/lib/init/boot/ubnt-init.sh new file mode 100755 index 0000000..b50bf6c --- /dev/null +++ b/overlay/filesystem/usr/lib/init/boot/ubnt-init.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Load our kernel modules +/usr/sbin/modprobe ubnthal + +# Set our kernel panic timeout SUPER short so we reboot on crash +echo 2 > /proc/sys/kernel/panic diff --git a/scripts/docker/bootstrap/001-bootstrap b/scripts/docker/bootstrap/001-bootstrap index 6ada3c9..f2d7434 100755 --- a/scripts/docker/bootstrap/001-bootstrap +++ b/scripts/docker/bootstrap/001-bootstrap @@ -16,7 +16,7 @@ apt-get update apt-mark hold linux-image-* # We do not want these, as we run our own kernel! # Setup our services -systemctl enable load-ubnt-modules +systemctl enable ubnt-init systemctl enable mock-ubnt-api systemctl enable ulcmd systemctl enable ulcmd-reboot-hook