ignition/0003-Move-the-GPT-header-on-resized-disks.patch
Ignaz Forster afaa367f82 - Drop "go clean" from the upstream build script: since we build in
clean environments, we don't have caches. Additionally, the way
  it is used does not even work and reports:
    go: clean -cache cannot be used with package arguments
  The error was masked until GO 1.23, as the test wether go
  supported caching was checking for go 1.23 formatted output.

OBS-URL: https://build.opensuse.org/package/show/devel:kubic:ignition/ignition?expand=0&rev=129
2024-09-06 21:57:18 +00:00

31 lines
1.2 KiB
Diff

From: Ignaz Forster <iforster@suse.com>
Date: Tue, 22 Aug 2023 16:13:07 +0200
Subject: [PATCH] Move GTP header to the end on resized disk images
Fedora CoreOS is handling the GPT move by putting flags into the disk's
GUID (see also [gh#coreos/ignition#839]) and then adjusting the root disk
in
https://github.com/coreos/fedora-coreos-config/blob/testing-devel/overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/coreos-gpt-setup.sh.
We are not using the CoreOS Assembler and have no reason to change the
UUID, so introducing a dracut service just to possibly move the GPT seems
like overkill. Just do so when creating new partitions.
---
internal/sgdisk/sgdisk.go | 1 +
1 file changed, 1 insertion(+)
diff --git a/internal/sgdisk/sgdisk.go b/internal/sgdisk/sgdisk.go
index 29915809..9be5a9e6 100644
--- a/internal/sgdisk/sgdisk.go
+++ b/internal/sgdisk/sgdisk.go
@@ -138,6 +138,7 @@ func (op Operation) buildOptions() []string {
}
for _, p := range op.parts {
+ opts = append(opts, "--move-second-header")
opts = append(opts, fmt.Sprintf("--new=%d:%s:+%s", p.Number, partitionGetStart(p), partitionGetSize(p)))
if p.Label != nil {
opts = append(opts, fmt.Sprintf("--change-name=%d:%s", p.Number, *p.Label))
--
2.41.0