From 2c2228fd79423247230b50c0afa95ed93f6c7959 Mon Sep 17 00:00:00 2001 From: Nikita Dubrovskii Date: Fri, 15 Nov 2024 11:40:20 +0100 Subject: [PATCH] build: drop org.odbuild.mkdir patchfile osbuild-133.rpm was released and includes required patch: - org.osbuild.mkdir: support creating dirs on mounts (https://github.com/osbuild/osbuild/pull/1904) --- build.sh | 4 +- ...kdir-support-creating-dirs-on-mounts.patch | 109 ------------------ 2 files changed, 1 insertion(+), 112 deletions(-) delete mode 100644 src/0001-org.osbuild.mkdir-support-creating-dirs-on-mounts.patch diff --git a/build.sh b/build.sh index 65b3f0dc49..9ec701a0b9 100755 --- a/build.sh +++ b/build.sh @@ -173,9 +173,7 @@ patch_osbuild() { mv /usr/bin/osbuild-mpp /usr/lib/osbuild/tools/ # Now all the software is under the /usr/lib/osbuild dir and we can patch - cat /usr/lib/coreos-assembler/0001-hacks-for-coreos-selinux-issues.patch \ - /usr/lib/coreos-assembler/0001-org.osbuild.mkdir-support-creating-dirs-on-mounts.patch \ - | patch -d /usr/lib/osbuild -p1 + patch -d /usr/lib/osbuild -p1 < /usr/lib/coreos-assembler/0001-hacks-for-coreos-selinux-issues.patch # And then move the files back; supermin appliance creation will need it back # in the places delivered by the RPM. diff --git a/src/0001-org.osbuild.mkdir-support-creating-dirs-on-mounts.patch b/src/0001-org.osbuild.mkdir-support-creating-dirs-on-mounts.patch deleted file mode 100644 index eb915e259b..0000000000 --- a/src/0001-org.osbuild.mkdir-support-creating-dirs-on-mounts.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 362a1ea2485ea2c49e6c250a0446bd5a33b2062c Mon Sep 17 00:00:00 2001 -From: Nikita Dubrovskii -Date: Mon, 30 Sep 2024 15:46:31 +0200 -Subject: [PATCH] org.osbuild.mkdir: support creating dirs on mounts - -This allows creating new directories on mounts: -``` -- type: org.osbuild.mkdir - options: - paths: - - path: mount:///boot/efi - devices: - disk: ... - mounts: - - name: boot - target: /boot - ... -``` ---- - stages/org.osbuild.mkdir | 22 ++++++++++++---------- - stages/org.osbuild.mkdir.meta.json | 21 ++++++++++++++++++--- - 2 files changed, 30 insertions(+), 13 deletions(-) - -diff --git a/stages/org.osbuild.mkdir b/stages/org.osbuild.mkdir -index f04549f6..d2d11a7a 100755 ---- a/stages/org.osbuild.mkdir -+++ b/stages/org.osbuild.mkdir -@@ -3,23 +3,26 @@ import os - import sys - - import osbuild.api --from osbuild.util.path import in_tree -+from osbuild.util import parsing - - --def main(tree, options): -+def main(args): -+ options = args["options"] -+ - for item in options["paths"]: - path = item["path"] - mode = item.get("mode", 0o777) - parents = item.get("parents", False) - exist_ok = item.get("exist_ok", False) - -- if not path.startswith("/"): -- print("WARNING: relative path used, this is discouraged!") -- -- target = os.path.join(tree, path.lstrip("/")) -- if not in_tree(target, tree): -- raise ValueError(f"path {path} not in tree") -+ if "://" not in path: -+ if not path.startswith("/"): -+ print("WARNING: relative path used, this is discouraged!") -+ path = f"tree:///{path}" -+ else: -+ path = f"tree://{path}" - -+ target = parsing.parse_location(path, args) - if parents: - os.makedirs(target, mode=mode, exist_ok=exist_ok) - else: -@@ -33,5 +36,4 @@ def main(tree, options): - - - if __name__ == "__main__": -- args = osbuild.api.arguments() -- sys.exit(main(args["tree"], args["options"])) -+ sys.exit(main(osbuild.api.arguments())) -diff --git a/stages/org.osbuild.mkdir.meta.json b/stages/org.osbuild.mkdir.meta.json -index 5534120a..6cebaaf5 100644 ---- a/stages/org.osbuild.mkdir.meta.json -+++ b/stages/org.osbuild.mkdir.meta.json -@@ -1,5 +1,5 @@ - { -- "summary": "Create directories within the tree.", -+ "summary": "Create directories within the tree or mount.", - "description": [ - "Can create one or more directories, optionally also the", - "intermediate directories. The stage can gracefully handle", -@@ -31,8 +31,23 @@ - ], - "properties": { - "path": { -- "type": "string", -- "pattern": "^\\/?(?!\\.\\.)((?!\\/\\.\\.\\/).)+$" -+ "anyOf": [ -+ { -+ "type": "string", -+ "description": "Target path, if a tree", -+ "pattern": "^\\/?(?!\\.\\.)((?!\\/\\.\\.\\/).)+$" -+ }, -+ { -+ "type": "string", -+ "description": "Target path, if a mount", -+ "pattern": "^mount://.+" -+ }, -+ { -+ "type": "string", -+ "description": "Target path, if a tree", -+ "pattern": "^tree://.+" -+ } -+ ] - }, - "mode": { - "type": "number", --- -2.47.0 -