diff options
Diffstat (limited to 'meta-initramfs')
| -rw-r--r-- | meta-initramfs/recipes-devtools/dracut/dracut/0001-feat-dracut-install-split-ldd-command-arguments-for-.patch | 91 | ||||
| -rw-r--r-- | meta-initramfs/recipes-devtools/dracut/dracut/0001-feat-dracut.sh-try-STRIP-for-strip_cmd-first.patch | 33 | ||||
| -rw-r--r-- | meta-initramfs/recipes-devtools/dracut/dracut/0002-fix-broken-symlink-in-dracut-config-examples.patch (renamed from meta-initramfs/recipes-devtools/dracut/dracut/0001-fix-broken-symlink-in-dracut-config-examples.patch) | 14 | ||||
| -rw-r--r-- | meta-initramfs/recipes-devtools/dracut/dracut_108.bb (renamed from meta-initramfs/recipes-devtools/dracut/dracut_106.bb) | 47 |
4 files changed, 79 insertions, 106 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 deleted file mode 100644 index febdbdbddd..0000000000 --- a/meta-initramfs/recipes-devtools/dracut/dracut/0001-feat-dracut-install-split-ldd-command-arguments-for-.patch +++ /dev/null | |||
| @@ -1,91 +0,0 @@ | |||
| 1 | From 38dea7dd671fd621b563377cfbd95e4783568c6e Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?= | ||
| 3 | <zboszor@gmail.com> | ||
| 4 | Date: Fri, 7 Jun 2024 10:32:40 +0200 | ||
| 5 | Subject: [PATCH] feat(dracut-install): split ldd command arguments for | ||
| 6 | execvp() | ||
| 7 | MIME-Version: 1.0 | ||
| 8 | Content-Type: text/plain; charset=UTF-8 | ||
| 9 | Content-Transfer-Encoding: 8bit | ||
| 10 | |||
| 11 | This restores a not-so-subtle feature of previously executing ldd | ||
| 12 | via popen(), i.e. the ability to use a cross-compiled sysroot. | ||
| 13 | |||
| 14 | The ldd command may be passed in via the DRACUT_LDD environment | ||
| 15 | variable, and the command may contain command line arguments. | ||
| 16 | The number of such arguments are not known in advance. | ||
| 17 | |||
| 18 | Split the command into executable and arguments and run it | ||
| 19 | via execvp(). | ||
| 20 | |||
| 21 | Fixes: d010fa0d7f8ef42ad31729d027d2e4be6dd6e588 | ||
| 22 | Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> | ||
| 23 | Upstream-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 | |||
| 28 | diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c | ||
| 29 | index 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 | -- | ||
| 90 | 2.45.2 | ||
| 91 | |||
diff --git a/meta-initramfs/recipes-devtools/dracut/dracut/0001-feat-dracut.sh-try-STRIP-for-strip_cmd-first.patch b/meta-initramfs/recipes-devtools/dracut/dracut/0001-feat-dracut.sh-try-STRIP-for-strip_cmd-first.patch new file mode 100644 index 0000000000..00d75ccff6 --- /dev/null +++ b/meta-initramfs/recipes-devtools/dracut/dracut/0001-feat-dracut.sh-try-STRIP-for-strip_cmd-first.patch | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | From b8504fdbc6ac7b49aa0a9671267be8ac7affb2ee Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Koen Kooi <koen.kooi@oss.qualcomm.com> | ||
| 3 | Date: Thu, 19 Jun 2025 16:06:14 +0200 | ||
| 4 | Subject: [PATCH 1/2] feat: dracut.sh: try $STRIP for $strip_cmd first | ||
| 5 | |||
| 6 | When using dracut in a cross enviroment, like OpenEmbedded, the host | ||
| 7 | provided strip (or eu-strip) won't work, so try using the $STRIP | ||
| 8 | variable from the shell environment first before falling back to path | ||
| 9 | based lookups. | ||
| 10 | |||
| 11 | Signed-off-by: Koen Kooi <koen.kooi@oss.qualcomm.com> | ||
| 12 | Upstream-Status: Submitted [https://github.com/dracut-ng/dracut-ng/pull/1639] | ||
| 13 | --- | ||
| 14 | dracut.sh | 3 ++- | ||
| 15 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
| 16 | |||
| 17 | diff --git a/dracut.sh b/dracut.sh | ||
| 18 | index 45373efb..dbc5cd72 100755 | ||
| 19 | --- a/dracut.sh | ||
| 20 | +++ b/dracut.sh | ||
| 21 | @@ -2262,7 +2262,8 @@ done | ||
| 22 | if [[ $do_strip == yes ]]; then | ||
| 23 | # Prefer strip from elfutils for package size | ||
| 24 | declare strip_cmd | ||
| 25 | - strip_cmd=$(command -v eu-strip) | ||
| 26 | + strip_cmd="${STRIP}" | ||
| 27 | + [ -z "$strip_cmd" ] && strip_cmd=$(command -v eu-strip) | ||
| 28 | [ -z "$strip_cmd" ] && strip_cmd="strip" | ||
| 29 | |||
| 30 | for p in "$strip_cmd" xargs find; do | ||
| 31 | -- | ||
| 32 | 2.47.3 | ||
| 33 | |||
diff --git a/meta-initramfs/recipes-devtools/dracut/dracut/0001-fix-broken-symlink-in-dracut-config-examples.patch b/meta-initramfs/recipes-devtools/dracut/dracut/0002-fix-broken-symlink-in-dracut-config-examples.patch index 7d0b65a161..e2c202a079 100644 --- a/meta-initramfs/recipes-devtools/dracut/dracut/0001-fix-broken-symlink-in-dracut-config-examples.patch +++ b/meta-initramfs/recipes-devtools/dracut/dracut/0002-fix-broken-symlink-in-dracut-config-examples.patch | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | From 8871c593973d9abfef45408575e5da887830f42e Mon Sep 17 00:00:00 2001 | 1 | From e01991f1d55d4d1327793790bad3724b89952704 Mon Sep 17 00:00:00 2001 |
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> | 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
| 3 | Date: Thu, 22 May 2025 18:07:27 +0800 | 3 | Date: Thu, 22 May 2025 18:07:27 +0800 |
| 4 | Subject: [PATCH] fix broken symlink in dracut config examples | 4 | Subject: [PATCH 2/2] fix broken symlink in dracut config examples |
| 5 | 5 | ||
| 6 | Due to commit [1], it installs dracut config examples under /usr. | 6 | Due to commit [1], it installs dracut config examples under /usr. |
| 7 | But while enable_test=no, the symlink of test in dracut config is broken | 7 | But while enable_test=no, the symlink of test in dracut config is broken |
| @@ -28,17 +28,17 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | |||
| 28 | 1 file changed, 1 insertion(+) | 28 | 1 file changed, 1 insertion(+) |
| 29 | 29 | ||
| 30 | diff --git a/Makefile b/Makefile | 30 | diff --git a/Makefile b/Makefile |
| 31 | index d33aebbc..151d9f79 100644 | 31 | index 3a40594b..df7956ab 100644 |
| 32 | --- a/Makefile | 32 | --- a/Makefile |
| 33 | +++ b/Makefile | 33 | +++ b/Makefile |
| 34 | @@ -180,6 +180,7 @@ ifneq ($(enable_test),no) | 34 | @@ -218,6 +218,7 @@ ifeq ($(enable_test),yes) |
| 35 | cp -arx test $(DESTDIR)$(pkglibdir) | 35 | done |
| 36 | else | 36 | else |
| 37 | rm -rf $(DESTDIR)$(pkglibdir)/modules.d/80test* | 37 | rm -rf $(DESTDIR)$(pkglibdir)/modules.d/70test* |
| 38 | + rm -rf $(DESTDIR)$(pkglibdir)/dracut.conf.d/test* | 38 | + rm -rf $(DESTDIR)$(pkglibdir)/dracut.conf.d/test* |
| 39 | endif | 39 | endif |
| 40 | ifneq ($(enable_documentation),no) | 40 | ifneq ($(enable_documentation),no) |
| 41 | for i in $(man1pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man1/$${i##*/}; done | 41 | for i in $(man1pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man1/$${i##*/}; done |
| 42 | -- | 42 | -- |
| 43 | 2.34.1 | 43 | 2.47.3 |
| 44 | 44 | ||
diff --git a/meta-initramfs/recipes-devtools/dracut/dracut_106.bb b/meta-initramfs/recipes-devtools/dracut/dracut_108.bb index d59b357dc1..5c95abbf29 100644 --- a/meta-initramfs/recipes-devtools/dracut/dracut_106.bb +++ b/meta-initramfs/recipes-devtools/dracut/dracut_108.bb | |||
| @@ -7,10 +7,11 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | |||
| 7 | 7 | ||
| 8 | PE = "1" | 8 | PE = "1" |
| 9 | 9 | ||
| 10 | SRCREV = "956c08774074ddc45b2f975e13d5c13d1fc36eff" | 10 | PV = "108" |
| 11 | SRCREV = "97c5568ec42abd5e6035f0cfa9d319ae6ae4e50a" | ||
| 11 | SRC_URI = "git://github.com/dracut-ng/dracut-ng.git;protocol=http;branch=main \ | 12 | SRC_URI = "git://github.com/dracut-ng/dracut-ng.git;protocol=http;branch=main \ |
| 12 | file://0001-feat-dracut-install-split-ldd-command-arguments-for-.patch \ | 13 | file://0001-feat-dracut.sh-try-STRIP-for-strip_cmd-first.patch \ |
| 13 | file://0001-fix-broken-symlink-in-dracut-config-examples.patch \ | 14 | file://0002-fix-broken-symlink-in-dracut-config-examples.patch \ |
| 14 | " | 15 | " |
| 15 | 16 | ||
| 16 | DEPENDS += "kmod" | 17 | DEPENDS += "kmod" |
| @@ -18,7 +19,6 @@ DEPENDS:append:libc-musl = " fts" | |||
| 18 | 19 | ||
| 19 | inherit bash-completion pkgconfig | 20 | inherit bash-completion pkgconfig |
| 20 | 21 | ||
| 21 | |||
| 22 | EXTRA_OECONF = "--prefix=${prefix} \ | 22 | EXTRA_OECONF = "--prefix=${prefix} \ |
| 23 | --libdir=${nonarch_libdir} \ | 23 | --libdir=${nonarch_libdir} \ |
| 24 | --datadir=${datadir} \ | 24 | --datadir=${datadir} \ |
| @@ -55,6 +55,32 @@ do_install() { | |||
| 55 | fi | 55 | fi |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | do_install:append:class-target () { | ||
| 59 | # Generate and install a config file listing where the DISTRO puts things, dracut | ||
| 60 | # is not always savvy enough to figure it out by itself | ||
| 61 | # Since this primarily fixes systemd issues, only install it when using systemd. | ||
| 62 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
| 63 | cat << EOF > ${B}/${DISTRO}.conf | ||
| 64 | stdloglvl=3 | ||
| 65 | sysloglvl=5 | ||
| 66 | sysctlconfdir=${sysconfdir}/sysctl.d | ||
| 67 | systemdutildir=${systemd_unitdir} | ||
| 68 | systemdutilconfdir=${sysconfdir}/systemd | ||
| 69 | systemdcatalog=${systemd_unitdir}catalog | ||
| 70 | systemdntpunits=${systemd_unitdir}ntp-units.d | ||
| 71 | systemdntpunitsconfdir=${sysconfdir}/systemd/ntp-units.d | ||
| 72 | systemdportable=${systemd_unitdir}/portable | ||
| 73 | systemdportableconfdir=${sysconfdir}/systemd/portable | ||
| 74 | systemdsystemunitdir=${systemd_system_unitdir} | ||
| 75 | systemdsystemconfdir=${sysconfdir}/systemd/system | ||
| 76 | systemduser=${systemd_user_unitdir} | ||
| 77 | systemduserconfdir=${sysconfdir}/systemd/user | ||
| 78 | EOF | ||
| 79 | install -m 0644 ${B}/${DISTRO}.conf ${D}${libdir}/dracut/dracut.conf.d/ | ||
| 80 | fi | ||
| 81 | } | ||
| 82 | |||
| 83 | |||
| 58 | FILES:${PN} += "${nonarch_libdir}/kernel \ | 84 | FILES:${PN} += "${nonarch_libdir}/kernel \ |
| 59 | ${nonarch_libdir}/dracut \ | 85 | ${nonarch_libdir}/dracut \ |
| 60 | ${systemd_unitdir} \ | 86 | ${systemd_unitdir} \ |
| @@ -63,11 +89,16 @@ FILES:${PN}-dbg += "${nonarch_libdir}/dracut/.debug" | |||
| 63 | 89 | ||
| 64 | CONFFILES:${PN} += "${sysconfdir}/dracut.conf" | 90 | CONFFILES:${PN} += "${sysconfdir}/dracut.conf" |
| 65 | 91 | ||
| 66 | RDEPENDS:${PN} = "findutils cpio util-linux-blkid util-linux-getopt util-linux bash ldd" | 92 | # The native variant uses a non-ldd based method of getting library |
| 93 | # dependencies, so ldd is only needed on the target | ||
| 94 | RDEPENDS:${PN} = "findutils cpio util-linux-blkid util-linux-getopt util-linux bash" | ||
| 95 | RDEPENDS:${PN}:append:class-target = " ldd" | ||
| 67 | 96 | ||
| 68 | # This could be optimized a bit, but let's avoid non-booting systems :) | 97 | # This could be optimized a bit, but let's avoid non-booting systems :) |
| 69 | RRECOMMENDS:${PN} = "kernel-modules \ | 98 | RRECOMMENDS:${PN}:class-target = "kernel-modules \ |
| 70 | coreutils \ | 99 | coreutils \ |
| 71 | " | 100 | " |
| 101 | |||
| 102 | BBCLASSEXTEND = "native nativesdk" | ||
| 72 | 103 | ||
| 73 | CVE_STATUS[CVE-2010-4176] = "not-applicable-platform: Applies only to Fedora" | 104 | CVE_STATUS[CVE-2010-4176] = "not-applicable-platform: Applies only to Fedora" |
