From 1f28c2d54ed4ddb7b810473c497347387d9925b2 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 27 Apr 2023 14:49:27 +0200 Subject: [PATCH] Ignition tweaks to work with composefs I'm currently working on composefs use in ostree: https://github.com/ostreedev/ostree/pull/2640 I'm running into issues with ignition when testing it. Several places look at /sysroot and try to find the backing filesystem for it. This works because /sysroot is typically a bind-mount of some deploy directory in the real sysroot. However, in the composefs case, /sysroot is a composefs mount and doesn't have a real backing block device. This change switches these cases to look at /sysroot/sysroot instead. This is the actual real sysroot after ostree-prepare-root did its work (and before pivot-rooting into it). --- .../dracut/modules.d/35coreos-ignition/coreos-boot-edit.sh | 4 ++-- .../modules.d/40ignition-ostree/coreos-check-rootfs-size | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/coreos-boot-edit.sh b/overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/coreos-boot-edit.sh index cf2e9c3c3e..5f0def6e7d 100755 --- a/overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/coreos-boot-edit.sh +++ b/overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/coreos-boot-edit.sh @@ -31,7 +31,7 @@ rm -vrf ${initramfs_firstboot_network_dir} # append rootmap kargs to the BLS configs. root=$(karg root) if [ -z "${root}" ]; then - rdcore rootmap /sysroot --boot-mount ${bootmnt} + rdcore rootmap /sysroot/sysroot --boot-mount ${bootmnt} fi # This does a few things: @@ -42,4 +42,4 @@ fi # 3. it create a .root_uuid stamp file on the bootfs or fails if one exists # 4. it adds GRUB bootuuid.cfg dropins so that GRUB selects the boot filesystem # by UUID -rdcore bind-boot /sysroot ${bootmnt} +rdcore bind-boot /sysroot/sysroot ${bootmnt} diff --git a/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/coreos-check-rootfs-size b/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/coreos-check-rootfs-size index 2c320bed93..5106b9736b 100755 --- a/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/coreos-check-rootfs-size +++ b/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/coreos-check-rootfs-size @@ -4,7 +4,7 @@ set -euo pipefail # See also ignition-ostree-check-rootfs-size.service # https://github.com/coreos/fedora-coreos-tracker/issues/586#issuecomment-777220000 -srcdev=$(findmnt -nvr -o SOURCE /sysroot | tail -n1) +srcdev=$(findmnt -nvr -o SOURCE /sysroot/sysroot | tail -n1) size=$(lsblk --nodeps --noheadings --bytes -o SIZE "${srcdev}") MINIMUM_GB=8