Skip to content

Commit a1f9981

Browse files
committed
temp: ignition patch
1 parent eaea93e commit a1f9981

23 files changed

+1465
-1080
lines changed

sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0001-sed-s-coreos-flatcar.patch

+401-999
Large diffs are not rendered by default.

sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0002-config-add-ignition-translation.patch

+18-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
1-
From 09a77afae8ede189033837888062553ff18e7290 Mon Sep 17 00:00:00 2001
1+
From 358dc41cf8f2f44b5b89ab10552683d3fa396792 Mon Sep 17 00:00:00 2001
22
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
33
Date: Mon, 26 Sep 2022 12:12:04 +0200
4-
Subject: [PATCH 02/20] config: add ignition translation
4+
Subject: [PATCH 02/22] config: add ignition translation
55

66
it's a merge from flatcar/ign-converter
77

88
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
99
---
10+
build | 2 +-
1011
config/util/translate.go | 166 +++
1112
config/v24tov31/v24tov31.go | 729 +++++++++++++
1213
config/v24tov31/v24tov31_test.go | 1692 ++++++++++++++++++++++++++++++
13-
3 files changed, 2587 insertions(+)
14+
4 files changed, 2588 insertions(+), 1 deletion(-)
1415
create mode 100644 config/util/translate.go
1516
create mode 100644 config/v24tov31/v24tov31.go
1617
create mode 100644 config/v24tov31/v24tov31_test.go
1718

19+
diff --git a/build b/build
20+
index 4a50527c..5abdcf5f 100755
21+
--- a/build
22+
+++ b/build
23+
@@ -5,7 +5,7 @@ set -eu
24+
export GO111MODULE=on
25+
26+
NAME="ignition"
27+
-ORG_PATH="github.com/coreos"
28+
+ORG_PATH="github.com/flatcar"
29+
REPO_PATH="${ORG_PATH}/${NAME}/v2"
30+
GLDFLAGS=${GLDFLAGS:-}
31+
export GOFLAGS=-mod=vendor
1832
diff --git a/config/util/translate.go b/config/util/translate.go
1933
new file mode 100644
2034
index 00000000..347d148c
@@ -2621,5 +2635,5 @@ index 00000000..e81f6bed
26212635
+ }
26222636
+}
26232637
--
2624-
2.44.2
2638+
2.43.0
26252639

Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
From b736afa1321345564c6ef6675a980b3187a085b1 Mon Sep 17 00:00:00 2001
1+
From 2b2d5e325a944050f17cd82a15cf766419c4a015 Mon Sep 17 00:00:00 2001
22
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
3-
Date: Thu, 24 Oct 2024 10:19:08 +0200
4-
Subject: [PATCH 03/20] mod: add flatcar/ignition@0.36.2
3+
Date: Fri, 7 Jun 2024 09:09:18 +0200
4+
Subject: [PATCH 03/22] mod: add flatcar/ignition@0.36.2
55

66
it's required for Ignition conversion.
77

88
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
99
---
10-
go.mod | 4 ++++
11-
1 file changed, 4 insertions(+)
10+
go.mod | 3 +++
11+
1 file changed, 3 insertions(+)
1212

