1SUMMARY = "Initramfs generator using udev"
2HOMEPAGE = "https://dracut.wiki.kernel.org/index.php/Main_Page"
3DESCRIPTION = "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
5LICENSE = "GPL-2.0-only"
6LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
7
8PE = "1"
9
10SRCREV = "631d5f72a223288aa1f48bb8e8d0313e75947400"
11SRC_URI = "git://git.kernel.org/pub/scm/boot/dracut/dracut.git;protocol=http;branch=master \
12           file://0001-util.h-include-sys-reg.h-when-libc-glibc.patch \
13           file://0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch \
14           file://0001-install-Do-not-undef-_FILE_OFFSET_BITS.patch \
15           "
16
17DEPENDS += "kmod"
18DEPENDS:append:libc-musl = " fts"
19
20inherit bash-completion pkgconfig
21
22S = "${WORKDIR}/git"
23
24EXTRA_OECONF = "--prefix=${prefix} \
25                --libdir=${prefix}/lib \
26                --datadir=${datadir} \
27                --sysconfdir=${sysconfdir} \
28                --sbindir=${sbindir} \
29                --disable-documentation \
30                --bindir=${bindir} \
31                --includedir=${includedir} \
32                --localstatedir=${localstatedir} \
33               "
34
35# RDEPEND on systemd optionally
36PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
37PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,,,systemd"
38
39EXTRA_OEMAKE += 'libdir=${prefix}/lib LDLIBS="${LDLIBS}"'
40
41CFLAGS:append = " -fPIC"
42LDLIBS:append:libc-musl = " -lfts"
43
44do_configure() {
45    ./configure ${EXTRA_OECONF}
46}
47
48do_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}/${prefix}/lib/dracut/modules.d
53}
54
55FILES:${PN} += "${prefix}/lib/kernel \
56                ${prefix}/lib/dracut \
57                ${systemd_unitdir} \
58               "
59FILES:${PN}-dbg += "${prefix}/lib/dracut/.debug"
60
61CONFFILES:${PN} += "${sysconfdir}/dracut.conf"
62
63RDEPENDS:${PN} = "findutils cpio util-linux-blkid util-linux-getopt util-linux bash ldd"
64
65# This could be optimized a bit, but let's avoid non-booting systems :)
66RRECOMMENDS:${PN} = " \
67                     kernel-modules \
68                     busybox \
69                     coreutils \
70                    "
71
72# CVE-2010-4176 affects only Fedora
73CVE_CHECK_IGNORE += "CVE-2010-4176"
74