diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0017-translation-support-OEM-and-oem.patch b/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0017-translation-support-OEM-and-oem.patch new file mode 100644 index 0000000000..e6fdab4458 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0017-translation-support-OEM-and-oem.patch @@ -0,0 +1,161 @@ +From c2f82824e643a06b0663ab410ad28ecdd5c3d3be Mon Sep 17 00:00:00 2001 +From: Mathieu Tortuyaux +Date: Thu, 10 Nov 2022 11:58:49 +0100 +Subject: [PATCH] translation: support OEM and oem + +Signed-off-by: Mathieu Tortuyaux +--- + config/v24tov31/v24tov31.go | 6 +- + config/v24tov31/v24tov31_test.go | 109 +++++++++++++++++++++++++++++++ + 2 files changed, 112 insertions(+), 3 deletions(-) + +diff --git a/config/v24tov31/v24tov31.go b/config/v24tov31/v24tov31.go +index 46749385..68da4014 100644 +--- a/config/v24tov31/v24tov31.go ++++ b/config/v24tov31/v24tov31.go +@@ -21,14 +21,14 @@ import ( + "path" + "path/filepath" + "reflect" ++ "strings" + + old "github.com/flatcar/ignition/config/v2_4/types" + oldValidate "github.com/flatcar/ignition/config/validate" + "github.com/flatcar/ignition/v2/config/merge" ++ "github.com/flatcar/ignition/v2/config/util" + "github.com/flatcar/ignition/v2/config/v3_1/types" + "github.com/flatcar/ignition/v2/config/validate" +- "github.com/flatcar/ignition/v2/config/util" +- + ) + + // Check2_4 returns if the config is translatable but does not do any translation. +@@ -474,7 +474,7 @@ func translateFilesystems(fss []old.Filesystem, m map[string]string) (ret []type + } + + format := f.Mount.Format +- if f.Name == "oem" && (wipe == nil || !*wipe) { ++ if strings.ToLower(f.Name) == "oem" && (wipe == nil || !*wipe) { + format = "btrfs" + } + +diff --git a/config/v24tov31/v24tov31_test.go b/config/v24tov31/v24tov31_test.go +index e81f6bed..68c07109 100644 +--- a/config/v24tov31/v24tov31_test.go ++++ b/config/v24tov31/v24tov31_test.go +@@ -1690,3 +1690,112 @@ func TestDuplicateUnits(t *testing.T) { + assert.Equal(t, test.ign3, res) + } + } ++ ++func TestOEMPartition(t *testing.T) { ++ tests := []struct { ++ ign types2_4.Config ++ fsFormat string ++ }{ ++ { ++ ign: types2_4.Config{ ++ Ignition: types2_4.Ignition{ ++ Version: "2.4.0", ++ Config: types2_4.IgnitionConfig{}, ++ Timeouts: types2_4.Timeouts{}, ++ Security: types2_4.Security{}, ++ Proxy: types2_4.Proxy{}, ++ }, ++ Storage: types2_4.Storage{ ++ Filesystems: []types2_4.Filesystem{ ++ { ++ Name: "OEM", ++ Mount: &types2_4.Mount{ ++ Device: "/dev/disk/by-label/OEM", ++ Format: "ext4", ++ }, ++ }, ++ }, ++ }, ++ }, ++ fsFormat: "btrfs", ++ }, ++ { ++ ign: types2_4.Config{ ++ Ignition: types2_4.Ignition{ ++ Version: "2.4.0", ++ Config: types2_4.IgnitionConfig{}, ++ Timeouts: types2_4.Timeouts{}, ++ Security: types2_4.Security{}, ++ Proxy: types2_4.Proxy{}, ++ }, ++ Storage: types2_4.Storage{ ++ Filesystems: []types2_4.Filesystem{ ++ { ++ Name: "oem", ++ Mount: &types2_4.Mount{ ++ Device: "/dev/disk/by-label/OEM", ++ Format: "ext4", ++ }, ++ }, ++ }, ++ }, ++ }, ++ fsFormat: "btrfs", ++ }, ++ { ++ ign: types2_4.Config{ ++ Ignition: types2_4.Ignition{ ++ Version: "2.4.0", ++ Config: types2_4.IgnitionConfig{}, ++ Timeouts: types2_4.Timeouts{}, ++ Security: types2_4.Security{}, ++ Proxy: types2_4.Proxy{}, ++ }, ++ Storage: types2_4.Storage{ ++ Filesystems: []types2_4.Filesystem{ ++ { ++ Name: "OEM", ++ Mount: &types2_4.Mount{ ++ Device: "/dev/disk/by-label/OEM", ++ Format: "ext4", ++ WipeFilesystem: true, ++ }, ++ }, ++ }, ++ }, ++ }, ++ fsFormat: "ext4", ++ }, ++ { ++ ign: types2_4.Config{ ++ Ignition: types2_4.Ignition{ ++ Version: "2.4.0", ++ Config: types2_4.IgnitionConfig{}, ++ Timeouts: types2_4.Timeouts{}, ++ Security: types2_4.Security{}, ++ Proxy: types2_4.Proxy{}, ++ }, ++ Storage: types2_4.Storage{ ++ Filesystems: []types2_4.Filesystem{ ++ { ++ Name: "oem", ++ Mount: &types2_4.Mount{ ++ Device: "/dev/disk/by-label/OEM", ++ Format: "ext4", ++ WipeFilesystem: true, ++ }, ++ }, ++ }, ++ }, ++ }, ++ fsFormat: "ext4", ++ }, ++ } ++ ++ for _, test := range tests { ++ res, err := v24tov31.Translate(test.ign, nil) ++ ++ assert.Nil(t, err) ++ assert.Equal(t, test.fsFormat, *res.Storage.Filesystems[0].Format) ++ } ++} +-- +2.35.1 + diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/ignition-2.14.0-r4.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/ignition-2.14.0-r5.ebuild similarity index 100% rename from sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/ignition-2.14.0-r4.ebuild rename to sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/ignition-2.14.0-r5.ebuild diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/ignition-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/ignition-9999.ebuild index b361e6c794..3def4974c7 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/ignition-9999.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/ignition-9999.ebuild @@ -58,6 +58,7 @@ PATCHES=( "${FILESDIR}/0014-Revert-drop-OEM-URI-support.patch" "${FILESDIR}/0015-internal-resource-url-support-btrfs-as-OEM-partition.patch" "${FILESDIR}/0016-internal-exec-stages-disks-prevent-races-with-udev.patch" + "${FILESDIR}/0017-translation-support-OEM-and-oem.patch" ) src_compile() {