diff options
| -rw-r--r-- | meta-filesystems/recipes-support/composefs/composefs_1.0.3.bb | 23 | ||||
| -rw-r--r-- | meta-filesystems/recipes-support/composefs/files/0001-musl-basename-use-portable-implementation-for-basena.patch | 75 |
2 files changed, 98 insertions, 0 deletions
diff --git a/meta-filesystems/recipes-support/composefs/composefs_1.0.3.bb b/meta-filesystems/recipes-support/composefs/composefs_1.0.3.bb new file mode 100644 index 0000000000..7607b0a12c --- /dev/null +++ b/meta-filesystems/recipes-support/composefs/composefs_1.0.3.bb | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | SUMMARY = "Tools to handle creating and mounting composefs images" | ||
| 2 | HOMEPAGE = "https://github.com/containers/composefs" | ||
| 3 | LICENSE = "GPL-3.0-or-later & LGPL-2.0-or-later & Apache-2.0" | ||
| 4 | LIC_FILES_CHKSUM = "\ | ||
| 5 | file://BSD-2-Clause.txt;md5=121c8a0a8fa5961a26b7863034ebcce8 \ | ||
| 6 | file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ | ||
| 7 | file://COPYING.LESSERv3;md5=6a6a8e020838b23406c81b19c1d46df6 \ | ||
| 8 | file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c \ | ||
| 9 | file://COPYINGv3;md5=d32239bcb673463ab874e80d47fae504 \ | ||
| 10 | file://LICENSE.Apache-2.0;md5=3b83ef96387f14655fc854ddc3c6bd57 \ | ||
| 11 | " | ||
| 12 | DEPENDS = "fuse3 openssl" | ||
| 13 | SRCREV = "2d5cdcb9176cfe4ccf1761ef6d78e1c48de35649" | ||
| 14 | PV = "1.0.3" | ||
| 15 | |||
| 16 | SRC_URI = "\ | ||
| 17 | git://github.com/containers/composefs.git;protocol=https;branch=main \ | ||
| 18 | file://0001-musl-basename-use-portable-implementation-for-basena.patch \ | ||
| 19 | " | ||
| 20 | |||
| 21 | S = "${WORKDIR}/git" | ||
| 22 | |||
| 23 | inherit autotools pkgconfig | ||
diff --git a/meta-filesystems/recipes-support/composefs/files/0001-musl-basename-use-portable-implementation-for-basena.patch b/meta-filesystems/recipes-support/composefs/files/0001-musl-basename-use-portable-implementation-for-basena.patch new file mode 100644 index 0000000000..49a0b21c6e --- /dev/null +++ b/meta-filesystems/recipes-support/composefs/files/0001-musl-basename-use-portable-implementation-for-basena.patch | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | From b21a9d4f10a066cac76bb345d31fdd24afcf3e6f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Fathi Boudra <fathi.boudra@linaro.org> | ||
| 3 | Date: Tue, 9 Apr 2024 08:47:37 +0200 | ||
| 4 | Subject: [PATCH] musl: basename: use portable implementation for basename API | ||
| 5 | |||
| 6 | musl has removed the non-prototype declaration of basename from string.h which | ||
| 7 | now results in build errors with newer clang compilers. | ||
| 8 | |||
| 9 | Implement GNU basename behavior using strchr which is portable across libcs. | ||
| 10 | |||
| 11 | Fixes: | ||
| 12 | | ../../git/tools/mountcomposefs.c:43:20: | ||
| 13 | | error: call to undeclared function 'basename'; ISO C99 and later do not | ||
| 14 | | support implicit function declarations [-Wimplicit-function-declaration] | ||
| 15 | | 43 | const char *bin = basename(argv0); | ||
| 16 | | | ^ | ||
| 17 | | ../../git/tools/mountcomposefs.c:43:14: | ||
| 18 | | error: incompatible integer to pointer conversion initializing 'const char *' | ||
| 19 | | with an expression of type 'int' [-Wint-conversion] | ||
| 20 | | 43 | const char *bin = basename(argv0); | ||
| 21 | | | ^ ~~~~~~~~~~~~~~~ | ||
| 22 | |||
| 23 | For reference: | ||
| 24 | https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 | ||
| 25 | |||
| 26 | Closes: https://github.com/containers/composefs/issues/272 | ||
| 27 | |||
| 28 | Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org> | ||
| 29 | |||
| 30 | Upstream-Status: Submitted [https://github.com/containers/composefs/pull/273] | ||
| 31 | --- | ||
| 32 | libcomposefs/lcfs-utils.h | 6 ++++++ | ||
| 33 | tools/mkcomposefs.c | 2 +- | ||
| 34 | tools/mountcomposefs.c | 3 ++- | ||
| 35 | 3 files changed, 9 insertions(+), 2 deletions(-) | ||
| 36 | |||
| 37 | --- a/tools/mountcomposefs.c | ||
| 38 | +++ b/tools/mountcomposefs.c | ||
| 39 | @@ -37,10 +37,11 @@ | ||
| 40 | #include <linux/fsverity.h> | ||
| 41 | |||
| 42 | #include "libcomposefs/lcfs-mount.h" | ||
| 43 | +#include "libcomposefs/lcfs-utils.h" | ||
| 44 | |||
| 45 | static void usage(const char *argv0) | ||
| 46 | { | ||
| 47 | - const char *bin = basename(argv0); | ||
| 48 | + const char *bin = gnu_basename(argv0); | ||
| 49 | fprintf(stderr, | ||
| 50 | "usage: %s [-t type] [-o opt[,opts..]] IMAGE MOUNTPOINT\n" | ||
| 51 | "Example:\n" | ||
| 52 | --- a/libcomposefs/lcfs-utils.h | ||
| 53 | +++ b/libcomposefs/lcfs-utils.h | ||
| 54 | @@ -161,4 +161,10 @@ static inline void *steal_pointer(void * | ||
| 55 | /* type safety */ | ||
| 56 | #define steal_pointer(pp) (0 ? (*(pp)) : (steal_pointer)(pp)) | ||
| 57 | |||
| 58 | +static inline const char *gnu_basename(const char *filename) | ||
| 59 | +{ | ||
| 60 | + const char *p = strrchr(filename, '/'); | ||
| 61 | + return p ? p+1 : filename; | ||
| 62 | +} | ||
| 63 | + | ||
| 64 | #endif | ||
| 65 | --- a/tools/mkcomposefs.c | ||
| 66 | +++ b/tools/mkcomposefs.c | ||
| 67 | @@ -315,7 +315,7 @@ static int fill_store(struct lcfs_node_s | ||
| 68 | |||
| 69 | static void usage(const char *argv0) | ||
| 70 | { | ||
| 71 | - const char *bin = basename(argv0); | ||
| 72 | + const char *bin = gnu_basename(argv0); | ||
| 73 | fprintf(stderr, | ||
| 74 | "Usage: %s [OPTIONS] SOURCE IMAGE\n" | ||
| 75 | "Options:\n" | ||
