From 605b90294d1258577dcaf9dd7c3952b70edeaad9 Mon Sep 17 00:00:00 2001 From: Kristian Mide Date: Tue, 20 Oct 2020 19:53:26 +0200 Subject: [PATCH] firstboot: execute /boot/firstboot when booting for the first time --- debian/raspberrypi-sys-mods.firstboot.service | 16 ++++++++++++++++ debian/rules | 3 +++ 2 files changed, 19 insertions(+) create mode 100644 debian/raspberrypi-sys-mods.firstboot.service diff --git a/debian/raspberrypi-sys-mods.firstboot.service b/debian/raspberrypi-sys-mods.firstboot.service new file mode 100644 index 0000000..982c12f --- /dev/null +++ b/debian/raspberrypi-sys-mods.firstboot.service @@ -0,0 +1,16 @@ +# This unit is heavily inspired by Ned McClain's ideas found in https://github.com/nmcclain/raspberian-firstboot +[Unit] +Description=Firstboot initialization +Documentation=https://github.com/nmcclain/raspberian-firstboot +After=network.target +Before=rc-local.service +ConditionFileNotEmpty=/boot/firstboot + +[Service] +ExecStart=/boot/firstboot +ExecStartPost=/bin/mv /boot/firstboot /boot/firstboot.${INVOCATION_ID} +Type=oneshot +RemainAfterExit=no + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/debian/rules b/debian/rules index 544a616..8272759 100755 --- a/debian/rules +++ b/debian/rules @@ -31,6 +31,7 @@ include /usr/share/dpkg/default.mk override_dh_installinit: dh_installinit --name=rpi-display-backlight --no-stop-on-upgrade --no-start dh_installinit --name=sshswitch + dh_installinit --name=firstboot dh_installinit --name=apply_noobs_os_config --no-stop-on-upgrade --no-start dh_installinit --name=regenerate_ssh_host_keys --no-stop-on-upgrade --no-start dh_installinit --name=wifi-country --no-stop-on-upgrade --no-start @@ -38,12 +39,14 @@ override_dh_installinit: override_dh_systemd_enable: dh_systemd_enable --name=rpi-display-backlight dh_systemd_enable --name=sshswitch + dh_systemd_enable --name=firstboot dh_systemd_enable --name=apply_noobs_os_config --no-enable dh_systemd_enable --name=regenerate_ssh_host_keys --no-enable dh_systemd_enable --name=wifi-country override_dh_systemd_start: dh_systemd_start --name=sshswitch --no-start + dh_systemd_start --name=firstboot --no-start dh_systemd_start --name=apply_noobs_os_config --no-start dh_systemd_start --name=regenerate_ssh_host_keys --no-start dh_systemd_start --name=wifi-country --no-start