From fcdafe933c96149b5e433d3755a75e7f9ee7a42c Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Fri, 1 Apr 2022 17:41:59 +0800 Subject: dracut: upgrade 055 -> 056 * Add a patch to fix musl build: src/install/util.c:30:19: error: missing binary operator before token "(" 30 | #if __GLIBC_PREREQ(2, 30) == 0 | ^ make: *** [Makefile:57: src/install/util.o] Error 1 * Pass "-fPIC" to CFLAGS to fix build warning with musl build: WARNING: dracut-1_056-r0 do_package_qa: QA Issue: dracut: ELF binary /usr/lib/dracut/dracut-install has relocations in .text [textrel] Signed-off-by: Yi Zhao Signed-off-by: Khem Raj --- ...uard-against-__GLIBC_PREREQ-for-musl-libc.patch | 35 +++++++++++ .../recipes-devtools/dracut/dracut_055.bb | 70 --------------------- .../recipes-devtools/dracut/dracut_056.bb | 72 ++++++++++++++++++++++ 3 files changed, 107 insertions(+), 70 deletions(-) create mode 100644 meta-initramfs/recipes-devtools/dracut/dracut/0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch delete mode 100644 meta-initramfs/recipes-devtools/dracut/dracut_055.bb create mode 100644 meta-initramfs/recipes-devtools/dracut/dracut_056.bb (limited to 'meta-initramfs/recipes-devtools') 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 new file mode 100644 index 0000000000..bd768d00d2 --- /dev/null +++ b/meta-initramfs/recipes-devtools/dracut/dracut/0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch @@ -0,0 +1,35 @@ +From ff5e1a662ba93ba79e2aeaaaec48a2a8ec4b4701 Mon Sep 17 00:00:00 2001 +From: Yi Zhao +Date: Thu, 31 Mar 2022 22:22:44 +0800 +Subject: [PATCH] Guard against __GLIBC_PREREQ for musl libc + +Upstream-Status: Pending + +Signed-off-by: Yi Zhao +--- + src/install/util.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/install/util.c b/src/install/util.c +index 5721de89..784aec48 100644 +--- a/src/install/util.c ++++ b/src/install/util.c +@@ -27,6 +27,7 @@ + + #include "util.h" + ++#if defined(__GLIBC__) + #if __GLIBC_PREREQ(2, 30) == 0 + #include + #ifndef SYS_gettid +@@ -35,6 +36,7 @@ + + #define gettid() ((pid_t) syscall(SYS_gettid)) + #endif /*__GLIBC_PREREQ */ ++#endif /*__GLIBC__*/ + + size_t page_size(void) + { +-- +2.25.1 + diff --git a/meta-initramfs/recipes-devtools/dracut/dracut_055.bb b/meta-initramfs/recipes-devtools/dracut/dracut_055.bb deleted file mode 100644 index a8fc5462f7..0000000000 --- a/meta-initramfs/recipes-devtools/dracut/dracut_055.bb +++ /dev/null @@ -1,70 +0,0 @@ -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 = "GPL-2.0-only" -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" - -PE = "1" - -SRCREV = "86bf2533d77762e823ad7a3e06a574522c1a90e3" -SRC_URI = "git://git.kernel.org/pub/scm/boot/dracut/dracut.git;protocol=http;branch=master \ - file://0001-util.h-include-sys-reg.h-when-libc-glibc.patch \ - " - -DEPENDS += "kmod" -DEPENDS:append:libc-musl = " fts" - -inherit bash-completion pkgconfig - -S = "${WORKDIR}/git" - -EXTRA_OECONF = "--prefix=${prefix} \ - --libdir=${prefix}/lib \ - --datadir=${datadir} \ - --sysconfdir=${sysconfdir} \ - --sbindir=${sbindir} \ - --disable-documentation \ - --bindir=${bindir} \ - --includedir=${includedir} \ - --localstatedir=${localstatedir} \ - " - -# RDEPEND on systemd optionally -PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" -PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,,,systemd" - -EXTRA_OEMAKE += 'libdir=${prefix}/lib LDLIBS="${LDLIBS}"' - -LDLIBS:append:libc-musl = " -lfts" - -do_configure() { - ./configure ${EXTRA_OECONF} -} - -do_install() { - oe_runmake install DESTDIR=${D} - # Its Makefile uses cp -arx to install modules.d, so fix the owner - # to root:root - chown -R root:root ${D}/${prefix}/lib/dracut/modules.d -} - -FILES:${PN} += "${prefix}/lib/kernel \ - ${prefix}/lib/dracut \ - ${systemd_unitdir} \ - " -FILES:${PN}-dbg += "${prefix}/lib/dracut/.debug" - -CONFFILES:${PN} += "${sysconfdir}/dracut.conf" - -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} = " \ - kernel-modules \ - busybox \ - coreutils \ - " - -# CVE-2010-4176 affects only Fedora -CVE_CHECK_IGNORE += "CVE-2010-4176" diff --git a/meta-initramfs/recipes-devtools/dracut/dracut_056.bb b/meta-initramfs/recipes-devtools/dracut/dracut_056.bb new file mode 100644 index 0000000000..7b89006103 --- /dev/null +++ b/meta-initramfs/recipes-devtools/dracut/dracut_056.bb @@ -0,0 +1,72 @@ +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 = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +PE = "1" + +SRCREV = "631d5f72a223288aa1f48bb8e8d0313e75947400" +SRC_URI = "git://git.kernel.org/pub/scm/boot/dracut/dracut.git;protocol=http;branch=master \ + file://0001-util.h-include-sys-reg.h-when-libc-glibc.patch \ + file://0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch \ + " + +DEPENDS += "kmod" +DEPENDS:append:libc-musl = " fts" + +inherit bash-completion pkgconfig + +S = "${WORKDIR}/git" + +EXTRA_OECONF = "--prefix=${prefix} \ + --libdir=${prefix}/lib \ + --datadir=${datadir} \ + --sysconfdir=${sysconfdir} \ + --sbindir=${sbindir} \ + --disable-documentation \ + --bindir=${bindir} \ + --includedir=${includedir} \ + --localstatedir=${localstatedir} \ + " + +# RDEPEND on systemd optionally +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" +PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,,,systemd" + +EXTRA_OEMAKE += 'libdir=${prefix}/lib LDLIBS="${LDLIBS}"' + +CFLAGS:append = " -fPIC" +LDLIBS:append:libc-musl = " -lfts" + +do_configure() { + ./configure ${EXTRA_OECONF} +} + +do_install() { + oe_runmake install DESTDIR=${D} + # Its Makefile uses cp -arx to install modules.d, so fix the owner + # to root:root + chown -R root:root ${D}/${prefix}/lib/dracut/modules.d +} + +FILES:${PN} += "${prefix}/lib/kernel \ + ${prefix}/lib/dracut \ + ${systemd_unitdir} \ + " +FILES:${PN}-dbg += "${prefix}/lib/dracut/.debug" + +CONFFILES:${PN} += "${sysconfdir}/dracut.conf" + +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} = " \ + kernel-modules \ + busybox \ + coreutils \ + " + +# CVE-2010-4176 affects only Fedora +CVE_CHECK_IGNORE += "CVE-2010-4176" -- cgit v1.2.3-54-g00ecf