From 3a3c0ac3b0bb79e1a8d3d832820ac4c23ea1069a Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Fri, 8 Dec 2023 17:10:06 -0500 Subject: [PATCH 1/2] overlay.d: add 40grub overlay bootupd upstream was modified to store default static grub configs and allow for OS integrators to add their own snippets by placing files in /usr/lib/bootupd/grub2-static/configs.d/ [1] When we move to building with osbuild we will start taking advantage of this functionality and calling bootupd with --with-static-configs. Let's go ahead and add our snippets here so they can be leveraged when we start calling bootupd with --with-static-configs. The snippets added here come from the parts of the config currently defined in coreos-assembler that weren't lifted into bootupd [2][3][4]. [1] https://github.com/coreos/bootupd/pull/543 [2] https://github.com/coreos/coreos-assembler/blob/4636b1a5c6dc00b1d6a58b1bfbb199431444336b/src/grub.cfg#L58-L60 [3] https://github.com/coreos/coreos-assembler/blob/4636b1a5c6dc00b1d6a58b1bfbb199431444336b/src/grub.cfg#L71-L85 [4] https://github.com/coreos/coreos-assembler/blob/4636b1a5c6dc00b1d6a58b1bfbb199431444336b/src/grub.cfg#L87-L91 (cherry picked from commit b40f727e95b044201cde232a2ca64ec8a862b2ea) --- manifests/fedora-coreos-base.yaml | 1 + .../grub2-static/configs.d/30_console.cfg | 4 ++++ .../configs.d/40_coreos-ignition.cfg | 18 ++++++++++++++++++ .../grub2-static/configs.d/70_coreos-user.cfg | 6 ++++++ overlay.d/README.md | 6 ++++++ 5 files changed, 35 insertions(+) create mode 100644 overlay.d/40grub/usr/lib/bootupd/grub2-static/configs.d/30_console.cfg create mode 100644 overlay.d/40grub/usr/lib/bootupd/grub2-static/configs.d/40_coreos-ignition.cfg create mode 100644 overlay.d/40grub/usr/lib/bootupd/grub2-static/configs.d/70_coreos-user.cfg diff --git a/manifests/fedora-coreos-base.yaml b/manifests/fedora-coreos-base.yaml index 490e62bc96..35be6cd2dd 100644 --- a/manifests/fedora-coreos-base.yaml +++ b/manifests/fedora-coreos-base.yaml @@ -18,6 +18,7 @@ ostree-layers: - overlay/20platform-chrony - overlay/25azure-udev-rules - overlay/30lvmdevices + - overlay/40grub # Be minimal recommends: false diff --git a/overlay.d/40grub/usr/lib/bootupd/grub2-static/configs.d/30_console.cfg b/overlay.d/40grub/usr/lib/bootupd/grub2-static/configs.d/30_console.cfg new file mode 100644 index 0000000000..d352292fc8 --- /dev/null +++ b/overlay.d/40grub/usr/lib/bootupd/grub2-static/configs.d/30_console.cfg @@ -0,0 +1,4 @@ + +# Any non-default console settings will be inserted here. +# CONSOLE-SETTINGS-START +# CONSOLE-SETTINGS-END diff --git a/overlay.d/40grub/usr/lib/bootupd/grub2-static/configs.d/40_coreos-ignition.cfg b/overlay.d/40grub/usr/lib/bootupd/grub2-static/configs.d/40_coreos-ignition.cfg new file mode 100644 index 0000000000..31bda1dcec --- /dev/null +++ b/overlay.d/40grub/usr/lib/bootupd/grub2-static/configs.d/40_coreos-ignition.cfg @@ -0,0 +1,18 @@ +# Remove soon when Ignition is providing this: +# https://github.com/coreos/fedora-coreos-config/pull/2769#discussion_r1428152480 +# +# Determine if this is a first boot and set the ${ignition_firstboot} variable +# which is used in the kernel command line. +set ignition_firstboot="" +if [ -f "/ignition.firstboot" ]; then + # Default networking parameters to be used with ignition. + set ignition_network_kcmdline='' + + # Source in the `ignition.firstboot` file which could override the + # above $ignition_network_kcmdline with static networking config. + # This override feature is also by coreos-installer to persist static + # networking config provided during install to the first boot of the machine. + source "/ignition.firstboot" + + set ignition_firstboot="ignition.firstboot ${ignition_network_kcmdline}" +fi diff --git a/overlay.d/40grub/usr/lib/bootupd/grub2-static/configs.d/70_coreos-user.cfg b/overlay.d/40grub/usr/lib/bootupd/grub2-static/configs.d/70_coreos-user.cfg new file mode 100644 index 0000000000..8c4460b127 --- /dev/null +++ b/overlay.d/40grub/usr/lib/bootupd/grub2-static/configs.d/70_coreos-user.cfg @@ -0,0 +1,6 @@ + +# Import user defined configuration +# tracker: https://github.com/coreos/fedora-coreos-tracker/issues/805 +if [ -f $prefix/user.cfg ]; then + source $prefix/user.cfg +fi diff --git a/overlay.d/README.md b/overlay.d/README.md index 23b64bdd13..4ef0405e28 100644 --- a/overlay.d/README.md +++ b/overlay.d/README.md @@ -93,3 +93,9 @@ pre-existing LVM devices attached. See the tracker issue [1] for more information. [1] https://github.com/coreos/fedora-coreos-tracker/issues/1517 + +40grub +------ + +Add in static grub configs that will be leveraged by bootupd when +managing bootloaders. See https://github.com/coreos/bootupd/pull/543 From bde82437736b795c087ae26a136d6c917780862f Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Thu, 19 Jan 2023 17:56:41 -0500 Subject: [PATCH 2/2] .cci.jenkinsfile: disable testing on older RHCOS branch The tests won't pass because they run with latest COSA and not the branch specific COSA. Let's just disable them for now. (cherry picked from commit 5be9e141a7fb90a9b41797f00064269955744a33) --- .cci.jenkinsfile | 70 +----------------------------------------------- 1 file changed, 1 insertion(+), 69 deletions(-) diff --git a/.cci.jenkinsfile b/.cci.jenkinsfile index d902235a26..9b2638a243 100644 --- a/.cci.jenkinsfile +++ b/.cci.jenkinsfile @@ -1,70 +1,2 @@ // Documentation: https://github.com/coreos/coreos-ci/blob/main/README-upstream-ci.md - -properties([ - // abort previous runs when a PR is updated to save resources - disableConcurrentBuilds(abortPrevious: true) -]) - -// We run `kolaTestIso` which requires at least 8Gi. Add 1Gi for overhead. -cosaPod(cpus: 4, memory: "9Gi") { - checkoutToDir(scm, 'config') - - def basearch = shwrapCapture("cosa basearch") - def mechanical_streams = ['branched', 'rawhide'] - - shwrap("cd config && ci/validate") - - shwrap(""" - mkdir -p /srv/coreos && cd /srv/coreos - cosa init ${env.WORKSPACE}/config - python3 /usr/lib/coreos-assembler/download-overrides.py - # prep from the latest builds so that we generate a diff on PRs that add packages - cosa buildfetch --stream=${env.CHANGE_TARGET} - """) - - // use a --parent-build arg so we can diff later and it matches prod - def parent_arg = "" - def parent_commit = "" - if (shwrapRc("test -e /srv/coreos/builds/latest/${basearch}/meta.json") == 0) { - shwrap("cp /srv/coreos/builds/latest/${basearch}/meta.json .") // readJSON wants it in the WORKSPACE - def meta = readJSON file: "meta.json" - def version = meta["buildid"] - parent_arg = "--parent-build ${version}" - parent_commit = meta["ostree-commit"] - } - - // do a build. If we are operating on a mechanical stream then we - // can pin packages in lockfiles but we don't maintain a full set - // so we can't do a strict build. - def no_strict_build = false - if (env.CHANGE_TARGET in mechanical_streams) { - no_strict_build = true - } - cosaBuild(skipInit: true, noStrict: no_strict_build, extraFetchArgs: '--with-cosa-overrides', extraArgs: parent_arg) - - parallel metal: { - shwrap("cd /srv/coreos && cosa buildextend-metal") - }, metal4k: { - shwrap("cd /srv/coreos && cosa buildextend-metal4k") - } - - stage("Test ISO") { - shwrap("cd /srv/coreos && cosa buildextend-live") - kolaTestIso() - } - - // also print the pkgdiff as a separate stage to make it more visible - if (parent_arg != "") { - stage("RPM Diff") { - shwrap(""" - cd /srv/coreos - new_commit=\$(jq -r '.["ostree-commit"]' builds/latest/${basearch}/meta.json) - rpm-ostree db diff --repo tmp/repo ${parent_commit} \${new_commit} | tee tmp/diff.txt - if grep -q Downgraded tmp/diff.txt; then - echo "Downgrade detected. This is likely unintentional. If not, you may safely ignore this error." - exit 1 - fi - """) - } - } -} +echo "Testing has been disabled for rhcos branches"