summaryrefslogtreecommitdiffstats
path: root/meta-filesystems/recipes-utils/overlayfs
diff options
context:
space:
mode:
Diffstat (limited to 'meta-filesystems/recipes-utils/overlayfs')
-rw-r--r--meta-filesystems/recipes-utils/overlayfs/overlayfs-tools/0001-always-use-glibc-basename.patch38
-rw-r--r--meta-filesystems/recipes-utils/overlayfs/overlayfs-tools/0002-Change-program_name-to-have-const-attribute.patch56
-rw-r--r--meta-filesystems/recipes-utils/overlayfs/overlayfs-tools_git.bb28
-rw-r--r--meta-filesystems/recipes-utils/overlayfs/overlayfs-tools_v2024.07.bb17
4 files changed, 111 insertions, 28 deletions
diff --git a/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools/0001-always-use-glibc-basename.patch b/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools/0001-always-use-glibc-basename.patch
new file mode 100644
index 0000000000..78802e39ab
--- /dev/null
+++ b/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools/0001-always-use-glibc-basename.patch
@@ -0,0 +1,38 @@
1From 2fa94fc7adf05fae46204f4665216c8b019010f3 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 5 Jul 2024 23:16:38 -0700
4Subject: [PATCH 1/2] always use glibc basename()
5
6There is a use of basename() which expects it to be GNU version of
7basename, which is not available in other libcs e.g. musl on Linux
8therefore provide a version for such cases
9
10Upstream-Status: Submitted [https://github.com/kmxz/overlayfs-tools/pull/26]
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 main.c | 12 ++++++++++++
14 1 file changed, 12 insertions(+)
15
16diff --git a/main.c b/main.c
17index 7b669eb..ea0f5a5 100644
18--- a/main.c
19+++ b/main.c
20@@ -30,6 +30,18 @@ bool brief;
21 bool ignore;
22 extern char *program_name;
23
24+#ifndef __GLIBC__
25+/*
26+ * GNU basename implementation
27+ */
28+static const char *__basename(const char *filename) {
29+ char *p = strrchr(filename, '/');
30+ return p ? p + 1 : filename;
31+}
32+
33+#define basename(x) __basename(x)
34+#endif
35+
36 void print_help(const char *program) {
37 printf("Usage: %s command options\n", program);
38 puts("");
diff --git a/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools/0002-Change-program_name-to-have-const-attribute.patch b/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools/0002-Change-program_name-to-have-const-attribute.patch
new file mode 100644
index 0000000000..845306292e
--- /dev/null
+++ b/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools/0002-Change-program_name-to-have-const-attribute.patch
@@ -0,0 +1,56 @@
1From be694ba90aa2e0fed3a4e9b53ad7a61efd0430c5 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 5 Jul 2024 23:18:07 -0700
4Subject: [PATCH 2/2] Change program_name to have const attribute
5
6This is how it is used in all places and it also avoids a const to
7non-const conversion warning
8
9Upstream-Status: Submitted [https://github.com/kmxz/overlayfs-tools/pull/26]
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 common.c | 2 +-
14 fsck.c | 2 +-
15 main.c | 2 +-
16 3 files changed, 3 insertions(+), 3 deletions(-)
17
18diff --git a/common.c b/common.c
19index eaf24a8..a15b66f 100644
20--- a/common.c
21+++ b/common.c
22@@ -29,7 +29,7 @@
23 #include "common.h"
24 #include "config.h"
25
26-char *program_name;
27+const char *program_name;
28
29 /* #define DEBUG 1 */
30 #ifdef DEBUG
31diff --git a/fsck.c b/fsck.c
32index 4e513f5..285b9f1 100644
33--- a/fsck.c
34+++ b/fsck.c
35@@ -46,7 +46,7 @@
36 #include "mount.h"
37 #include "overlayfs.h"
38
39-extern char *program_name;
40+extern const char *program_name;
41
42 struct ovl_fs ofs = {};
43 int flags = 0; /* user input option flags */
44diff --git a/main.c b/main.c
45index ea0f5a5..1a8b239 100644
46--- a/main.c
47+++ b/main.c
48@@ -28,7 +28,7 @@
49 bool verbose;
50 bool brief;
51 bool ignore;
52-extern char *program_name;
53+extern const char *program_name;
54
55 #ifndef __GLIBC__
56 /*
diff --git a/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools_git.bb b/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools_git.bb
deleted file mode 100644
index 47613207af..0000000000
--- a/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools_git.bb
+++ /dev/null
@@ -1,28 +0,0 @@
1DESCRIPTION = "Maintenance tools for OverlayFS"
2HOMEPAGE = "https://github.com/kmxz/overlayfs-tools"
3LICENSE = "WTFPL"
4LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=f312a7c4d02230e8f2b537295d375c69"
5
6SRC_URI = "\
7 git://github.com/kmxz/overlayfs-tools.git;protocol=https;branch=master \
8"
9
10PV = "1.0+git"
11SRCREV = "b5e5a829895ac98ccfe4629fbfbd8b819262bd00"
12
13S = "${WORKDIR}/git"
14B = "${S}"
15
16# Required to have the fts.h header for musl
17DEPENDS:append:libc-musl = " fts"
18
19EXTRA_OEMAKE += "'CC=${CC} -O2'"
20# Fix the missing fts libs when using musl
21EXTRA_OEMAKE:append:libc-musl = " LDLIBS=-lfts"
22TARGET_CC_ARCH += "${LDFLAGS}"
23
24do_install () {
25 install -d ${D}${bindir}
26 install -m 0755 ${B}/overlay ${D}${bindir}
27 install -m 0755 ${B}/fsck.overlay ${D}${bindir}
28}
diff --git a/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools_v2024.07.bb b/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools_v2024.07.bb
new file mode 100644
index 0000000000..708bbfcf02
--- /dev/null
+++ b/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools_v2024.07.bb
@@ -0,0 +1,17 @@
1DESCRIPTION = "Maintenance tools for OverlayFS"
2HOMEPAGE = "https://github.com/kmxz/overlayfs-tools"
3LICENSE = "WTFPL"
4LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=f312a7c4d02230e8f2b537295d375c69"
5
6SRC_URI = "\
7 git://github.com/kmxz/overlayfs-tools.git;protocol=https;branch=master \
8 file://0001-always-use-glibc-basename.patch \
9 file://0002-Change-program_name-to-have-const-attribute.patch \
10"
11
12SRCREV = "7a4a0c4f2c6c86aa46a40e3468e394fd4a237491"
13
14
15inherit meson pkgconfig
16
17DEPENDS:append:libc-musl = " fts"