From 0b9260ade57d271b6846c6b3f434eec594594308 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Tue, 10 Jan 2023 13:32:59 -0500 Subject: 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 --- ...orkaround-field-rename-in-btrfs-progs-6.1.patch | 38 ++++++++++++++++++++++ recipes-containers/buildah/buildah_git.bb | 10 +++++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 recipes-containers/buildah/buildah/0001-fix-workaround-field-rename-in-btrfs-progs-6.1.patch (limited to 'recipes-containers/buildah') 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 @@ +From 246ba3062e8b551026aef2708eee747014ce5c52 Mon Sep 17 00:00:00 2001 +From: Rui Chen +Date: Wed, 28 Dec 2022 18:26:39 -0500 +Subject: [PATCH] fix: workaround field rename in btrfs-progs 6.1 + +same as kdave/btrfs-progs@0345143 + +Signed-off-by: Rui Chen +--- + drivers/btrfs/btrfs.go | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/btrfs/btrfs.go b/drivers/btrfs/btrfs.go +index e8b16b858..3d9053297 100644 +--- a/drivers/btrfs/btrfs.go ++++ b/drivers/btrfs/btrfs.go +@@ -6,6 +6,9 @@ package btrfs + /* + #include + #include ++ ++// keep struct field name compatible with btrfs-progs < 6.1. ++#define max_referenced max_rfer + #include + #include + +@@ -382,7 +385,7 @@ func subvolLimitQgroup(path string, size uint64) error { + defer closeDir(dir) + + var args C.struct_btrfs_ioctl_qgroup_limit_args +- args.lim.max_referenced = C.__u64(size) ++ args.lim.max_rfer = C.__u64(size) + args.lim.flags = C.BTRFS_QGROUP_LIMIT_MAX_RFER + _, _, errno := unix.Syscall(unix.SYS_IOCTL, getDirFd(dir), C.BTRFS_IOC_QGROUP_LIMIT, + uintptr(unsafe.Pointer(&args))) +-- +2.34.1 + 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 S = "${WORKDIR}/git" BUILDAH_VERSION = "1.28" -SRCREV_buildah = "cfefbb64ea1fe3639c231f73e7b09bfe300744ac" PV = "${BUILDAH_VERSION}" @@ -22,9 +21,18 @@ GO_INSTALL = "${GO_IMPORT}" GO_WORKDIR = "${GO_INSTALL}" GOBUILDFLAGS += "-mod vendor" +SRCREV_FORMAT = "buildah_storage" +SRCREV_buildah = "cfefbb64ea1fe3639c231f73e7b09bfe300744ac" +SRCREV_storage = "246ba3062e8b551026aef2708eee747014ce5c52" + SRC_URI = " \ git://github.com/containers/buildah;branch=release-${BUILDAH_VERSION};name=buildah;protocol=https \ " +# Due to some other API changes, we can't directly import containers/storage at +# the right commit, so we instead extract a patch and apply it to the tree +# 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" +SRC_URI += "file://0001-fix-workaround-field-rename-in-btrfs-progs-6.1.patch;patchdir=src/github.com/containers/buildah/vendor/github.com/containers/storage" + DEPENDS = "libdevmapper btrfs-tools gpgme" RDEPENDS:${PN} = "cgroup-lite fuse-overlayfs libdevmapper podman" -- cgit v1.2.3-54-g00ecf