sys-apps/ignition: dropped upstreamed patches

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
This commit is contained in:
Mathieu Tortuyaux 2024-10-24 09:53:23 +02:00
parent d1916c2a1d
commit c3b1c5869c
No known key found for this signature in database
GPG Key ID: AC5CCFB52545D9B8
3 changed files with 0 additions and 117 deletions

View File

@ -1,67 +0,0 @@
From 80acac964852b58d835be246bacc8dd8f576ab75 Mon Sep 17 00:00:00 2001
From: Kai Lueke <kailuke@microsoft.com>
Date: Fri, 29 Sep 2023 18:06:09 +0200
Subject: [PATCH 21/21] sgdisk: Run partprobe after partition changes
The sgdisk tool does not update the kernel partition table in contrast
to other similar tools. Often udev can detect the changes but not always
as experienced when adding a new partition on Flatcar's boot disk.
Instead of implicitly relying on some other component to re-read the
kernel partition table, trigger the re-read with partprobe.
---
dracut/30ignition/module-setup.sh | 1 +
internal/distro/distro.go | 2 ++
internal/sgdisk/sgdisk.go | 5 +++++
3 files changed, 8 insertions(+)
diff --git a/dracut/30ignition/module-setup.sh b/dracut/30ignition/module-setup.sh
index 3ac9c11c..7955f8f9 100755
--- a/dracut/30ignition/module-setup.sh
+++ b/dracut/30ignition/module-setup.sh
@@ -40,6 +40,7 @@ install() {
mkfs.xfs \
mkswap \
sgdisk \
+ partprobe \
useradd \
userdel \
usermod \
diff --git a/internal/distro/distro.go b/internal/distro/distro.go
index 79fa8712..239e4268 100644
--- a/internal/distro/distro.go
+++ b/internal/distro/distro.go
@@ -44,6 +44,7 @@ var (
mdadmCmd = "mdadm"
mountCmd = "mount"
sgdiskCmd = "sgdisk"
+ partprobeCmd = "partprobe"
modprobeCmd = "modprobe"
udevadmCmd = "udevadm"
usermodCmd = "usermod"
@@ -103,6 +104,7 @@ func GroupdelCmd() string { return groupdelCmd }
func MdadmCmd() string { return mdadmCmd }
func MountCmd() string { return mountCmd }
func SgdiskCmd() string { return sgdiskCmd }
+func PartprobeCmd() string { return partprobeCmd }
func ModprobeCmd() string { return modprobeCmd }
func UdevadmCmd() string { return udevadmCmd }
func UsermodCmd() string { return usermodCmd }
diff --git a/internal/sgdisk/sgdisk.go b/internal/sgdisk/sgdisk.go
index 136aca67..5f9d399a 100644
--- a/internal/sgdisk/sgdisk.go
+++ b/internal/sgdisk/sgdisk.go
@@ -121,6 +121,11 @@ func (op *Operation) Commit() error {
if _, err := op.logger.LogCmd(cmd, "deleting %d partitions and creating %d partitions on %q", len(op.deletions), len(op.parts), op.dev); err != nil {
return fmt.Errorf("create partitions failed: %v", err)
}
+ // In contrast to similar tools, sgdisk does not trigger the update of the kernel partition table
+ cmd = exec.Command(distro.PartprobeCmd(), op.dev)
+ if _, err := op.logger.LogCmd(cmd, "re-reading of %d deleted partitions and %d created partitions on %q", len(op.deletions), len(op.parts), op.dev); err != nil {
+ return fmt.Errorf("re-reading partitions failed: %v", err)
+ }
return nil
}
--
2.43.2

View File

@ -1,48 +0,0 @@
From c39e78052f563bbbf6ed47c4ddab597562effe87 Mon Sep 17 00:00:00 2001
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Date: Mon, 24 Jun 2024 16:38:09 +0200
Subject: [PATCH] akamai: fix base64 decoding
trailing \x00 character was making Ignition to fail parsing the config.
It is not always the case, that is why we did not catch it earlier: when
there is no padding in the base64 payload, everything was working.
https://pkg.go.dev/encoding/base64#Encoding.Decode
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
---
docs/release-notes.md | 1 +
internal/providers/akamai/akamai.go | 5 +++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index a73ea2a7c..c2a35dca9 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -14,6 +14,7 @@ nav_order: 9
### Bug fixes
+- Fixed Akamai Ignition base64 decoding
## Ignition 2.19.0 (2024-06-05)
diff --git a/internal/providers/akamai/akamai.go b/internal/providers/akamai/akamai.go
index c7debf3b1..648be3bee 100644
--- a/internal/providers/akamai/akamai.go
+++ b/internal/providers/akamai/akamai.go
@@ -86,11 +86,12 @@ func fetchConfig(f *resource.Fetcher) (types.Config, report.Report, error) {
// The Linode Metadata Service requires userdata to be base64-encoded
// when it is uploaded, so we will have to decode the response.
data := make([]byte, base64.StdEncoding.DecodedLen(len(encoded)))
- if _, err := base64.StdEncoding.Decode(data, encoded); err != nil {
+ n, err := base64.StdEncoding.Decode(data, encoded)
+ if err != nil {
return types.Config{}, report.Report{}, fmt.Errorf("decode base64: %w", err)
}
- return util.ParseConfig(f.Logger, data)
+ return util.ParseConfig(f.Logger, data[:n])
}
// defaultTokenTTL is the time-to-live (TTL; in seconds) for an authorization

View File

@ -60,8 +60,6 @@ PATCHES=(
"${FILESDIR}/0018-docs-Add-re-added-platforms-to-docs-to-pass-tests.patch"
"${FILESDIR}/0019-usr-share-oem-oem.patch"
"${FILESDIR}/0020-internal-exec-stages-mount-Mount-oem.patch"
"${FILESDIR}/0021-sgdisk-Run-partprobe-after-partition-changes.patch"
"${FILESDIR}/0022-akamai-fix-base64-decoding.patch"
)
src_compile() {