SHA256
1
0
forked from pool/ignition
ignition/0003-Move-the-GPT-header-on-resized-disks.patch
Ignaz Forster 5825f98260 - Patch file cleanup:
* Improve description of
    0003-Move-the-GPT-header-on-resized-disks.patch
  * Rename
    0001-Order-ignition-disks.service-before-systemd-fsck-roo.patch
    to
    0004-Order-ignition-disks.service-before-systemd-fsck-roo.patch
  * Rename
    0001-dracut-Don-t-include-the-ignition-module-by-default.patch
    to
    0005-dracut-Don-t-include-the-ignition-module-by-default.patch

OBS-URL: https://build.opensuse.org/package/show/devel:kubic:ignition/ignition?expand=0&rev=113
2023-09-06 11:12:20 +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