diff options
3 files changed, 108 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/snapper/snapper/0001-Include-linux-types.h-for-__u16-__u32-__u64-type.patch b/meta-oe/recipes-support/snapper/snapper/0001-Include-linux-types.h-for-__u16-__u32-__u64-type.patch new file mode 100644 index 0000000000..ec8594629e --- /dev/null +++ b/meta-oe/recipes-support/snapper/snapper/0001-Include-linux-types.h-for-__u16-__u32-__u64-type.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | From d103eaeae169708ca567f092182a89b79e5ab9db Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 20 Oct 2024 07:52:33 -0700 | ||
4 | Subject: [PATCH 1/2] Include linux/types.h for __u16/__u32/__u64 type | ||
5 | |||
6 | This header is included indirectly with glibc but when using musl | ||
7 | it ends up with compilation failure | ||
8 | |||
9 | BcachefsUtils.cc:85:20: error: use of undeclared identifier '__u32' | ||
10 | 85 | args.dirfd = (__u32) fddst; | ||
11 | | ^ | ||
12 | |||
13 | Upstream-Status: Submitted [https://github.com/openSUSE/snapper/pull/945] | ||
14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
15 | --- | ||
16 | snapper/BcachefsUtils.cc | 1 + | ||
17 | 1 file changed, 1 insertion(+) | ||
18 | |||
19 | diff --git a/snapper/BcachefsUtils.cc b/snapper/BcachefsUtils.cc | ||
20 | index e9163ffb..1d328a78 100644 | ||
21 | --- a/snapper/BcachefsUtils.cc | ||
22 | +++ b/snapper/BcachefsUtils.cc | ||
23 | @@ -24,6 +24,7 @@ | ||
24 | |||
25 | #include <cstring> | ||
26 | #include <cerrno> | ||
27 | +#include <linux/types.h> | ||
28 | #include <sys/stat.h> | ||
29 | #include <sys/ioctl.h> | ||
30 | |||
diff --git a/meta-oe/recipes-support/snapper/snapper/0002-Use-statvfs-instead-of-statvfs64.patch b/meta-oe/recipes-support/snapper/snapper/0002-Use-statvfs-instead-of-statvfs64.patch new file mode 100644 index 0000000000..b915fda257 --- /dev/null +++ b/meta-oe/recipes-support/snapper/snapper/0002-Use-statvfs-instead-of-statvfs64.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From 0b39f4484553c796cb300fb4933ea314e91d913b Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 20 Oct 2024 07:55:23 -0700 | ||
4 | Subject: [PATCH 2/2] Use statvfs instead of statvfs64 | ||
5 | |||
6 | when using LFS64 these functions are same and also | ||
7 | on 64bit systems they are same. musl is using 64bit off_t | ||
8 | by default and does not define LFS64 variants of these functions | ||
9 | and it ends up in build errors | ||
10 | |||
11 | Taken from Alpine Linux: [https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/testing/snapper/statvfs64.patch] | ||
12 | |||
13 | Upstream-Status: Submitted [https://github.com/openSUSE/snapper/pull/945] | ||
14 | |||
15 | Signed-off-by: Markus Volk <f_l_k@t-online.de> | ||
16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
17 | --- | ||
18 | snapper/FileUtils.cc | 6 +++--- | ||
19 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
20 | |||
21 | diff --git a/snapper/FileUtils.cc b/snapper/FileUtils.cc | ||
22 | index d4034279..4c8578a1 100644 | ||
23 | --- a/snapper/FileUtils.cc | ||
24 | +++ b/snapper/FileUtils.cc | ||
25 | @@ -387,9 +387,9 @@ namespace snapper | ||
26 | std::pair<unsigned long long, unsigned long long> | ||
27 | SDir::statvfs() const | ||
28 | { | ||
29 | - struct statvfs64 fsbuf; | ||
30 | - if (fstatvfs64(dirfd, &fsbuf) != 0) | ||
31 | - SN_THROW(IOErrorException(sformat("statvfs64 failed path:%s errno:%d (%s)", base_path.c_str(), | ||
32 | + struct statvfs fsbuf; | ||
33 | + if (fstatvfs(dirfd, &fsbuf) != 0) | ||
34 | + SN_THROW(IOErrorException(sformat("statvfs failed path:%s errno:%d (%s)", base_path.c_str(), | ||
35 | errno, stringerror(errno).c_str()))); | ||
36 | |||
37 | // f_bavail is used (not f_bfree) since df seems to do the | ||
diff --git a/meta-oe/recipes-support/snapper/snapper_0.11.2.bb b/meta-oe/recipes-support/snapper/snapper_0.11.2.bb new file mode 100644 index 0000000000..840c607309 --- /dev/null +++ b/meta-oe/recipes-support/snapper/snapper_0.11.2.bb | |||
@@ -0,0 +1,41 @@ | |||
1 | SUMMARY = "Snapper is a tool for Linux file system snapshot management" | ||
2 | HOMEPAGE = "https://github.com/openSUSE/snapper" | ||
3 | LICENSE = "GPL-2.0-only" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" | ||
5 | |||
6 | DEPENDS = "acl boost btrfs-tools dbus e2fsprogs json-c libxml2 lvm2 ncurses zlib" | ||
7 | |||
8 | # Build separation is slightly broken | ||
9 | inherit autotools-brokensep pkgconfig gettext | ||
10 | |||
11 | SRC_URI = " \ | ||
12 | git://github.com/openSUSE/snapper.git;protocol=https;branch=master \ | ||
13 | file://0001-Include-linux-types.h-for-__u16-__u32-__u64-type.patch \ | ||
14 | file://0002-Use-statvfs-instead-of-statvfs64.patch \ | ||
15 | " | ||
16 | SRCREV = "6c603565f36e9996d85045c8012cd04aba5f3708" | ||
17 | |||
18 | S = "${WORKDIR}/git" | ||
19 | |||
20 | EXTRA_OECONF += "--disable-zypp" | ||
21 | |||
22 | PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'api-documentation systemd pam', d)}" | ||
23 | PACKAGECONFIG[pam] = "--enable-pam,--disable-pam,libpam" | ||
24 | PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd" | ||
25 | PACKAGECONFIG[api-documentation] = "--enable-doc,--disable-doc,libxslt-native docbook-xsl-stylesheets-native" | ||
26 | |||
27 | # Avoid HOSTTOOLS path in binaries | ||
28 | export DIFFBIN = "${bindir}/diff" | ||
29 | export RMBIN = "${bindir}/rm" | ||
30 | export TOUCHBIN = "${bindir}/touch" | ||
31 | export CPBIN = "${bindir}/cp" | ||
32 | |||
33 | |||
34 | do_install:append() { | ||
35 | install -d ${D}${sysconfdir}/sysconfig | ||
36 | install -m0644 ${S}/data/default-config ${D}${sysconfdir}/sysconfig/snapper | ||
37 | } | ||
38 | |||
39 | FILES:${PN} += "${libdir}/pam_snapper ${libdir}/systemd ${libdir}/security ${datadir}" | ||
40 | # bash is needed for the testsuite | ||
41 | RDEPENDS:${PN} = "bash diffutils util-linux util-linux-mount" | ||