From eadd4c81834df9e9e0647d6991a630d2216f6a3b Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 27 Apr 2023 14:49:27 +0200 Subject: [PATCH] overlay: Ignition tweaks to work with composefs This is to enable ostree+composefs: https://github.com/ostreedev/ostree/issues/2867 When we care about the *physical* backing filesystem, we need to look at /sysroot/sysroot (which in the real root is `/sysroot`) because now `/sysroot` (aka `/` in the real root) is a composefs (really an `overlayfs` with a transient loop-mounted erofs), which is distinct from the physical root. Co-authored-by: Colin Walters --- .../lib/dracut/modules.d/35coreos-ignition/coreos-boot-edit.sh | 1 + .../modules.d/40ignition-ostree/coreos-check-rootfs-size | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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..ecd758a675 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 @@ -32,6 +32,7 @@ rm -vrf ${initramfs_firstboot_network_dir} root=$(karg root) if [ -z "${root}" ]; then rdcore rootmap /sysroot --boot-mount ${bootmnt} + echo "Prepared rootmap" fi # This does a few things: 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..d0b38d9bfd 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,8 @@ 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) +# /sysroot is the mounted deploy root, /sysroot/sysroot is the physical root filesystem +srcdev=$(findmnt -nvr -o SOURCE /sysroot/sysroot | tail -n1) size=$(lsblk --nodeps --noheadings --bytes -o SIZE "${srcdev}") MINIMUM_GB=8