SHA256
1
0
forked from pool/ignition
ignition/ignition-mount-initrd-fstab.service
Ignaz Forster 6957e768d0 Accepting request 964892 from home:fos:branches:devel:kubic:ignition
- Add ignition-touch-selinux-autorelabel.conf: Trigger SELinux autorelabel after Ignition runs; Ignition would support SELinux itself, however this is a compile time option, so it can't be used here.
- Filter commented lines in ignition-mount-initrd-fstab.service

OBS-URL: https://build.opensuse.org/request/show/964892
OBS-URL: https://build.opensuse.org/package/show/devel:kubic:ignition/ignition?expand=0&rev=88
2022-03-25 15:23:52 +00:00

24 lines
1002 B
Desktop File

[Unit]
Description=Mount initrd fstab entries for Ignition
DefaultDependencies=false
Before=ignition-complete.target
# Make sure ExecStop= runs before we switch root
Before=initrd-switch-root.target
After=initrd-root-fs.target
After=ignition-remount-sysroot.service
# Run only after Ignition's mount stage - mount points configured by Ignition
# itself will be skipped below, just mount the rest.
Requires=ignition-mount.service
After=ignition-mount.service
Before=ignition-files.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh -c 'eval $(awk '"'"'$4 ~ /x-initrd.mount/ && $1 !~ /^#/ {print "if ! findmnt /sysroot" $2 " >/dev/null; then mount -t " $3 " -o " $4 " " $1 " /sysroot" $2 "; fi;" }'"'"' /sysroot/etc/fstab)'
ExecStop=/bin/sh -c 'if [ -f /sysroot/etc/systemd/system-preset/20-ignition.preset ]; then while read line; do systemctl --root=/sysroot $line; done < /sysroot/etc/systemd/system-preset/20-ignition.preset; fi'
ExecStop=/usr/bin/umount -a -O "x-initrd.mount"