summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2024-01-29 14:04:14 +0100
committerSimon Rettberg2024-01-29 14:04:14 +0100
commit9c04128352e8cdd901a2232e35cdd18fd028033d (patch)
tree1679bdb73b2868df05be84a9117e93d2fbbd66d7
parent[slx-dmsetup] grow: Preserve exit status now that it's a service (diff)
downloadsystemd-init-9c04128352e8cdd901a2232e35cdd18fd028033d.tar.gz
systemd-init-9c04128352e8cdd901a2232e35cdd18fd028033d.tar.xz
systemd-init-9c04128352e8cdd901a2232e35cdd18fd028033d.zip
[slx-dmsetup] Only grow rootfs if we don't do it in stage4
-rwxr-xr-xmodules.d/slx-dmsetup/module-setup.sh4
-rw-r--r--modules.d/slx-dmsetup/services/s3-grow-rootfs.service2
2 files changed, 4 insertions, 2 deletions
diff --git a/modules.d/slx-dmsetup/module-setup.sh b/modules.d/slx-dmsetup/module-setup.sh
index 3bbbd8f3..99c1adf2 100755
--- a/modules.d/slx-dmsetup/module-setup.sh
+++ b/modules.d/slx-dmsetup/module-setup.sh
@@ -15,9 +15,9 @@ install() {
inst_simple "${moddir}/services/${_name}.service" \
"${systemdsystemunitdir}/${_name}.service"
mkdir --parents \
- "${initdir}/${systemdsystemunitdir}/initrd.target.requires"
+ "${initdir}/${systemdsystemunitdir}/initrd.target.wants"
ln_r "${systemdsystemunitdir}/${_name}.service" \
- "${systemdsystemunitdir}/initrd.target.requires/${_name}.service"
+ "${systemdsystemunitdir}/initrd.target.wants/${_name}.service"
inst_multiple blockdev xxd \
mkfs.ext4 resize2fs \
diff --git a/modules.d/slx-dmsetup/services/s3-grow-rootfs.service b/modules.d/slx-dmsetup/services/s3-grow-rootfs.service
index a849f4a3..5cb42056 100644
--- a/modules.d/slx-dmsetup/services/s3-grow-rootfs.service
+++ b/modules.d/slx-dmsetup/services/s3-grow-rootfs.service
@@ -1,5 +1,7 @@
[Unit]
Description=Grow size of rootfs to underlying block device
+# If we have a growfs service in stage4, we don't do anything here
+ConditionPathExists=!/sysroot/etc/systemd/system/grow-rootfs.service
# For ext4, -root-device would be sufficient, but XFS tool needs mountpoint
After=initrd-root-fs.target
Before=initrd-switch-root.target