summaryrefslogtreecommitdiffstats
path: root/meta-initramfs/recipes-devtools
diff options
context:
space:
mode:
authorZoltán Böszörményi <zboszor@gmail.com>2024-06-07 12:32:09 +0200
committerKhem Raj <raj.khem@gmail.com>2024-06-07 21:52:52 -0700
commitae843182b4d639fbebd2a60a2f0054f606f41d3b (patch)
tree4feaf7d3b36ce33c32001e51dc4866a909551304 /meta-initramfs/recipes-devtools
parentda13475f00b043465178d1b784f0edc29ccde47a (diff)
downloadmeta-openembedded-ae843182b4d639fbebd2a60a2f0054f606f41d3b.tar.gz
dracut: Switch to dracut-ng and upgrade to version 102
The previous dracut 056 was hopelessly outdated. When creating an initramfs from a systemd based system with a recent systemd version, booting failed with this error: [ 1.906055] systemd[1]: Failed to open executor binary '/usr/lib/systemd/systemd-executor' [ 1.912230] systemd[1]: Failed to allocate manager object: No such file or directory [!!!!!!] Failed to allocate manager object [ 1.912480] systemd[1]: Freezing execution dracut-ng took over after development in the original dracut repository stopped. Switched to the new source repository. Dropped two patches upstreamed in dracut-ng. Added a new patch that partially reverts a change that broke creating an initramfs on the host using the cross-compiled sysroot. Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-initramfs/recipes-devtools')
-rw-r--r--meta-initramfs/recipes-devtools/dracut/dracut/0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch35
-rw-r--r--meta-initramfs/recipes-devtools/dracut/dracut/0001-feat-dracut-install-split-ldd-command-arguments-for-.patch91
-rw-r--r--meta-initramfs/recipes-devtools/dracut/dracut/0001-install-Do-not-undef-_FILE_OFFSET_BITS.patch32
-rw-r--r--meta-initramfs/recipes-devtools/dracut/dracut_102.bb (renamed from meta-initramfs/recipes-devtools/dracut/dracut_056.bb)7
4 files changed, 94 insertions, 71 deletions
diff --git a/meta-initramfs/recipes-devtools/dracut/dracut/0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch b/meta-initramfs/recipes-devtools/dracut/dracut/0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch
deleted file mode 100644
index bd768d00d2..0000000000
--- a/meta-initramfs/recipes-devtools/dracut/dracut/0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1From ff5e1a662ba93ba79e2aeaaaec48a2a8ec4b4701 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Thu, 31 Mar 2022 22:22:44 +0800
4Subject: [PATCH] Guard against __GLIBC_PREREQ for musl libc
5
6Upstream-Status: Pending
7
8Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
9---
10 src/install/util.c | 2 ++
11 1 file changed, 2 insertions(+)
12
13diff --git a/src/install/util.c b/src/install/util.c
14index 5721de89..784aec48 100644
15--- a/src/install/util.c
16+++ b/src/install/util.c
17@@ -27,6 +27,7 @@
18
19 #include "util.h"
20
21+#if defined(__GLIBC__)
22 #if __GLIBC_PREREQ(2, 30) == 0
23 #include <sys/syscall.h>
24 #ifndef SYS_gettid
25@@ -35,6 +36,7 @@
26
27 #define gettid() ((pid_t) syscall(SYS_gettid))
28 #endif /*__GLIBC_PREREQ */
29+#endif /*__GLIBC__*/
30
31 size_t page_size(void)
32 {
33--
342.25.1
35
diff --git a/meta-initramfs/recipes-devtools/dracut/dracut/0001-feat-dracut-install-split-ldd-command-arguments-for-.patch b/meta-initramfs/recipes-devtools/dracut/dracut/0001-feat-dracut-install-split-ldd-command-arguments-for-.patch
new file mode 100644
index 0000000000..febdbdbddd
--- /dev/null
+++ b/meta-initramfs/recipes-devtools/dracut/dracut/0001-feat-dracut-install-split-ldd-command-arguments-for-.patch
@@ -0,0 +1,91 @@
1From 38dea7dd671fd621b563377cfbd95e4783568c6e Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
3 <zboszor@gmail.com>
4Date: Fri, 7 Jun 2024 10:32:40 +0200
5Subject: [PATCH] feat(dracut-install): split ldd command arguments for
6 execvp()
7MIME-Version: 1.0
8Content-Type: text/plain; charset=UTF-8
9Content-Transfer-Encoding: 8bit
10
11This restores a not-so-subtle feature of previously executing ldd
12via popen(), i.e. the ability to use a cross-compiled sysroot.
13
14The ldd command may be passed in via the DRACUT_LDD environment
15variable, and the command may contain command line arguments.
16The number of such arguments are not known in advance.
17
18Split the command into executable and arguments and run it
19via execvp().
20
21Fixes: d010fa0d7f8ef42ad31729d027d2e4be6dd6e588
22Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
23Upstream-Status: Submitted [https://github.com/dracut-ng/dracut-ng/pull/339]
24---
25 src/install/dracut-install.c | 47 +++++++++++++++++++++++++++++++++++-
26 1 file changed, 46 insertions(+), 1 deletion(-)
27
28diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c
29index e9708c45..724b27b5 100644
30--- a/src/install/dracut-install.c
31+++ b/src/install/dracut-install.c
32@@ -559,10 +559,55 @@ static int resolve_deps(const char *src)
33 log_debug("%s %s", ldd, fullsrcpath);
34 pid_t ldd_pid;
35 if ((ldd_pid = fork()) == 0) {
36+ char **cmdline = NULL;
37+ int start, pos, idx = 0;
38+ /* Account for at least 2 elements plus the terminating NULL in cmdline */
39+ int args = 3;
40+
41+ /* Estimate the number of space-separated elements in the "ldd" string */
42+ pos = 0;
43+ while (isspace(ldd[pos]))
44+ pos++;
45+ for (; ldd[pos]; pos++) {
46+ if (isspace(ldd[pos])) {
47+ if (pos)
48+ args++;
49+ while (isspace(ldd[pos]))
50+ pos++;
51+ }
52+ }
53+
54+ cmdline = malloc(args * sizeof(char *));
55+ memset(cmdline, 0, args * sizeof(char *));
56+
57+ pos = 0;
58+ while (isspace(ldd[pos]))
59+ pos++;
60+ start = pos;
61+ for (; ldd[pos]; pos++) {
62+ while (ldd[pos] && !isspace(ldd[pos]))
63+ pos++;
64+
65+ cmdline[idx] = malloc(pos - start + 1);
66+ memcpy(cmdline[idx], ldd + start, pos - start);
67+ cmdline[idx][pos - start] = 0;
68+ idx++;
69+
70+ if (!ldd[pos])
71+ break;
72+
73+ while (isspace(ldd[pos]))
74+ pos++;
75+ start = pos;
76+ }
77+
78+ cmdline[idx++] = fullsrcpath;
79+ cmdline[idx] = NULL;
80+
81 dup2(fds[1], 1);
82 dup2(fds[1], 2);
83 putenv("LC_ALL=C");
84- execlp(ldd, ldd, fullsrcpath, (char *)NULL);
85+ execvp(cmdline[0], cmdline);
86 _exit(errno == ENOENT ? 127 : 126);
87 }
88 close(fds[1]);
89--
902.45.2
91
diff --git a/meta-initramfs/recipes-devtools/dracut/dracut/0001-install-Do-not-undef-_FILE_OFFSET_BITS.patch b/meta-initramfs/recipes-devtools/dracut/dracut/0001-install-Do-not-undef-_FILE_OFFSET_BITS.patch
deleted file mode 100644
index 170df7119f..0000000000
--- a/meta-initramfs/recipes-devtools/dracut/dracut/0001-install-Do-not-undef-_FILE_OFFSET_BITS.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1From 7f8ef553b7c433af153d48c6a16b2943780abf67 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 31 Dec 2022 14:41:52 -0800
4Subject: [PATCH] install: Do not undef _FILE_OFFSET_BITS
5
6_FILE_OFFSET_BITS is a feature test macro to determine largefile
7support. Usually its set to 64 on systems supporting LFS. Its also
8needed to be set to 64 for supporting 64bit time_t on glibc on 32bit
9systems. If its undefined explicitly, then 64bit time_t can not be
10enabled.
11
12Upstream-Status: Submitted [https://github.com/dracutdevs/dracut/pull/2157]
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15 src/install/dracut-install.c | 1 -
16 1 file changed, 1 deletion(-)
17
18diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c
19index dda0caca..05a67a03 100644
20--- a/src/install/dracut-install.c
21+++ b/src/install/dracut-install.c
22@@ -22,7 +22,6 @@
23 #ifndef _GNU_SOURCE
24 #define _GNU_SOURCE
25 #endif
26-#undef _FILE_OFFSET_BITS
27 #include <ctype.h>
28 #include <errno.h>
29 #include <fcntl.h>
30--
312.39.0
32
diff --git a/meta-initramfs/recipes-devtools/dracut/dracut_056.bb b/meta-initramfs/recipes-devtools/dracut/dracut_102.bb
index db08fffe9a..496380a0fb 100644
--- a/meta-initramfs/recipes-devtools/dracut/dracut_056.bb
+++ b/meta-initramfs/recipes-devtools/dracut/dracut_102.bb
@@ -7,11 +7,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
7 7
8PE = "1" 8PE = "1"
9 9
10SRCREV = "631d5f72a223288aa1f48bb8e8d0313e75947400" 10SRCREV = "1a8ee6e00bbe017717a5ef9e9bcfefb3b88f629e"
11SRC_URI = "git://git.kernel.org/pub/scm/boot/dracut/dracut.git;protocol=http;branch=master \ 11SRC_URI = "git://github.com/dracut-ng/dracut-ng.git;protocol=http;branch=main \
12 file://0001-util.h-include-sys-reg.h-when-libc-glibc.patch \ 12 file://0001-util.h-include-sys-reg.h-when-libc-glibc.patch \
13 file://0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch \ 13 file://0001-feat-dracut-install-split-ldd-command-arguments-for-.patch \
14 file://0001-install-Do-not-undef-_FILE_OFFSET_BITS.patch \
15 " 14 "
16 15
17DEPENDS += "kmod" 16DEPENDS += "kmod"