summaryrefslogtreecommitdiffstats
path: root/meta-filesystems
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2024-04-09 09:54:44 +0200
committerKhem Raj <raj.khem@gmail.com>2024-04-09 07:31:02 -0700
commit64082c18e50b84ab261448950e1a807328ef1ec5 (patch)
treeb7558f614206cc189a84948311e89b77f408d821 /meta-filesystems
parent4f72481c68575fda086b74479a2d937e8053fcd5 (diff)
downloadmeta-openembedded-64082c18e50b84ab261448950e1a807328ef1ec5.tar.gz
composefs: add a new recipe
Tools to handle creating and mounting composefs images Flexible mechanism to support read-only mountable filesystem trees, stacking on top of Linux filesystem. It will allow to enable filesystem integrity by leveraging the stack: ostree -> composefs -> fs-verity For reference: https://github.com/containers/composefs?tab=readme-ov-file#filesystem-integrity https://ostreedev.github.io/ostree/composefs/#using-composefs-with-ostree Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-filesystems')
-rw-r--r--meta-filesystems/recipes-support/composefs/composefs_1.0.3.bb23
-rw-r--r--meta-filesystems/recipes-support/composefs/files/0001-musl-basename-use-portable-implementation-for-basena.patch75
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 000000000..7607b0a12
--- /dev/null
+++ b/meta-filesystems/recipes-support/composefs/composefs_1.0.3.bb
@@ -0,0 +1,23 @@
1SUMMARY = "Tools to handle creating and mounting composefs images"
2HOMEPAGE = "https://github.com/containers/composefs"
3LICENSE = "GPL-3.0-or-later & LGPL-2.0-or-later & Apache-2.0"
4LIC_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"
12DEPENDS = "fuse3 openssl"
13SRCREV = "2d5cdcb9176cfe4ccf1761ef6d78e1c48de35649"
14PV = "1.0.3"
15
16SRC_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
21S = "${WORKDIR}/git"
22
23inherit 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 000000000..49a0b21c6
--- /dev/null
+++ b/meta-filesystems/recipes-support/composefs/files/0001-musl-basename-use-portable-implementation-for-basena.patch
@@ -0,0 +1,75 @@
1From b21a9d4f10a066cac76bb345d31fdd24afcf3e6f Mon Sep 17 00:00:00 2001
2From: Fathi Boudra <fathi.boudra@linaro.org>
3Date: Tue, 9 Apr 2024 08:47:37 +0200
4Subject: [PATCH] musl: basename: use portable implementation for basename API
5
6musl has removed the non-prototype declaration of basename from string.h which
7now results in build errors with newer clang compilers.
8
9Implement GNU basename behavior using strchr which is portable across libcs.
10
11Fixes:
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
23For reference:
24https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
25
26Closes: https://github.com/containers/composefs/issues/272
27
28Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
29
30Upstream-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"