Skip to content

Commit

Permalink
osbuild: update patchset for OSBuild v136 release
Browse files Browse the repository at this point in the history
OSbuild v136 was released and landed in F41. That release
included the commit for one of the patches we are carrying [1]
so we can drop 0004-util-chroot-Add-support-for-custom-directory-bind-mo.patch

Two of the other patches we are carrying were merged upstream
[2] [3], so we'll update the patches here to their final versions.

[1] osbuild/osbuild#1917
[2] osbuild/osbuild#1927
[3] osbuild/osbuild#1944
  • Loading branch information
dustymabe committed Dec 14, 2024
1 parent 17c1cc8 commit d3ced67
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 131 deletions.
4 changes: 1 addition & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,7 @@ patch_osbuild() {

# Now all the software is under the /usr/lib/osbuild dir and we can patch
cat /usr/lib/coreos-assembler/0001-osbuild-remoteloop-add-more-loop-device-options.patch \
/usr/lib/coreos-assembler/0002-osbuild-loop-make-the-loop-device-if-missing.patch \
/usr/lib/coreos-assembler/0003-util-osrelease.py-improve-whitespace-and-quote-strip.patch \
/usr/lib/coreos-assembler/0004-util-chroot-Add-support-for-custom-directory-bind-mo.patch \
/usr/lib/coreos-assembler/0001-util-osrelease.py-Replaced-string-stripping-with-shl.patch \
/usr/lib/coreos-assembler/0005-stages-add-coreos.live-artifacts.mono-stage.patch \
| patch -d /usr/lib/osbuild -p1

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 9edf8572ad4797033e7342c308ac617aa284f3ae Mon Sep 17 00:00:00 2001
From f4b899873b1f108edbf12d81ee5dbed037238a7e Mon Sep 17 00:00:00 2001
From: Dusty Mabe <[email protected]>
Date: Fri, 22 Nov 2024 19:02:57 -0500
Subject: [PATCH 1/5] osbuild/remoteloop: add more loop device options
Subject: [PATCH] osbuild/remoteloop: add more loop device options

This adds lock, partscan, read_only, sector_size to _create_device()
similar to make_loop() from devices/org.osbuild.loopback.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From 07d4f6955dd5dd5535b3e2f8e4722eb20f95e613 Mon Sep 17 00:00:00 2001
From: Renata Ravanelli <[email protected]>
Date: Tue, 12 Nov 2024 15:12:52 -0300
Subject: [PATCH] util/osrelease.py: Replaced string stripping with
`shlex.split()`

- Replaced string stripping with `shlex.split()` to properly
handle values in the os-release file;
- This ensures cleaner and more accurate key-value assignments,
follwing a broader set of shell-like parsing rules;
- Add os-release file for Fedora CoreOS 40 for testing.

Signed-off-by: Renata Ravanelli <[email protected]>
---
osbuild/util/osrelease.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/osbuild/util/osrelease.py b/osbuild/util/osrelease.py
index b8d56e73..cc97faf5 100644
--- a/osbuild/util/osrelease.py
+++ b/osbuild/util/osrelease.py
@@ -5,6 +5,7 @@ related documentation can be found in `os-release(5)`.
"""

import os
+import shlex

# The default paths where os-release is located, as per os-release(5)
DEFAULT_PATHS = [
@@ -33,7 +34,10 @@ def parse_files(*paths):
if line[0] == "#":
continue
key, value = line.split("=", 1)
- osrelease[key] = value.strip('"')
+ split_value = shlex.split(value)
+ if not split_value or len(split_value) > 1:
+ raise ValueError(f"Key '{key}' has an empty value or more than one token: {value}")
+ osrelease[key] = split_value[0]

return osrelease

--
2.47.0

34 changes: 0 additions & 34 deletions src/0002-osbuild-loop-make-the-loop-device-if-missing.patch

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit d3ced67

Please sign in to comment.