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