From 67e8b34d99f70a553b93d09498772ac633661ccf Mon Sep 17 00:00:00 2001 From: Jose Quaresma Date: Tue, 10 Jan 2023 15:14:32 +0000 Subject: skopeo: fix build with btrfs-progs 6.1 | # github.com/containers/storage/drivers/btrfs | vendor/github.com/containers/storage/drivers/btrfs/btrfs.go:387:11: args.lim.max_referenced undefined (type _Ctype_struct_btrfs_qgroup_limit has no field or method max_referenced) | recipe skopeo-v1.8.0+gitAUTOINC+b95e081162-r0: task do_compile: Failed Signed-off-by: Jose Quaresma Signed-off-by: Bruce Ashfield --- ...orkaround_field_rename_in_btrfs-progs_6_1.patch | 38 ++++++++++++++++++++++ recipes-containers/skopeo/skopeo_git.bb | 1 + 2 files changed, 39 insertions(+) create mode 100644 recipes-containers/skopeo/files/0002-fix_workaround_field_rename_in_btrfs-progs_6_1.patch diff --git a/recipes-containers/skopeo/files/0002-fix_workaround_field_rename_in_btrfs-progs_6_1.patch b/recipes-containers/skopeo/files/0002-fix_workaround_field_rename_in_btrfs-progs_6_1.patch new file mode 100644 index 00000000..cd3c70f4 --- /dev/null +++ b/recipes-containers/skopeo/files/0002-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 + +Upstream-Status: Backport [https://github.com/containers/storage/commit/246ba3062e8b551026aef2708eee747014ce5c52] +Signed-off-by: Jose Quaresma +--- + 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 e8b16b858e..3d9053297b 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))) diff --git a/recipes-containers/skopeo/skopeo_git.bb b/recipes-containers/skopeo/skopeo_git.bb index 88206f3f..1dfce24b 100644 --- a/recipes-containers/skopeo/skopeo_git.bb +++ b/recipes-containers/skopeo/skopeo_git.bb @@ -24,6 +24,7 @@ SRC_URI = " \ file://storage.conf \ file://registries.conf \ file://0001-makefile-add-GOBUILDFLAGS-to-go-build-call.patch \ + file://0002-fix_workaround_field_rename_in_btrfs-progs_6_1.patch;patchdir=src/import/vendor/github.com/containers/storage \ " SRCREV = "4517ea0b7be6a6743d854e05cd24f7354a487b60" -- cgit v1.2.3-54-g00ecf