aboutsummaryrefslogtreecommitdiffstats
path: root/meta-initramfs/recipes-devtools/dracut
diff options
context:
space:
mode:
Diffstat (limited to 'meta-initramfs/recipes-devtools/dracut')
-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-util.h-include-sys-reg.h-when-libc-glibc.patch16
-rw-r--r--meta-initramfs/recipes-devtools/dracut/dracut_102.bb (renamed from meta-initramfs/recipes-devtools/dracut/dracut_git.bb)27
3 files changed, 114 insertions, 20 deletions
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 @@
+From 38dea7dd671fd621b563377cfbd95e4783568c6e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
+ <zboszor@gmail.com>
+Date: Fri, 7 Jun 2024 10:32:40 +0200
+Subject: [PATCH] feat(dracut-install): split ldd command arguments for
+ execvp()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This restores a not-so-subtle feature of previously executing ldd
+via popen(), i.e. the ability to use a cross-compiled sysroot.
+
+The ldd command may be passed in via the DRACUT_LDD environment
+variable, and the command may contain command line arguments.
+The number of such arguments are not known in advance.
+
+Split the command into executable and arguments and run it
+via execvp().
+
+Fixes: d010fa0d7f8ef42ad31729d027d2e4be6dd6e588
+Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
+Upstream-Status: Submitted [https://github.com/dracut-ng/dracut-ng/pull/339]
+---
+ src/install/dracut-install.c | 47 +++++++++++++++++++++++++++++++++++-
+ 1 file changed, 46 insertions(+), 1 deletion(-)
+
+diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c
+index e9708c45..724b27b5 100644
+--- a/src/install/dracut-install.c
++++ b/src/install/dracut-install.c
+@@ -559,10 +559,55 @@ static int resolve_deps(const char *src)
+ log_debug("%s %s", ldd, fullsrcpath);
+ pid_t ldd_pid;
+ if ((ldd_pid = fork()) == 0) {
++ char **cmdline = NULL;
++ int start, pos, idx = 0;
++ /* Account for at least 2 elements plus the terminating NULL in cmdline */
++ int args = 3;
++
++ /* Estimate the number of space-separated elements in the "ldd" string */
++ pos = 0;
++ while (isspace(ldd[pos]))
++ pos++;
++ for (; ldd[pos]; pos++) {
++ if (isspace(ldd[pos])) {
++ if (pos)
++ args++;
++ while (isspace(ldd[pos]))
++ pos++;
++ }
++ }
++
++ cmdline = malloc(args * sizeof(char *));
++ memset(cmdline, 0, args * sizeof(char *));
++
++ pos = 0;
++ while (isspace(ldd[pos]))
++ pos++;
++ start = pos;
++ for (; ldd[pos]; pos++) {
++ while (ldd[pos] && !isspace(ldd[pos]))
++ pos++;
++
++ cmdline[idx] = malloc(pos - start + 1);
++ memcpy(cmdline[idx], ldd + start, pos - start);
++ cmdline[idx][pos - start] = 0;
++ idx++;
++
++ if (!ldd[pos])
++ break;
++
++ while (isspace(ldd[pos]))
++ pos++;
++ start = pos;
++ }
++
++ cmdline[idx++] = fullsrcpath;
++ cmdline[idx] = NULL;
++
+ dup2(fds[1], 1);
+ dup2(fds[1], 2);
+ putenv("LC_ALL=C");
+- execlp(ldd, ldd, fullsrcpath, (char *)NULL);
++ execvp(cmdline[0], cmdline);
+ _exit(errno == ENOENT ? 127 : 126);
+ }
+ close(fds[1]);
+--
+2.45.2
+
diff --git a/meta-initramfs/recipes-devtools/dracut/dracut/0001-util.h-include-sys-reg.h-when-libc-glibc.patch b/meta-initramfs/recipes-devtools/dracut/dracut/0001-util.h-include-sys-reg.h-when-libc-glibc.patch
index 32714038b9..68ec2b8fdb 100644
--- a/meta-initramfs/recipes-devtools/dracut/dracut/0001-util.h-include-sys-reg.h-when-libc-glibc.patch
+++ b/meta-initramfs/recipes-devtools/dracut/dracut/0001-util.h-include-sys-reg.h-when-libc-glibc.patch
@@ -1,4 +1,4 @@
-From 06011ce55b1e892e863568a73d64eebc6389544f Mon Sep 17 00:00:00 2001
+From 9f7740c4c2fda64029c23674e9858ce8bd4367df Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 13 Jul 2017 17:14:05 -0700
Subject: [PATCH] util.h: include <sys/reg.h> when libc != glibc
@@ -11,13 +11,15 @@ https://github.com/voidlinux/void-packages/blob/master/srcpkgs/dracut/patches/mu
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
- install/util.h | 3 +++
+Upstream-Status: Pending
+
+ src/install/util.h | 3 +++
1 file changed, 3 insertions(+)
-diff --git a/install/util.h b/install/util.h
-index 2ad3254d..062626ec 100644
---- a/install/util.h
-+++ b/install/util.h
+diff --git a/src/install/util.h b/src/install/util.h
+index a6f9a184..82732913 100644
+--- a/src/install/util.h
++++ b/src/install/util.h
@@ -36,6 +36,9 @@
#include <sys/stat.h>
#include <dirent.h>
@@ -29,5 +31,5 @@ index 2ad3254d..062626ec 100644
#include "macro.h"
--
-2.13.2
+2.17.1
diff --git a/meta-initramfs/recipes-devtools/dracut/dracut_git.bb b/meta-initramfs/recipes-devtools/dracut/dracut_102.bb
index ccf9f6ab1b..496380a0fb 100644
--- a/meta-initramfs/recipes-devtools/dracut/dracut_git.bb
+++ b/meta-initramfs/recipes-devtools/dracut/dracut_102.bb
@@ -2,20 +2,19 @@ SUMMARY = "Initramfs generator using udev"
HOMEPAGE = "https://dracut.wiki.kernel.org/index.php/Main_Page"
DESCRIPTION = "Dracut is an event driven initramfs infrastructure. dracut (the tool) is used to create an initramfs image by copying tools and files from an installed system and combining it with the dracut framework, usually found in /usr/lib/dracut/modules.d."
-LICENSE = "GPLv2"
+LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
PE = "1"
-PV = "046+git${SRCREV}"
-# v046 tag
-SRCREV = "a0799ffb554487a370c2a1adafaedd2021b6dc8c"
-SRC_URI = "git://git.kernel.org/pub/scm/boot/dracut/dracut.git;protocol=http \
+SRCREV = "1a8ee6e00bbe017717a5ef9e9bcfefb3b88f629e"
+SRC_URI = "git://github.com/dracut-ng/dracut-ng.git;protocol=http;branch=main \
file://0001-util.h-include-sys-reg.h-when-libc-glibc.patch \
+ file://0001-feat-dracut-install-split-ldd-command-arguments-for-.patch \
"
DEPENDS += "kmod"
-DEPENDS_append_libc-musl = " fts"
+DEPENDS:append:libc-musl = " fts"
inherit bash-completion pkgconfig
@@ -38,7 +37,8 @@ PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/
EXTRA_OEMAKE += 'libdir=${prefix}/lib LDLIBS="${LDLIBS}"'
-LDLIBS_append_libc-musl = " -lfts"
+CFLAGS:append = " -fPIC"
+LDLIBS:append:libc-musl = " -lfts"
do_configure() {
./configure ${EXTRA_OECONF}
@@ -51,19 +51,20 @@ do_install() {
chown -R root:root ${D}/${prefix}/lib/dracut/modules.d
}
-FILES_${PN} += "${prefix}/lib/kernel \
+FILES:${PN} += "${prefix}/lib/kernel \
${prefix}/lib/dracut \
${systemd_unitdir} \
"
-FILES_${PN}-dbg += "${prefix}/lib/dracut/.debug"
+FILES:${PN}-dbg += "${prefix}/lib/dracut/.debug"
-CONFFILES_${PN} += "${sysconfdir}/dracut.conf"
+CONFFILES:${PN} += "${sysconfdir}/dracut.conf"
-RDEPENDS_${PN} = "findutils cpio util-linux-blkid util-linux-getopt util-linux bash ldd"
+RDEPENDS:${PN} = "findutils cpio util-linux-blkid util-linux-getopt util-linux bash ldd"
# This could be optimized a bit, but let's avoid non-booting systems :)
-RRECOMMENDS_${PN} = " \
+RRECOMMENDS:${PN} = " \
kernel-modules \
- busybox \
coreutils \
"
+
+CVE_STATUS[CVE-2010-4176] = "not-applicable-platform: Applies only to Fedora"