xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_056.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
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           "
15
16DEPENDS += "kmod"
17DEPENDS:append:libc-musl = " fts"
18
19inherit bash-completion pkgconfig
20
21S = "${WORKDIR}/git"
22
23EXTRA_OECONF = "--prefix=${prefix} \
24                --libdir=${prefix}/lib \
25                --datadir=${datadir} \
26                --sysconfdir=${sysconfdir} \
27                --sbindir=${sbindir} \
28                --disable-documentation \
29                --bindir=${bindir} \
30                --includedir=${includedir} \
31                --localstatedir=${localstatedir} \
32               "
33
34# RDEPEND on systemd optionally
35PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
36PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,,,systemd"
37
38EXTRA_OEMAKE += 'libdir=${prefix}/lib LDLIBS="${LDLIBS}"'
39
40CFLAGS:append = " -fPIC"
41LDLIBS:append:libc-musl = " -lfts"
42
43do_configure() {
44    ./configure ${EXTRA_OECONF}
45}
46
47do_install() {
48    oe_runmake install DESTDIR=${D}
49    # Its Makefile uses cp -arx to install modules.d, so fix the owner
50    # to root:root
51    chown -R root:root ${D}/${prefix}/lib/dracut/modules.d
52}
53
54FILES:${PN} += "${prefix}/lib/kernel \
55                ${prefix}/lib/dracut \
56                ${systemd_unitdir} \
57               "
58FILES:${PN}-dbg += "${prefix}/lib/dracut/.debug"
59
60CONFFILES:${PN} += "${sysconfdir}/dracut.conf"
61
62RDEPENDS:${PN} = "findutils cpio util-linux-blkid util-linux-getopt util-linux bash ldd"
63
64# This could be optimized a bit, but let's avoid non-booting systems :)
65RRECOMMENDS:${PN} = " \
66                     kernel-modules \
67                     busybox \
68                     coreutils \
69                    "
70
71# CVE-2010-4176 affects only Fedora
72CVE_CHECK_IGNORE += "CVE-2010-4176"
73