From a7d43128335fafc1514371c136aa48577145b24a Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Thu, 22 Feb 2024 20:00:29 -0500 Subject: [PATCH] osbuild: set sysroot.bootprefix true in OSTree config This is a second round of f5677a3 (reverted in db7bf08). Now that coreos-installer in rawhide has https://github.com/coreos/coreos-installer/pull/1422 we can set sysroot.bootprefix to true again. We can't do it in the non-OSBuild configs because not all streams have the new coreos-installer yet. Here is the comment from the original commit: This setting will make it so that BLS config entries get prepended with /boot. OSTree already places a boot -> . symlink in the root of the boot filesystem prepending with /boot will always just work. For context see https://github.com/osbuild/osbuild/issues/1566#issuecomment-1921908500 This also allows for dropping one of the upstream OSBuild zipl stage patches. --- build.sh | 1 - ...-improve-kernel-initrd-path-resoluti.patch | 39 ------------------- .../coreos.osbuild.aarch64.mpp.yaml | 6 +++ .../coreos.osbuild.ppc64le.mpp.yaml | 6 +++ .../coreos.osbuild.s390x.mpp.yaml | 6 +++ .../coreos.osbuild.x86_64.mpp.yaml | 6 +++ 6 files changed, 24 insertions(+), 40 deletions(-) delete mode 100644 src/0001-stages-zipl.inst-improve-kernel-initrd-path-resoluti.patch diff --git a/build.sh b/build.sh index fa2e8e1473..2498eb70ea 100755 --- a/build.sh +++ b/build.sh @@ -177,7 +177,6 @@ patch_osbuild() { # Now all the software is under the /usr/lib/osbuild dir and we can patch cat /usr/lib/coreos-assembler/0004-fscache-add-eviction-log-statement.patch \ - /usr/lib/coreos-assembler/0001-stages-zipl.inst-improve-kernel-initrd-path-resoluti.patch \ /usr/lib/coreos-assembler/0001-stages-qemu-sanity-check-created-image.patch \ /usr/lib/coreos-assembler/0001-util-Add-bls-module.patch \ /usr/lib/coreos-assembler/0002-Add-coreos.platforms-stage.patch \ diff --git a/src/0001-stages-zipl.inst-improve-kernel-initrd-path-resoluti.patch b/src/0001-stages-zipl.inst-improve-kernel-initrd-path-resoluti.patch deleted file mode 100644 index ad802354b6..0000000000 --- a/src/0001-stages-zipl.inst-improve-kernel-initrd-path-resoluti.patch +++ /dev/null @@ -1,39 +0,0 @@ -From f3e725766e5fe0a646bb5555a329574dddcdd309 Mon Sep 17 00:00:00 2001 -From: Nikita Dubrovskii -Date: Tue, 30 Jan 2024 08:54:51 +0100 -Subject: [PATCH 1/2] stages(zipl.inst): improve kernel/initrd path resolution - -If /boot is a separate filesystem then the path inside the blscfg -won't have the rootfs prefix on it and we need to add it here. - -Co-authored-by: Dusty Mabe ---- - stages/org.osbuild.zipl.inst | 12 ++++++++++-- - 1 file changed, 10 insertions(+), 2 deletions(-) - -diff --git a/stages/org.osbuild.zipl.inst b/stages/org.osbuild.zipl.inst -index a9bea045..92dfd33e 100755 ---- a/stages/org.osbuild.zipl.inst -+++ b/stages/org.osbuild.zipl.inst -@@ -74,8 +74,16 @@ def find_kernel(root, kernel: str): - if version != kernel: - continue - -- linux = root + params["linux"] -- initrd = root + params["initrd"] -+ # Find the prefix that needs to be added to get the full path to -+ # the kernel/initrd. If /boot is a separate filesystem then the -+ # path inside the blscfg won't have that prefix on it and we need -+ # to add it here. -+ prefix = root -+ if os.path.ismount(os.path.join(root, "boot")): -+ prefix = os.path.join(root, "boot") -+ -+ linux = os.path.join(prefix, params["linux"].lstrip("/")) -+ initrd = os.path.join(prefix, params["initrd"].lstrip("/")) - options = params.get("options", "") - return linux, initrd, options - --- -2.43.0 - diff --git a/src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml index 5eca02a187..fac4d1216b 100644 --- a/src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml @@ -106,6 +106,12 @@ pipelines: bootloader: none # https://github.com/coreos/fedora-coreos-tracker/issues/1333 bls-append-except-default: grub_users="" + # Opt-in to https://github.com/ostreedev/ostree/pull/2705 which will + # add /boot as the prefix on top of BLS config entries. This is OK + # because there is a symlink that is created in the root of the boot + # filesystem by OSTree (boot -> .) that makes it so that /boot paths + # will always work. + bootprefix: true - type: org.osbuild.mkdir options: paths: diff --git a/src/osbuild-manifests/coreos.osbuild.ppc64le.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.ppc64le.mpp.yaml index fb30932e9b..b3d6876531 100644 --- a/src/osbuild-manifests/coreos.osbuild.ppc64le.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.ppc64le.mpp.yaml @@ -108,6 +108,12 @@ pipelines: bootloader: none # https://github.com/coreos/fedora-coreos-tracker/issues/1333 bls-append-except-default: grub_users="" + # Opt-in to https://github.com/ostreedev/ostree/pull/2705 which will + # add /boot as the prefix on top of BLS config entries. This is OK + # because there is a symlink that is created in the root of the boot + # filesystem by OSTree (boot -> .) that makes it so that /boot paths + # will always work. + bootprefix: true - type: org.osbuild.ignition # Deploy via container if we have a container ociarchive, else from repo. - mpp-if: ociarchive != '' diff --git a/src/osbuild-manifests/coreos.osbuild.s390x.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.s390x.mpp.yaml index 2fd58d9e6f..77976cf5b4 100644 --- a/src/osbuild-manifests/coreos.osbuild.s390x.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.s390x.mpp.yaml @@ -95,6 +95,12 @@ pipelines: bootloader: none ## no grub_users="" on s390x #bls-append-except-default: grub_users="" + # Opt-in to https://github.com/ostreedev/ostree/pull/2705 which will + # add /boot as the prefix on top of BLS config entries. This is OK + # because there is a symlink that is created in the root of the boot + # filesystem by OSTree (boot -> .) that makes it so that /boot paths + # will always work. + bootprefix: true - type: org.osbuild.ignition # Deploy via container if we have a container ociarchive, else from repo. - mpp-if: ociarchive != '' diff --git a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml index f609f29be8..07cdd07fbf 100644 --- a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml @@ -108,6 +108,12 @@ pipelines: bootloader: none # https://github.com/coreos/fedora-coreos-tracker/issues/1333 bls-append-except-default: grub_users="" + # Opt-in to https://github.com/ostreedev/ostree/pull/2705 which will + # add /boot as the prefix on top of BLS config entries. This is OK + # because there is a symlink that is created in the root of the boot + # filesystem by OSTree (boot -> .) that makes it so that /boot paths + # will always work. + bootprefix: true - type: org.osbuild.mkdir options: paths: