summaryrefslogtreecommitdiffstats
path: root/recipes-containers/buildah
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2023-01-10 13:32:59 -0500
committerBruce Ashfield <bruce.ashfield@gmail.com>2023-01-10 13:58:07 -0500
commit0b9260ade57d271b6846c6b3f434eec594594308 (patch)
treee642b85491f8baa4291f44b2d3b6edc2e0a887d4 /recipes-containers/buildah
parent67e8b34d99f70a553b93d09498772ac633661ccf (diff)
downloadmeta-virtualization-0b9260ade57d271b6846c6b3f434eec594594308.tar.gz
buildah: fix build with btrfs-tools 6.1
We'd really prefer to bump the vendor SRCREV and allow the fetcher to bring in the pending change without needing a patch, but there are other API changes that trickle through the code. So we extract just the patch we need, and leave the SRCREV info in the recipe, to document the source. When the upstream updates its vendor/ directory, we can drop this (as the patch will no longer apply) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/buildah')
-rw-r--r--recipes-containers/buildah/buildah/0001-fix-workaround-field-rename-in-btrfs-progs-6.1.patch38
-rw-r--r--recipes-containers/buildah/buildah_git.bb10
2 files changed, 47 insertions, 1 deletions
diff --git a/recipes-containers/buildah/buildah/0001-fix-workaround-field-rename-in-btrfs-progs-6.1.patch b/recipes-containers/buildah/buildah/0001-fix-workaround-field-rename-in-btrfs-progs-6.1.patch
new file mode 100644
index 00000000..2d64a8bc
--- /dev/null
+++ b/recipes-containers/buildah/buildah/0001-fix-workaround-field-rename-in-btrfs-progs-6.1.patch
@@ -0,0 +1,38 @@
1From 246ba3062e8b551026aef2708eee747014ce5c52 Mon Sep 17 00:00:00 2001
2From: Rui Chen <rui@chenrui.dev>
3Date: Wed, 28 Dec 2022 18:26:39 -0500
4Subject: [PATCH] fix: workaround field rename in btrfs-progs 6.1
5
6same as kdave/btrfs-progs@0345143
7
8Signed-off-by: Rui Chen <rui@chenrui.dev>
9---
10 drivers/btrfs/btrfs.go | 5 ++++-
11 1 file changed, 4 insertions(+), 1 deletion(-)
12
13diff --git a/drivers/btrfs/btrfs.go b/drivers/btrfs/btrfs.go
14index e8b16b858..3d9053297 100644
15--- a/drivers/btrfs/btrfs.go
16+++ b/drivers/btrfs/btrfs.go
17@@ -6,6 +6,9 @@ package btrfs
18 /*
19 #include <stdlib.h>
20 #include <dirent.h>
21+
22+// keep struct field name compatible with btrfs-progs < 6.1.
23+#define max_referenced max_rfer
24 #include <btrfs/ioctl.h>
25 #include <btrfs/ctree.h>
26
27@@ -382,7 +385,7 @@ func subvolLimitQgroup(path string, size uint64) error {
28 defer closeDir(dir)
29
30 var args C.struct_btrfs_ioctl_qgroup_limit_args
31- args.lim.max_referenced = C.__u64(size)
32+ args.lim.max_rfer = C.__u64(size)
33 args.lim.flags = C.BTRFS_QGROUP_LIMIT_MAX_RFER
34 _, _, errno := unix.Syscall(unix.SYS_IOCTL, getDirFd(dir), C.BTRFS_IOC_QGROUP_LIMIT,
35 uintptr(unsafe.Pointer(&args)))
36--
372.34.1
38
diff --git a/recipes-containers/buildah/buildah_git.bb b/recipes-containers/buildah/buildah_git.bb
index e7803450..18985c94 100644
--- a/recipes-containers/buildah/buildah_git.bb
+++ b/recipes-containers/buildah/buildah_git.bb
@@ -9,7 +9,6 @@ LIC_FILES_CHKSUM = "file://src/github.com/containers/buildah/LICENSE;md5=e3fc50a
9S = "${WORKDIR}/git" 9S = "${WORKDIR}/git"
10 10
11BUILDAH_VERSION = "1.28" 11BUILDAH_VERSION = "1.28"
12SRCREV_buildah = "cfefbb64ea1fe3639c231f73e7b09bfe300744ac"
13 12
14PV = "${BUILDAH_VERSION}" 13PV = "${BUILDAH_VERSION}"
15 14
@@ -22,9 +21,18 @@ GO_INSTALL = "${GO_IMPORT}"
22GO_WORKDIR = "${GO_INSTALL}" 21GO_WORKDIR = "${GO_INSTALL}"
23GOBUILDFLAGS += "-mod vendor" 22GOBUILDFLAGS += "-mod vendor"
24 23
24SRCREV_FORMAT = "buildah_storage"
25SRCREV_buildah = "cfefbb64ea1fe3639c231f73e7b09bfe300744ac"
26SRCREV_storage = "246ba3062e8b551026aef2708eee747014ce5c52"
27
25SRC_URI = " \ 28SRC_URI = " \
26 git://github.com/containers/buildah;branch=release-${BUILDAH_VERSION};name=buildah;protocol=https \ 29 git://github.com/containers/buildah;branch=release-${BUILDAH_VERSION};name=buildah;protocol=https \
27 " 30 "
31# Due to some other API changes, we can't directly import containers/storage at
32# the right commit, so we instead extract a patch and apply it to the tree
33# SRC_URI += "git://github.com/containers/storage;protocol=https;name=storage;branch=main;destsuffix=git/src/github.com/containers/buildah/vendor/github.com/containers/storage"
34SRC_URI += "file://0001-fix-workaround-field-rename-in-btrfs-progs-6.1.patch;patchdir=src/github.com/containers/buildah/vendor/github.com/containers/storage"
35
28 36
29DEPENDS = "libdevmapper btrfs-tools gpgme" 37DEPENDS = "libdevmapper btrfs-tools gpgme"
30RDEPENDS:${PN} = "cgroup-lite fuse-overlayfs libdevmapper podman" 38RDEPENDS:${PN} = "cgroup-lite fuse-overlayfs libdevmapper podman"