forked from RPi-Distro/pi-gen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the ability to run a /boot/msw_provision.sh script on first boot
- Loading branch information
1 parent
bfd5408
commit 8af78a3
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash -e | ||
|
||
install -m 644 files/msw_provision.service ${ROOTFS_DIR}/etc/systemd/system/msw_provision.service | ||
install -m 644 files/msw_provisioned.service ${ROOTFS_DIR}/etc/systemd/system/msw_provisioned.service | ||
|
||
on_chroot << EOF | ||
systemctl enable msw_provision | ||
systemctl enable msw_provisioned | ||
EOF | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=Provisions the system via a script on the /boot partition | ||
ConditionFileIsExecutable=/boot/msw_provision.sh | ||
ConditionPathExists=!/var/msw_provisioned | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/boot/msw_provision.sh | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Tells the system that it has been provisioned | ||
ConditionPathExists=!/var/msw_provisioned | ||
After=msw_provision.service | ||
Requires=msw_provision.service | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/usr/bin/touch /var/msw_provisioned | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
|