1313
diff --git a/go.mod b/go.mod
14-
index a22b3edb..11ea000e 100644
14+
index a22b3edb..69f63ef7 100644
1515
--- a/go.mod
1616
+++ b/go.mod
1717
@@ -11,6 +11,7 @@ require (
@@ -32,14 +32,6 @@ index a22b3edb..11ea000e 100644
3232
github.com/davecgh/go-spew v1.1.1 // indirect
3333
github.com/felixge/httpsnoop v1.0.4 // indirect
3434
github.com/go-logr/logr v1.4.1 // indirect
35-
@@ -53,6 +56,7 @@ require (
36-
go.opentelemetry.io/otel v1.24.0 // indirect
37-
go.opentelemetry.io/otel/metric v1.24.0 // indirect
38-
go.opentelemetry.io/otel/trace v1.24.0 // indirect
39-
+ go4.org v0.0.0-20160314031811-03efcb870d84 // indirect
40-
golang.org/x/crypto v0.28.0 // indirect
41-
golang.org/x/sync v0.8.0 // indirect
42-
golang.org/x/text v0.19.0 // indirect
4335
--
44-
2.44.2
36+
2.43.0
4537

sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0004-sum-go-mod-tidy.patch

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 3bd24e98f80056f32de366e87b754e3313138e25 Mon Sep 17 00:00:00 2001
1+
From a38cd1605b977de8804978a2a6c9631633dd4a4d Mon Sep 17 00:00:00 2001
22
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
3-
Date: Thu, 24 Oct 2024 10:19:25 +0200
4-
Subject: [PATCH 04/20] sum: go mod tidy
3+
Date: Fri, 7 Jun 2024 09:09:50 +0200
4+
Subject: [PATCH 04/22] sum: go mod tidy
55

66
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
77
---
@@ -143,5 +143,5 @@ index 556ebeec..d79ae2e0 100644
143143
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
144144
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
145145
--
146-
2.44.2
146+
2.43.0
147147

sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0005-vendor-go-mod-vendor.patch

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From c051ca72c703700943c79d28b154e460ecb23db1 Mon Sep 17 00:00:00 2001
1+
From c4630f9868f10116355373d5a24b006f191811fa Mon Sep 17 00:00:00 2001
22
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
3-
Date: Thu, 24 Oct 2024 10:19:43 +0200
4-
Subject: [PATCH 05/20] vendor: go mod vendor
3+
Date: Fri, 7 Jun 2024 09:10:35 +0200
4+
Subject: [PATCH 05/22] vendor: go mod vendor
55

66
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
77
---
@@ -155,8 +155,8 @@ Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
155155
vendor/go4.org/AUTHORS | 8 +
156156
vendor/go4.org/LICENSE | 202 +++
157157
vendor/go4.org/errorutil/highlight.go | 58 +
158-
vendor/modules.txt | 30 +
159-
151 files changed, 15850 insertions(+)
158+
vendor/modules.txt | 32 +-
159+
151 files changed, 15851 insertions(+), 1 deletion(-)
160160
create mode 100644 vendor/github.com/ajeddeloh/go-json/README
161161
create mode 100644 vendor/github.com/ajeddeloh/go-json/decode.go
162162
create mode 100644 vendor/github.com/ajeddeloh/go-json/encode.go
@@ -17029,7 +17029,7 @@ index 00000000..1b1efb0f
1702917029
+ return
1703017030
+}
1703117031
diff --git a/vendor/modules.txt b/vendor/modules.txt
17032-
index 0d4a188c..8ffe2ea7 100644
17032+
index 0d4a188c..57536b55 100644
1703317033
--- a/vendor/modules.txt
1703417034
+++ b/vendor/modules.txt
1703517035
@@ -36,6 +36,9 @@ cloud.google.com/go/storage
@@ -17080,16 +17080,19 @@ index 0d4a188c..8ffe2ea7 100644
1708017080
# github.com/go-logr/logr v1.4.1
1708117081
## explicit; go 1.18
1708217082
github.com/go-logr/logr
17083-
@@ -264,6 +291,9 @@ go.opentelemetry.io/otel/metric/noop
17083+
@@ -264,8 +291,11 @@ go.opentelemetry.io/otel/metric/noop
1708417084
## explicit; go 1.20
1708517085
go.opentelemetry.io/otel/trace
1708617086
go.opentelemetry.io/otel/trace/embedded
1708717087
+# go4.org v0.0.0-20160314031811-03efcb870d84
1708817088
+## explicit
1708917089
+go4.org/errorutil
1709017090
# golang.org/x/crypto v0.28.0
17091-
## explicit; go 1.20
17091+
-## explicit; go 1.20
17092+
+## explicit; go 1.18
1709217093
golang.org/x/crypto/chacha20
17094+
golang.org/x/crypto/chacha20poly1305
17095+
golang.org/x/crypto/cryptobyte
1709317096
--
17094-
2.44.2
17097+
2.43.0
1709517098

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
From 2c91043cc1181596c363341ee5b974808b6cc44d Mon Sep 17 00:00:00 2001
2+
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
3+
Date: Wed, 25 May 2022 10:20:09 +0200
4+
Subject: [PATCH 06/22] config/v3_5: convert ignition 2.x to 3.x
5+
6+
if the version of ignition is 2.x we convert it to 3.x using
7+
ign-converter.
8+
9+
it should support any 2.x version (or at the least the last 2 releases)
10+
11+
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
12+
---
13+
config/v3_6_experimental/config.go | 37 ++++++++++++++++++++++++++++++
14+
1 file changed, 37 insertions(+)
15+
16+
diff --git a/config/v3_6_experimental/config.go b/config/v3_6_experimental/config.go
17+
index 3be26cae..ea367663 100644
18+
--- a/config/v3_6_experimental/config.go
19+
+++ b/config/v3_6_experimental/config.go
20+
@@ -15,9 +15,14 @@
21+
package v3_6_experimental
22+
23+
import (
24+
+ "encoding/json"
25+
+ "fmt"
26+
+
27+
+ "github.com/flatcar/ignition/config/v2_4"
28+
"github.com/flatcar/ignition/v2/config/merge"
29+
"github.com/flatcar/ignition/v2/config/shared/errors"
30+
"github.com/flatcar/ignition/v2/config/util"
31+
+ "github.com/flatcar/ignition/v2/config/v24tov31"
32+
prev "github.com/flatcar/ignition/v2/config/v3_5"
33+
"github.com/flatcar/ignition/v2/config/v3_6_experimental/translate"
34+
"github.com/flatcar/ignition/v2/config/v3_6_experimental/types"
35+
@@ -67,6 +72,38 @@ func ParseCompatibleVersion(raw []byte) (types.Config, report.Report, error) {
36+
return types.Config{}, rpt, err
37+
}
38+
39+
+ // if the version is 2.x or 1.x, we
40+
+ // convert it to 3.1
41+
+ if version.Major != 3 {
42+
+ // Parse should fallback on every 2.x supported version
43+
+ cfg, _, err := v2_4.Parse(raw)
44+
+ if err != nil || rpt.IsFatal() {
45+
+ return types.Config{}, report.Report{}, fmt.Errorf("unable to parse 2.x ignition: %w", err)
46+
+ }
47+
+
48+
+ /*
49+
+ map[string]string{} is required by the ign-converter
50+
+ Ignition Spec 3 will mount filesystems at the mountpoint specified by path when running.
51+
+ Filesystems no longer have the name field and files, links, and directories no longer specify the filesystem by name.
52+
+ This means to translate filesystems (with the exception of root),
53+
+ you must also provide a mapping of filesystem name to absolute path, e.g.
54+
+ ```
55+
+ map[string]string{"var": "/var"}
56+
+ ```
57+
+ */
58+
+ newCfg, err := v24tov31.Translate(cfg, map[string]string{})
59+
+ if err != nil {
60+
+ return types.Config{}, report.Report{}, fmt.Errorf("unable to translate 2.x ignition to 3.1: %w", err)
61+
+
62+
+ }
63+
+
64+
+ // update raw in place to continue with the 3.x logic
65+
+ raw, err = json.Marshal(newCfg)
66+
+ if err != nil {
67+
+ return types.Config{}, report.Report{}, fmt.Errorf("unable to render JSON: %w", err)
68+
+ }
69+
+ }
70+
+
71+
if version == types.MaxVersion {
72+
return Parse(raw)
73+
}
74+
--
75+
2.43.0
76+

sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0007-internal-prv-cmdline-backport-flatcar-patch.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 2f5a68dc1c780e1e8647951e1e15c78d569b6ac4 Mon Sep 17 00:00:00 2001
1+
From 20010d9ad2ac1f9ffad7c1615deaacf0fc27d245 Mon Sep 17 00:00:00 2001
22
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
33
Date: Mon, 19 Feb 2024 18:12:22 +0100
4-
Subject: [PATCH 07/20] internal/prv/cmdline: backport flatcar patch
4+
Subject: [PATCH 07/22] internal/prv/cmdline: backport flatcar patch
55

66
this patch provides backward compatibility for various config
77
key
@@ -36,5 +36,5 @@ index 30203bff..86a5cb79 100644
3636
}
3737

3838
--
39-
2.44.2
39+
2.43.0
4040

sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0008-provider-qemu-apply-fw_cfg-patch.patch

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
1-
From 41e66c950879d3b1cddd2a80a48dbd3bf35413f4 Mon Sep 17 00:00:00 2001
1+
From b349dcbf3563c7b9c71858be1a3f582e26b269e7 Mon Sep 17 00:00:00 2001
22
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
33
Date: Tue, 20 Feb 2024 10:02:28 +0100
4-
Subject: [PATCH 08/20] provider/qemu: apply fw_cfg patch
4+
Subject: [PATCH 08/22] provider/qemu: apply fw_cfg patch
55

66
we support both CoreOS and Flatcar fw_cfg path to ensure compatiblity
77

88
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
99
---
10-
internal/providers/qemu/qemu_fwcfg.go | 118 ++++++++++++++------------
11-
1 file changed, 63 insertions(+), 55 deletions(-)
10+
internal/providers/qemu/qemu_fwcfg.go | 120 ++++++++++++++------------
11+
1 file changed, 64 insertions(+), 56 deletions(-)
1212

1313
diff --git a/internal/providers/qemu/qemu_fwcfg.go b/internal/providers/qemu/qemu_fwcfg.go
14-
index 389ec119..cab9c476 100644
14+
index 389ec119..e233865a 100644
1515
--- a/internal/providers/qemu/qemu_fwcfg.go
1616
+++ b/internal/providers/qemu/qemu_fwcfg.go
17-
@@ -29,6 +29,7 @@ import (
17+
@@ -29,7 +29,8 @@ import (
1818
"strings"
1919
"time"
2020

21+
- "github.com/flatcar/ignition/v2/config/v3_6_experimental/types"
2122
+ iErrors "github.com/flatcar/ignition/v2/config/shared/errors"
22-
"github.com/flatcar/ignition/v2/config/v3_6_experimental/types"
23+
+ "github.com/flatcar/ignition/v2/config/v3_5_experimental/types"
2324
"github.com/flatcar/ignition/v2/internal/distro"
2425
"github.com/flatcar/ignition/v2/internal/platform"
26+
"github.com/flatcar/ignition/v2/internal/providers/util"
2527
@@ -38,9 +39,11 @@ import (
2628
"github.com/coreos/vcontext/report"
2729
)
@@ -159,5 +161,5 @@ index 389ec119..cab9c476 100644
159161
+
160162
}
161163
--
162-
2.44.2
164+
2.43.0
163165

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
From 3563a694333cec6b5d48e3b24d58460369d72337 Mon Sep 17 00:00:00 2001
2+
From: Mathieu Tortuyaux <mathieu@kinvolk.io>
3+
Date: Thu, 2 Sep 2021 11:03:17 +0200
4+
Subject: [PATCH 09/22] config/3_5/test: add ignition 2.x test cases
5+
6+
Signed-off-by: Mathieu Tortuyaux <mathieu@kinvolk.io>
7+
---
8+
config/v3_5/config_test.go | 20 ++++++++++++++++++++
9+
1 file changed, 20 insertions(+)
10+
11+
diff --git a/config/v3_5/config_test.go b/config/v3_5/config_test.go
12+
index 425eb544..88e5d2d6 100644
13+
--- a/config/v3_5/config_test.go
14+
+++ b/config/v3_5/config_test.go
15+
@@ -161,6 +161,26 @@ func TestParse(t *testing.T) {
16+
in in
17+
out out
18+
}{
19+
+ {
20+
+ in: in{config: []byte(`{"ignition": {"version": "2.0.0"}}`)},
21+
+ out: out{config: types.Config{Ignition: types.Ignition{Version: types.MaxVersion.String()}}},
22+
+ },
23+
+ {
24+
+ in: in{config: []byte(`{"ignition": {"version": "2.1.0"}}`)},
25+
+ out: out{config: types.Config{Ignition: types.Ignition{Version: types.MaxVersion.String()}}},
26+
+ },
27+
+ {
28+
+ in: in{config: []byte(`{"ignition": {"version": "2.2.0"}}`)},
29+
+ out: out{config: types.Config{Ignition: types.Ignition{Version: types.MaxVersion.String()}}},
30+
+ },
31+
+ {
32+
+ in: in{config: []byte(`{"ignition": {"version": "2.3.0"}}`)},
33+
+ out: out{config: types.Config{Ignition: types.Ignition{Version: types.MaxVersion.String()}}},
34+
+ },
35+
+ {
36+
+ in: in{config: []byte(`{"ignition": {"version": "2.4.0"}}`)},
37+
+ out: out{config: types.Config{Ignition: types.Ignition{Version: types.MaxVersion.String()}}},
38+
+ },
39+
{
40+
in: in{config: []byte(`{"ignition": {"version": "3.0.0"}}`)},
41+
out: out{config: types.Config{Ignition: types.Ignition{Version: types.MaxVersion.String()}}},
42+
--
43+
2.43.0
44+

sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0010-internal-disk-fs-ignore-fs-format-mismatches-for-the.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From c64bfd1cfa7992396609ad55b1e3dba29ce4026c Mon Sep 17 00:00:00 2001
1+
From a10e49004615f119d63dc1bf2c751489529465b3 Mon Sep 17 00:00:00 2001
22
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
33
Date: Wed, 22 Sep 2021 14:53:49 +0200
4-
Subject: [PATCH 10/20] internal/disk/fs: ignore fs format mismatches for the
4+
Subject: [PATCH 10/22] internal/disk/fs: ignore fs format mismatches for the
55
OEM partition
66

77
As soon as the OEM partition's filesystem format changes, all users
@@ -35,5 +35,5 @@ index c575ced4..fefd1fff 100644
3535
(fs.UUID == nil || canonicalizeFilesystemUUID(info.Type, info.UUID) == canonicalizeFilesystemUUID(fileSystemFormat, *fs.UUID)) {
3636
s.Logger.Info("filesystem at %q is already correctly formatted. Skipping mkfs...", fs.Device)
3737
--
38-
2.44.2
38+
2.43.0
3939

sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0011-VMware-Fix-guestinfo.-.config.data-and-.config.url-v.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 0bcc2592c3809a86c7649cd667bd481e5526af2e Mon Sep 17 00:00:00 2001
1+
From 30f317e5abb48225a74b2114355a21d871f20f35 Mon Sep 17 00:00:00 2001
22
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
33
Date: Tue, 20 Feb 2024 10:12:02 +0100
4-
Subject: [PATCH 11/20] VMware: Fix guestinfo.*.config.data and *.config.url
4+
Subject: [PATCH 11/22] VMware: Fix guestinfo.*.config.data and *.config.url
55
variables
66
MIME-Version: 1.0
77
Content-Type: text/plain; charset=UTF-8
@@ -164,5 +164,5 @@ index 597c33fd..3680a4cd 100644
164164

165165
func delConfig(f *resource.Fetcher) error {
166166
--
167-
2.44.2
167+
2.43.0
168168

sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0012-config-version-handle-configuration-version-1.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 6f4ae547913ed6be8801ec17fd91f3ce0769d34e Mon Sep 17 00:00:00 2001
1+
From cf0edd978eff88798571e19856e874fd877eed90 Mon Sep 17 00:00:00 2001
22
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
33
Date: Wed, 2 Feb 2022 13:27:18 +0100
4-
Subject: [PATCH 12/20] config/version: handle configuration version 1
4+
Subject: [PATCH 12/22] config/version: handle configuration version 1
55

66
version 2 should be able to translate configuration version 1 but the `GetConfigVersion`
77
was not able to detect version 1 configuration since for this particular
@@ -49,5 +49,5 @@ index 3b9bb22f..f81056fa 100644
4949
return semver.Version{}, report.Report{}, errors.ErrInvalidVersion
5050
}
5151
--
52-
2.44.2
52+
2.43.0
5353

0 commit comments

Comments
 (0)