- Fix segmentation fault if filesystem section of Ignition JSON

doesn't contain path entry
- Add 0003-Move-the-GTP-header-on-resized-disks.patch to make it
  possible to create partitions on resized disk images
- Add dm and crypt modules as dependencies to make it possible to
  configure a luks device
- Fix patch file metadata

OBS-URL: https://build.opensuse.org/package/show/devel:kubic:ignition/ignition?expand=0&rev=110
This commit is contained in:
Ignaz Forster 2023-08-23 13:44:12 +00:00 committed by Git OBS Bridge
parent af996b5cb5
commit f1241dbb88
6 changed files with 66 additions and 21 deletions

View File

@ -1,5 +1,5 @@
Author: Ignaz Forster <iforster@suse.com>
Date: Thu, 9 Feb 2023 16:05:27 +0100
From: Ignaz Forster <iforster@suse.com>
Date: Thu, 9 Feb 2023 16:05:27 +0100
Upstream: Ticket opened [gh#coreos/ignition#1556]
Continue with empty config on missing QEMU device

View File

@ -1,5 +1,5 @@
Author: Ignaz Forster <iforster@suse.com>
Date: Wed Jan 14 17:57:52 2020 +0100
From: Ignaz Forster <iforster@suse.com>
Date: Wed Jan 14 17:57:52 2020 +0100
Upstream: Ticket opened [gh#coreos/ignition#890]
Implement poor man's solution for mounting a device multiple times,
@ -10,12 +10,14 @@ Index: ignition-2.15.0/config/v3_1/types/filesystem.go
===================================================================
--- ignition-2.15.0.orig/config/v3_1/types/filesystem.go
+++ ignition-2.15.0/config/v3_1/types/filesystem.go
@@ -23,7 +23,7 @@ import (
@@ -23,7 +23,10 @@ import (
)
func (f Filesystem) Key() string {
- return f.Device
+ return f.Device + *f.Path
+ if (f.Path != nil) {
+ f.Device += *f.Path
+ }
return f.Device
}
func (f Filesystem) IgnoreDuplicates() map[string]struct{} {
@ -23,12 +25,14 @@ Index: ignition-2.15.0/config/v3_2/types/filesystem.go
===================================================================
--- ignition-2.15.0.orig/config/v3_2/types/filesystem.go
+++ ignition-2.15.0/config/v3_2/types/filesystem.go
@@ -23,7 +23,7 @@ import (
@@ -23,7 +23,10 @@ import (
)
func (f Filesystem) Key() string {
- return f.Device
+ return f.Device + *f.Path
+ if (f.Path != nil) {
+ f.Device += *f.Path
+ }
return f.Device
}
func (f Filesystem) IgnoreDuplicates() map[string]struct{} {
@ -36,12 +40,14 @@ Index: ignition-2.15.0/config/v3_3/types/filesystem.go
===================================================================
--- ignition-2.15.0.orig/config/v3_3/types/filesystem.go
+++ ignition-2.15.0/config/v3_3/types/filesystem.go
@@ -23,7 +23,7 @@ import (
@@ -23,7 +23,10 @@ import (
)
func (f Filesystem) Key() string {
- return f.Device
+ return f.Device + *f.Path
+ if (f.Path != nil) {
+ f.Device += *f.Path
+ }
return f.Device
}
func (f Filesystem) IgnoreDuplicates() map[string]struct{} {
@ -49,12 +55,14 @@ Index: ignition-2.15.0/config/v3_4/types/filesystem.go
===================================================================
--- ignition-2.15.0.orig/config/v3_4/types/filesystem.go
+++ ignition-2.15.0/config/v3_4/types/filesystem.go
@@ -23,7 +23,7 @@ import (
@@ -23,7 +23,10 @@ import (
)
func (f Filesystem) Key() string {
- return f.Device
+ return f.Device + *f.Path
+ if (f.Path != nil) {
+ f.Device += *f.Path
+ }
return f.Device
}
func (f Filesystem) IgnoreDuplicates() map[string]struct{} {
@ -62,12 +70,14 @@ Index: ignition-2.15.0/config/v3_5_experimental/types/filesystem.go
===================================================================
--- ignition-2.15.0.orig/config/v3_5_experimental/types/filesystem.go
+++ ignition-2.15.0/config/v3_5_experimental/types/filesystem.go
@@ -23,7 +23,7 @@ import (
@@ -23,7 +23,10 @@ import (
)
func (f Filesystem) Key() string {
- return f.Device
+ return f.Device + *f.Path
+ if (f.Path != nil) {
+ f.Device += *f.Path
+ }
return f.Device
}
func (f Filesystem) IgnoreDuplicates() map[string]struct{} {

View File

@ -0,0 +1,23 @@
From: Ignaz Forster <iforster@suse.com>
Date: Tue, 22 Aug 2023 16:13:07 +0200
Subject: [PATCH] Move the GTP header on resized disks
---
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

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Wed Aug 23 13:33:29 UTC 2023 - Ignaz Forster <iforster@suse.com>
- Fix segmentation fault if filesystem section of Ignition JSON
doesn't contain path entry
- Add 0003-Move-the-GTP-header-on-resized-disks.patch to make it
possible to create partitions on resized disk images
- Add dm and crypt modules as dependencies to make it possible to
configure a luks device
- Fix patch file metadata
-------------------------------------------------------------------
Thu Jul 13 20:08:51 UTC 2023 - iforster@suse.com

View File

@ -43,6 +43,7 @@ Source20: ignition-userconfig-timeout.conf
Source21: ignition-userconfig-timeout-arm.conf
Patch1: 0001-ignore-missing-qemu-blockdev.patch
Patch2: 0002-allow-multiple-mounts-of-same-device.patch
Patch3: 0003-Move-the-GTP-header-on-resized-disks.patch
BuildRequires: dracut
BuildRequires: libblkid-devel
BuildRequires: systemd-rpm-macros

View File

@ -3,7 +3,7 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
depends() {
echo ignition
echo ignition dm crypt
}
install_ignition_unit() {
@ -33,7 +33,7 @@ install() {
"/usr/sbin/ignition-enable-network"
inst_script "$moddir/ignition-setup-user.sh" \
"/usr/sbin/ignition-setup-user"
inst_multiple awk systemd-detect-virt
inst_multiple awk systemd-detect-virt cryptsetup
install_ignition_unit ignition-remove-reconfig_system.service initrd.target
install_ignition_unit ignition-setup-user.service
}