forked from commontorizon/meta-common-torizon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request commontorizon#33 from rborn-tx/TOR-3377
Integrate ostree version supporting composefs
- Loading branch information
Showing
38 changed files
with
874 additions
and
665 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
# TorizonCore configuration for signed images | ||
|
||
# inherit class to sign BSP related images | ||
# Inherit class to sign BSP related images (bootloader, kernel FIT image). | ||
inherit tdx-signed | ||
|
||
# globally enable signing of operating system images | ||
DISTROOVERRIDES:append = ":torizon-signed" | ||
# Enable protection features related to the root filesystem; this is done by | ||
# means of two overrides, namely: | ||
# | ||
# - cfs-support: Enable composefs support; when set, the ostree deployments will | ||
# contain a composefs image (by default) and the system will usually boot from | ||
# that image; however, the presence of the composefs image will not be | ||
# enforced at runtime. Unless that presence is enforced by other overrides, | ||
# the system will be capable of booting from a legacy ostree deployment (based | ||
# on hardlinks). | ||
# | ||
# - cfs-signed: TBD (not yet implemented) | ||
# | ||
# TODO: Get rid of remaining uses of override "torizon-signed". | ||
DISTROOVERRIDES:append = ":cfs-support" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
composefs | ||
overlay | ||
erofs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions
30
...tended/ostree/ostree-2024.1/0001-Expose-MOUNT_ATTR_IDMAP-detection-result-to-C-code.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
From 53a086ba294215508acba550237ab83f7d136c3e Mon Sep 17 00:00:00 2001 | ||
From: Rogerio Guerra Borin <[email protected]> | ||
Date: Wed, 7 Feb 2024 00:19:45 -0300 | ||
Subject: [PATCH] Expose MOUNT_ATTR_IDMAP detection result to C code | ||
|
||
This is to allow compiling composefs on machines having somewhat old | ||
Linux kernel headers. | ||
|
||
Signed-off-by: Rogerio Guerra Borin <[email protected]> | ||
--- | ||
configure.ac | 3 ++- | ||
1 file changed, 2 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/configure.ac b/configure.ac | ||
index 4800477a..b6eb6c3f 100644 | ||
--- a/configure.ac | ||
+++ b/configure.ac | ||
@@ -292,7 +292,8 @@ AC_COMPILE_IFELSE( | ||
],[int foo = MOUNT_ATTR_IDMAP;] | ||
)], | ||
[AC_MSG_RESULT(yes) | ||
- have_mount_attr_idmap=yes], | ||
+ AC_DEFINE([HAVE_MOUNT_ATTR_IDMAP], 1, [Define if MOUNT_ATTR_IDMAP is available in linux/mount.h]) | ||
+ have_mount_attr_idmap=yes], | ||
[AC_MSG_RESULT(no)]) | ||
dnl These are needed by libcomposefs to use the new mount API optionally | ||
AC_MSG_CHECKING([for new mount API (fsconfig)]) | ||
-- | ||
2.25.1 | ||
|
87 changes: 87 additions & 0 deletions
87
...nded/ostree/ostree-2024.1/0001-mount-Allow-building-when-macro-MOUNT_ATTR_IDMAP-is-.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
From c5241e94030f774df5f410e07c4de894d41e64e2 Mon Sep 17 00:00:00 2001 | ||
From: Rogerio Guerra Borin <[email protected]> | ||
Date: Tue, 6 Feb 2024 23:14:20 -0300 | ||
Subject: [PATCH 1/2] mount: Allow building when macro MOUNT_ATTR_IDMAP is not | ||
available | ||
|
||
This is to allow building the software on machines not having the | ||
MOUNT_ATTR_IDMAP macro in header "linux/mount.h". When that macro is not | ||
available, the dependency on struct mount_attr is also eliminated (which | ||
is good since both the macro and the struct were added to the kernel | ||
uapi virtually at the same time). | ||
|
||
With the changes in this commit, errors would be thrown at runtime when | ||
mounting the erofs image, but only if the idmap feature is used; this | ||
resembles the behavior when the "new mount API" is not detected. | ||
|
||
Upstream-Status: Accepted [https://github.com/containers/composefs/pull/253] | ||
|
||
Signed-off-by: Rogerio Guerra Borin <[email protected]> | ||
--- | ||
configure.ac | 11 +++++++++++ | ||
libcomposefs/lcfs-mount.c | 6 ++++++ | ||
2 files changed, 17 insertions(+) | ||
|
||
diff --git a/composefs/configure.ac b/composefs/configure.ac | ||
index b8ff154..1aa49e4 100644 | ||
--- a/composefs/configure.ac | ||
+++ b/composefs/configure.ac | ||
@@ -16,6 +16,17 @@ m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], AC_SUBST([pkgconfigdir], ${libdir}/ | ||
PKGCONFIG_REQUIRES= | ||
PKGCONFIG_REQUIRES_PRIVATELY= | ||
|
||
+AC_MSG_CHECKING([for MOUNT_ATTR_IDMAP]) | ||
+AC_COMPILE_IFELSE( | ||
+ [AC_LANG_PROGRAM([ | ||
+ #include <sys/mount.h> | ||
+ #include <linux/mount.h> | ||
+ ],[int foo = MOUNT_ATTR_IDMAP;] | ||
+ )], | ||
+ [AC_MSG_RESULT(yes) | ||
+ AC_DEFINE([HAVE_MOUNT_ATTR_IDMAP], 1, [Define if MOUNT_ATTR_IDMAP is available in linux/mount.h])], | ||
+ [AC_MSG_RESULT(no)]) | ||
+ | ||
AC_MSG_CHECKING([for new mount API (fsconfig)]) | ||
AC_COMPILE_IFELSE( | ||
[AC_LANG_SOURCE([[ | ||
diff --git a/composefs/libcomposefs/lcfs-mount.c b/composefs/libcomposefs/lcfs-mount.c | ||
index 0a4b08f..5285833 100644 | ||
--- a/composefs/libcomposefs/lcfs-mount.c | ||
+++ b/composefs/libcomposefs/lcfs-mount.c | ||
@@ -108,6 +108,7 @@ static int syscall_move_mount(int from_dfd, const char *from_pathname, int to_df | ||
#endif | ||
} | ||
|
||
+#ifdef HAVE_MOUNT_ATTR_IDMAP | ||
static int syscall_mount_setattr(int dfd, const char *path, unsigned int flags, | ||
struct mount_attr *attr, size_t usize) | ||
{ | ||
@@ -122,6 +123,7 @@ static int syscall_mount_setattr(int dfd, const char *path, unsigned int flags, | ||
return -1; | ||
#endif | ||
} | ||
+#endif | ||
|
||
#define MAX_DIGEST_SIZE 64 | ||
|
||
@@ -381,6 +383,7 @@ static int lcfs_mount_erofs(const char *source, const char *target, | ||
return -errno; | ||
|
||
if (use_idmap) { | ||
+#ifdef HAVE_MOUNT_ATTR_IDMAP | ||
struct mount_attr attr = { | ||
.attr_set = MOUNT_ATTR_IDMAP, | ||
.userns_fd = state->options->idmap_fd, | ||
@@ -390,6 +393,9 @@ static int lcfs_mount_erofs(const char *source, const char *target, | ||
sizeof(struct mount_attr)); | ||
if (res < 0) | ||
return -errno; | ||
+#else | ||
+ return -ENOTSUP; | ||
+#endif | ||
} | ||
|
||
res = syscall_move_mount(fd_mnt, "", AT_FDCWD, target, | ||
-- | ||
2.25.1 | ||
|
35 changes: 35 additions & 0 deletions
35
recipes-extended/ostree/ostree-2024.1/0001-ostree-pull-set-request-timeout.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
From 9919910eff1fbf40260b307ace287b3192436629 Mon Sep 17 00:00:00 2001 | ||
From: Mike Sul <[email protected]> | ||
Date: Sat, 3 Jul 2021 20:37:08 -0300 | ||
Subject: [PATCH] ostree-fetcher-curl: set a timeout for an overall request | ||
processing | ||
|
||
Signed-off-by: Mike Sul <[email protected]> | ||
Signed-off-by: Ricardo Salveti <[email protected]> | ||
--- | ||
src/libostree/ostree-fetcher-curl.c | 9 +++++++++ | ||
1 file changed, 9 insertions(+) | ||
|
||
diff --git a/src/libostree/ostree-fetcher-curl.c b/src/libostree/ostree-fetcher-curl.c | ||
index e9b9672b..dd3bd8a5 100644 | ||
--- a/src/libostree/ostree-fetcher-curl.c | ||
+++ b/src/libostree/ostree-fetcher-curl.c | ||
@@ -961,6 +961,15 @@ initiate_next_curl_request (FetcherRequest *req, GTask *task) | ||
rc = curl_easy_setopt (req->easy, CURLOPT_PROGRESSDATA, task); | ||
g_assert_cmpint (rc, ==, CURLM_OK); | ||
|
||
+ /* set a request timeout, make sure it's not 0, otherwise an overall ostree pull session might hang */ | ||
+ long curl_timeout = 0L; | ||
+ const char* curl_timeout_str = g_getenv ("OSTREE_CURL_TIMEOUT"); | ||
+ if (curl_timeout_str != NULL) | ||
+ curl_timeout = atoi(curl_timeout_str); | ||
+ if (curl_timeout == 0) | ||
+ curl_timeout = 780L; | ||
+ curl_easy_setopt (req->easy, CURLOPT_TIMEOUT, curl_timeout); | ||
+ | ||
CURLMcode multi_rc = curl_multi_add_handle (self->multi, req->easy); | ||
g_assert (multi_rc == CURLM_OK); | ||
} | ||
-- | ||
2.25.1 | ||
|
Oops, something went wrong.