Skip to content

Commit

Permalink
Merge pull request #58 from flatcar/bootengine
Browse files Browse the repository at this point in the history
Prevent the OEM mount point from showing up before Ignition mounts
  • Loading branch information
pothos committed Mar 23, 2023
2 parents aa8a19e + f24adf3 commit 91b038f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dracut/10diskless-generator/diskless-generator
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ if [[ "${copy_oem}" -eq 1 ]]; then
# Automatically generated by diskless-generator
[Unit]
# This runs early for initrd-setup-root to populate it.
# Ignition can mount something else on /usr/share/oem still
# if the user wants so.
Before=initrd-root-fs.target
[Mount]
Expand Down
5 changes: 5 additions & 0 deletions dracut/30ignition/ignition-files.service
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ After=ignition-setup.service ignition-disks.service
# setup the root filesystem before we try do things like create users on it.
Requires=initrd-setup-root.service
After=initrd-setup-root.service
# Already mount the OEM partition here so that it works to write files
# without having to declare it as initrd mount in Ignition
RequiresMountsFor=/sysroot/usr/ /sysroot/usr/share/oem/

OnFailure=emergency.target
OnFailureJobMode=isolate
Expand All @@ -27,4 +30,6 @@ Before=initrd-parse-etc.service
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/run/ignition.env
# Flatcar: Make sure that the OEM mount point is there even if it shortly was away
ExecStartPre=-systemctl start sysroot-usr-share-oem.mount
ExecStart=/usr/bin/ignition --root=/sysroot --platform=${PLATFORM_ID} --stage=files --log-to-stdout
2 changes: 2 additions & 0 deletions dracut/30ignition/ignition-mount.service
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@ After=ignition-setup.service
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/run/ignition.env
# Flatcar: Unmount any OEM mount in case the Ignition config has one defined
ExecStartPre=/bin/bash -c 'if ! mount | grep -m 1 /sysroot/usr/share/oem | grep tmpfs; then umount /sysroot/usr/share/oem || true; fi'
ExecStart=/usr/bin/ignition --root=/sysroot --platform=${PLATFORM_ID} --stage=mount --log-to-stdout
ExecStop=/usr/bin/ignition --root=/sysroot --platform=${PLATFORM_ID} --stage=umount --log-to-stdout

0 comments on commit 91b038f

Please sign in to comment.