summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmodules.d/slx-extra-script/module-setup.sh11
-rw-r--r--modules.d/slx-extra-script/services/s3-extra-post-mount.service12
2 files changed, 19 insertions, 4 deletions
diff --git a/modules.d/slx-extra-script/module-setup.sh b/modules.d/slx-extra-script/module-setup.sh
index da057429..9cc9bdbe 100755
--- a/modules.d/slx-extra-script/module-setup.sh
+++ b/modules.d/slx-extra-script/module-setup.sh
@@ -11,8 +11,11 @@ install() {
--wafter "s3-fetch-config.service" \
--before "s3-dnbd3root.service"
mkdir --parents "${initdir}/${systemdsystemunitdir}/initrd.target.wants"
- inst_simple "${moddir}/services/s3-extra-post-dmsetup.service" \
- "${systemdsystemunitdir}/s3-extra-post-dmsetup.service"
- ln_r "${systemdsystemunitdir}/s3-extra-post-dmsetup.service" \
- "${systemdsystemunitdir}/initrd.target.wants/s3-extra-post-dmsetup.service"
+ local i
+ for i in dmsetup mount; do
+ inst_simple "${moddir}/services/s3-extra-post-${i}.service" \
+ "${systemdsystemunitdir}/s3-extra-post-${i}.service"
+ ln_r "${systemdsystemunitdir}/s3-extra-post-${i}.service" \
+ "${systemdsystemunitdir}/initrd.target.wants/s3-extra-post-${i}.service"
+ done
}
diff --git a/modules.d/slx-extra-script/services/s3-extra-post-mount.service b/modules.d/slx-extra-script/services/s3-extra-post-mount.service
new file mode 100644
index 00000000..d7373ab8
--- /dev/null
+++ b/modules.d/slx-extra-script/services/s3-extra-post-mount.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Run extra script after /sysroot is mounted
+ConditionFileIsExecutable=/etc/extra-init
+After=s3-mount-root.service
+Before=initrd-switch-root.target initrd-cleanup.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/etc/extra-init post-mount
+KillMode=process
+KillSignal=SIGTERM