diff options
| -rw-r--r-- | meta-initramfs/recipes-devtools/dracut/dracut_git.bb | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/meta-initramfs/recipes-devtools/dracut/dracut_git.bb b/meta-initramfs/recipes-devtools/dracut/dracut_git.bb new file mode 100644 index 0000000000..4a8e7e56aa --- /dev/null +++ b/meta-initramfs/recipes-devtools/dracut/dracut_git.bb | |||
| @@ -0,0 +1,106 @@ | |||
| 1 | SUMMARY = "Initramfs generator using udev" | ||
| 2 | HOMEPAGE = "https://dracut.wiki.kernel.org/index.php/Main_Page" | ||
| 3 | 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." | ||
| 4 | |||
| 5 | LICENSE = "GPL-2.0-only" | ||
| 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | ||
| 7 | |||
| 8 | # Since this is not using a release tag *and* features a rewrite of the dependency logic: | ||
| 9 | DEFAULT_PREFERENCE = "-1" | ||
| 10 | |||
| 11 | PE = "1" | ||
| 12 | |||
| 13 | # We want to drag in PR1260 to use ELF .note.dlopen entries instead of (cross-)ldd, but that was applied a week after the 107 tag | ||
| 14 | PV = "107+git" | ||
| 15 | SRCREV = "79ffbd28294818a36e515a441142125d70e3acbb" | ||
| 16 | SRC_URI = "git://github.com/dracut-ng/dracut-ng.git;protocol=http;branch=main \ | ||
| 17 | " | ||
| 18 | |||
| 19 | DEPENDS += "kmod" | ||
| 20 | DEPENDS:append:libc-musl = " fts" | ||
| 21 | |||
| 22 | inherit bash-completion pkgconfig | ||
| 23 | |||
| 24 | EXTRA_OECONF = "--prefix=${prefix} \ | ||
| 25 | --libdir=${nonarch_libdir} \ | ||
| 26 | --datadir=${datadir} \ | ||
| 27 | --sysconfdir=${sysconfdir} \ | ||
| 28 | --sbindir=${sbindir} \ | ||
| 29 | --bindir=${bindir} \ | ||
| 30 | --includedir=${includedir} \ | ||
| 31 | --localstatedir=${localstatedir} \ | ||
| 32 | --disable-documentation \ | ||
| 33 | " | ||
| 34 | |||
| 35 | # RDEPEND on systemd optionally | ||
| 36 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" | ||
| 37 | PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,,,systemd" | ||
| 38 | |||
| 39 | EXTRA_OEMAKE += 'libdir=${nonarch_libdir} LDLIBS="${LDLIBS}" enable_test=no DRACUT_FULL_VERSION=${PV}' | ||
| 40 | |||
| 41 | CFLAGS:append = " -fPIC" | ||
| 42 | LDLIBS:append:libc-musl = " -lfts" | ||
| 43 | |||
| 44 | do_configure() { | ||
| 45 | ./configure ${EXTRA_OECONF} | ||
| 46 | } | ||
| 47 | |||
| 48 | do_install() { | ||
| 49 | oe_runmake install DESTDIR=${D} | ||
| 50 | # Its Makefile uses cp -arx to install modules.d, so fix the owner | ||
| 51 | # to root:root | ||
| 52 | chown -R root:root ${D}/${nonarch_libdir}/dracut/modules.d \ | ||
| 53 | ${D}/${nonarch_libdir}/dracut/dracut.conf.d | ||
| 54 | |||
| 55 | if ! ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
| 56 | rm -rf ${D}${nonarch_libdir}/systemd | ||
| 57 | fi | ||
| 58 | } | ||
| 59 | |||
| 60 | do_install:append:class-target () { | ||
| 61 | # Generate and install a config file listing where the DISTRO puts things, dracut | ||
| 62 | # is not always savvy enough to figure it out by itself | ||
| 63 | # Since this primarily fixes systemd issues, only install it when using systemd. | ||
| 64 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
| 65 | cat << EOF > ${B}/${DISTRO}.conf | ||
| 66 | stdloglvl=3 | ||
| 67 | sysloglvl=5 | ||
| 68 | sysctlconfdir=${sysconfdir}/sysctl.d | ||
| 69 | systemdutildir=${systemd_unitdir} | ||
| 70 | systemdutilconfdir=${sysconfdir}/systemd | ||
| 71 | systemdcatalog=${systemd_unitdir}catalog | ||
| 72 | systemdntpunits=${systemd_unitdir}ntp-units.d | ||
| 73 | systemdntpunitsconfdir=${sysconfdir}/systemd/ntp-units.d | ||
| 74 | systemdportable=${systemd_unitdir}/portable | ||
| 75 | systemdportableconfdir=${sysconfdir}/systemd/portable | ||
| 76 | systemdsystemunitdir=${systemd_system_unitdir} | ||
| 77 | systemdsystemconfdir=${sysconfdir}/systemd/system | ||
| 78 | systemduser=${systemd_user_unitdir} | ||
| 79 | systemduserconfdir=${sysconfdir}/systemd/user | ||
| 80 | EOF | ||
| 81 | install -m 0644 ${B}/${DISTRO}.conf ${D}${libdir}/dracut/dracut.conf.d/ | ||
| 82 | fi | ||
| 83 | } | ||
| 84 | |||
| 85 | |||
| 86 | FILES:${PN} += "${nonarch_libdir}/kernel \ | ||
| 87 | ${nonarch_libdir}/dracut \ | ||
| 88 | ${systemd_unitdir} \ | ||
| 89 | " | ||
| 90 | FILES:${PN}-dbg += "${nonarch_libdir}/dracut/.debug" | ||
| 91 | |||
| 92 | CONFFILES:${PN} += "${sysconfdir}/dracut.conf" | ||
| 93 | |||
| 94 | # The native variant uses a non-ldd based method of getting library | ||
| 95 | # dependencies, so ldd is only needed on the target | ||
| 96 | RDEPENDS:${PN} = "findutils cpio util-linux-blkid util-linux-getopt util-linux bash" | ||
| 97 | RDEPENDS:${PN}:append:class-target = " ldd" | ||
| 98 | |||
| 99 | # This could be optimized a bit, but let's avoid non-booting systems :) | ||
| 100 | RRECOMMENDS:${PN}:class-target = "kernel-modules \ | ||
| 101 | coreutils \ | ||
| 102 | " | ||
| 103 | |||
| 104 | BBCLASSEXTEND = "native nativesdk" | ||
| 105 | |||
| 106 | CVE_STATUS[CVE-2010-4176] = "not-applicable-platform: Applies only to Fedora" | ||
