Skip to content

Commit

Permalink
firstboot: execute /boot/firstboot when booting for the first time
Browse files Browse the repository at this point in the history
  • Loading branch information
fasmide committed Oct 27, 2020
1 parent c213dc6 commit e6c3a50
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
18 changes: 18 additions & 0 deletions debian/raspberrypi-sys-mods.run_once.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This unit is heavily inspired by Ned McClain's ideas found in https://github.com/nmcclain/raspberian-firstboot
[Unit]
Description=run_once initialization
After=network.target
Before=rc-local.service

ConditionFileNotEmpty=/boot/run_once
ConditionFileIsExecutable=yes
ConditionPathIsReadWrite=/boot

[Service]
ExecStart=/boot/run_once
ExecStartPost=/bin/mv /boot/run_once /boot/run_once.${INVOCATION_ID}
Type=oneshot
RemainAfterExit=no

[Install]
WantedBy=multi-user.target
3 changes: 3 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,22 @@ 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=run_once
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

override_dh_systemd_enable:
dh_systemd_enable --name=rpi-display-backlight
dh_systemd_enable --name=sshswitch
dh_systemd_enable --name=run_once
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=run_once --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

0 comments on commit e6c3a50

Please sign in to comment.