diff --git a/0002-allow-multiple-mounts-of-same-device.patch b/0002-allow-multiple-mounts-of-same-device.patch index 13d491d..3cd3b8b 100644 --- a/0002-allow-multiple-mounts-of-same-device.patch +++ b/0002-allow-multiple-mounts-of-same-device.patch @@ -6,10 +6,10 @@ Upstream: Ticket opened [gh#coreos/ignition#890] e.g. to mount several subvolumes from a Btrfs device or bind mounting the device to multiple places, by also adding the path to the key. -Index: ignition-2.3.0/config/v3_1/types/filesystem.go +Index: ignition-2.4.0/config/v3_1/types/filesystem.go =================================================================== ---- ignition-2.3.0.orig/config/v3_1/types/filesystem.go -+++ ignition-2.3.0/config/v3_1/types/filesystem.go +--- ignition-2.4.0.orig/config/v3_1/types/filesystem.go ++++ ignition-2.4.0/config/v3_1/types/filesystem.go @@ -23,7 +23,7 @@ import ( ) @@ -19,10 +19,10 @@ Index: ignition-2.3.0/config/v3_1/types/filesystem.go } func (f Filesystem) IgnoreDuplicates() map[string]struct{} { -Index: ignition-2.3.0/config/v3_2/types/filesystem.go +Index: ignition-2.4.0/config/v3_2/types/filesystem.go =================================================================== ---- ignition-2.3.0.orig/config/v3_2/types/filesystem.go -+++ ignition-2.3.0/config/v3_2/types/filesystem.go +--- ignition-2.4.0.orig/config/v3_2/types/filesystem.go ++++ ignition-2.4.0/config/v3_2/types/filesystem.go @@ -23,7 +23,7 @@ import ( ) @@ -32,10 +32,23 @@ Index: ignition-2.3.0/config/v3_2/types/filesystem.go } func (f Filesystem) IgnoreDuplicates() map[string]struct{} { -Index: ignition-2.3.0/config/v3_3_experimental/types/filesystem.go +Index: ignition-2.4.0/config/v3_3/types/filesystem.go =================================================================== ---- ignition-2.3.0.orig/config/v3_3_experimental/types/filesystem.go -+++ ignition-2.3.0/config/v3_3_experimental/types/filesystem.go +--- ignition-2.4.0.orig/config/v3_3/types/filesystem.go ++++ ignition-2.4.0/config/v3_3/types/filesystem.go +@@ -23,7 +23,7 @@ import ( + ) + + func (f Filesystem) Key() string { +- return f.Device ++ return f.Device + *f.Path + } + + func (f Filesystem) IgnoreDuplicates() map[string]struct{} { +Index: ignition-2.4.0/config/v3_4_experimental/types/filesystem.go +=================================================================== +--- ignition-2.4.0.orig/config/v3_4_experimental/types/filesystem.go ++++ ignition-2.4.0/config/v3_4_experimental/types/filesystem.go @@ -23,7 +23,7 @@ import ( ) diff --git a/README.SUSE b/README.SUSE index 43f414a..34aa941 100644 --- a/README.SUSE +++ b/README.SUSE @@ -35,3 +35,5 @@ Changes for openSUSE / SLE: to avoid having to boot with networking enabled even when it isn't necessary; the actual implementation to start the network is left to the distribution. +* ignition-kargs-helper: + Distribution specific helper script to implement kernel argument support. diff --git a/_service b/_service index eb074ed..e840cad 100644 --- a/_service +++ b/_service @@ -1,7 +1,7 @@ - 2.9.0 - v2.9.0 + 2.11.0 + v2.11.0 git://github.com/coreos/ignition.git git enable diff --git a/_servicedata b/_servicedata index 9930e95..45a8dd1 100644 --- a/_servicedata +++ b/_servicedata @@ -1,6 +1,6 @@ git://github.com/coreos/ignition.git - ef3afc9ee461fa581dae2d65603c312542e03204 + c10c5d4ed00ea05d42223e2877d8f9bdb9f1ce49 \ No newline at end of file diff --git a/ignition-2.11.0.tar.xz b/ignition-2.11.0.tar.xz new file mode 100644 index 0000000..527c4db --- /dev/null +++ b/ignition-2.11.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3f05956d04ce608d8f613313c5462e9bcddcbdc9feb2671ac73925a3c1dace9 +size 2280028 diff --git a/ignition-2.9.0.tar.xz b/ignition-2.9.0.tar.xz deleted file mode 100644 index 762e71c..0000000 --- a/ignition-2.9.0.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:64dce5cc31b8dd4fe524299f018231b397c0a38494fe5a09dc2526edd59d0dd7 -size 2271132 diff --git a/ignition-kargs-helper b/ignition-kargs-helper new file mode 100644 index 0000000..22e8934 --- /dev/null +++ b/ignition-kargs-helper @@ -0,0 +1,79 @@ +#!/bin/bash +# Based on Ignition's examples/ignition-kargs-helper + +set -euxo pipefail + +grubcfg="/sysroot/etc/default/grub" + +# Mount root file system. Note that we mount /boot but we don't unmount it +# because we are run in a systemd unit with MountFlags=slave so it is unmounted +# for us. +. /dracut-state.sh +mount "${root#block:}" "${NEWROOT}" +# Also mount x-initrd.mount flagged mounts to get the current /etc state +awk '$4 ~ /x-initrd.mount/ { system("findmnt /sysroot" $2 " >/dev/null || mount -t " $3 " -o " $4 " " $1 " /sysroot" $2) }' /sysroot/etc/fstab + +orig_kernelopts="$(grep GRUB_CMDLINE_LINUX_DEFAULT "${grubcfg}")" +orig_kernelopts="${orig_kernelopts#*=}" +# trim the leading and trailing quote +orig_kernelopts="${orig_kernelopts:1:-1}" + +# add leading and trailing whitespace to allow for easy sed replacements +kernelopts=" $orig_kernelopts " + +while [[ $# -gt 0 ]] +do + key="$1" + + case $key in + --should-exist) + arg="$2" + # don't repeat the arg + if [[ ! "${kernelopts[*]}" =~ " ${arg} " ]]; then + kernelopts="$kernelopts$arg " + fi + shift 2 + ;; + --should-not-exist) + kernelopts="$(echo "$kernelopts" | sed "s| $2 | |g")" + shift 2 + ;; + *) + echo "Unknown option" + exit 1 + ;; + esac +done + +# trim the leading and trailing whitespace +kernelopts="$(echo "$kernelopts" | sed -e 's,^[[:space:]]*,,' -e 's,[[:space:]]*$,,')" + +# only apply the changes & reboot if changes have been made +if [[ "$kernelopts" != "$orig_kernelopts" ]]; then + combustiondir="/run/combustion/mount/combustion" + # The Combustion script may be located on an external device; if so the + # device is guaranteed to mounted here already: + # combustion-prepare: Before=dracutinitqueue.service + # ignition-fetch: After=basic.target + # Unmount the device, as the new Combustion script will be put at the + # same location below. + if findmnt "${combustiondir}"/.. >/dev/null; then + umount "${combustiondir}"/.. + fi + mkdir -p "${combustiondir}" + # escape escapes to survive the multiple shell invocations + kernelopts="${kernelopts//\\/\\\\\\\\}" + kernelopts="${kernelopts//$/\\\$}" + cat << EOF > "${combustiondir}/script" +sed -i "s|^\(GRUB_CMDLINE_LINUX_DEFAULT=\).*|\1\"$kernelopts\"|" /etc/default/grub +/usr/sbin/grub2-mkconfig > /boot/grub2/grub.cfg +EOF + SYSTEMD_OFFLINE=1 combustion + + # Reset health-checker to prevent an unintended rollback + echo "Clearing GRUB flag" + chroot /sysroot grub2-editenv - set health_checker_flag=0 || true + + reboot +fi + diff --git a/ignition.changes b/ignition.changes index b76a3ae..de40eaa 100644 --- a/ignition.changes +++ b/ignition.changes @@ -1,3 +1,71 @@ +------------------------------------------------------------------- +Thu Jul 8 10:47:50 UTC 2021 - Ignaz Forster + +- If a Combustion device was mounted, then unmount it in + ignition-kargs-helper - the replacement script will be put on + the same location + +------------------------------------------------------------------- +Wed Jul 07 16:39:04 UTC 2021 - iforster@suse.com + +- Update to version 2.11.0: + * news: add notes for 2.11.0 + * Upgraded docs + * config/*: return report from previous parser when chaining + * config/*: re-order testcases by version + * tree: update for stable v3.3.0 and new v3.4.0-experimental + * config/v3_4_experimental: adapt for experimental + * config/v3_4_experimental: copy from config/v3_3 + * config/v3_3: adapt for stabilization + * config/v3_3_experimental: rename to config/v3_3 + * config/v3_3_exp: pointerify ClevisCustom Config and Pin + * config/v3_3_exp: pointerify Raid.Level + * config/v3_3_exp: pointerify LinkEmbedded1.Target + * stages/disks: simplify a check + * config/v3_1/translate: don't point to field from input struct + * config/v3_3_exp: drop devices from schema "required" field + * config/*: validate that storage.raid.devices is non-empty + * config/*/types: add RAID validation tests + * config/shared/errors: fix ErrSparesUnsupportedForLevel message + * config: fix comment + * *: formally bump Go to 1.13 + * platform: add powervs platform + * internal/providers/*stack: drop dead timeout code + * stages/disks: improve error reporting for LUKS device reuse + * ignition-setup-user.service: drop Before=multipathd.service + * Dockerfile: build ignition-validate container using Fedora + * workflows: test on Go 1.16 + * tests/*: verify deletion of block device w/o creating a FS + * *: allow erasing block device without creating a filesystem + * *: rename other projects' master branches to main + * *: rename master branch to main + * config/*: add export functions for parsing any config version < N + * config/*: refactor config.go's Parse() to use GetConfigVersion + * config/* : minor cleanup +- Refreshed to match new Ignition spec + * 0002-allow-multiple-mounts-of-same-device.patch + +------------------------------------------------------------------- +Wed Jul 7 16:05:49 UTC 2021 - Ignaz Forster + +- Implement missing ignition-kargs-helper script for kernel + argument support + +------------------------------------------------------------------- +Mon May 31 14:57:06 UTC 2021 - rpm@fthiessen.de + +- Update to version 2.10.1: + * Breaking Changes: + * Rename Custom struct to ClevisCustom + * Embed Clevis and ClevisCustom structs in parents + * Always include interior nodes in merge transcript + * Add kernel argument support + * Fix fetching userdata on AWS when IMDSv1 is disabled + * Fix creating Tang-based LUKS volumes before network is up + * Document storage.filesystems.wipeFilesystem default + * Fix file mode of ignition-kargs-helper script +- Fix Go dependency, 1.13+ is required + ------------------------------------------------------------------- Wed Mar 31 16:03:16 UTC 2021 - hello@anthonyrabbito.com diff --git a/ignition.spec b/ignition.spec index 0e60727..a247198 100644 --- a/ignition.spec +++ b/ignition.spec @@ -17,7 +17,7 @@ Name: ignition -Version: 2.9.0 +Version: 2.11.0 Release: 0 Summary: First boot installer and configuration tool License: Apache-2.0 @@ -34,6 +34,7 @@ Source7: README.SUSE Source8: ignition-setup-user-suse.sh Source9: ignition-enable-network.service Source10: ignition-enable-network.sh +Source11: ignition-kargs-helper Source20: ignition-userconfig-timeout.conf Source21: ignition-userconfig-timeout-arm.conf Patch2: 0002-allow-multiple-mounts-of-same-device.patch @@ -41,7 +42,7 @@ BuildRequires: dracut BuildRequires: libblkid-devel BuildRequires: systemd-rpm-macros BuildRequires: update-bootloader-rpm-macros -BuildRequires: golang(API) >= 1.12 +BuildRequires: golang(API) >= 1.13 Requires: %{name}-dracut-grub2 Requires: dracut Recommends: %{_sbindir}/groupadd @@ -85,7 +86,7 @@ which creates firstboot_happened after the first boot. %patch2 -p1 mkdir dracut/30ignition-microos grub systemd_suse -chmod +x %{SOURCE3} %{SOURCE4} %{SOURCE8} +chmod +x %{SOURCE3} %{SOURCE4} %{SOURCE8} %{SOURCE11} cp %{SOURCE1} %{SOURCE3} %{SOURCE4} %{SOURCE8} %{SOURCE9} %{SOURCE10} dracut/30ignition-microos/ %ifarch aarch64 %{arm} cp %{SOURCE21} dracut/30ignition-microos/ignition-userconfig-timeout.conf @@ -95,6 +96,7 @@ cp %{SOURCE20} dracut/30ignition-microos/ignition-userconfig-timeout.conf cp %{SOURCE5} grub/ cp %{SOURCE6} systemd_suse/ cp %{SOURCE7} . +cp %{SOURCE11} dracut/30ignition/ignition-kargs-helper.sh %build sed -i -e 's|go build -ldflags|go build -buildmode=pie -ldflags|g' build