xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_056.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSUMMARY = "Initramfs generator using udev"
2*4882a593SmuzhiyunHOMEPAGE = "https://dracut.wiki.kernel.org/index.php/Main_Page"
3*4882a593SmuzhiyunDESCRIPTION = "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*4882a593Smuzhiyun
5*4882a593SmuzhiyunLICENSE = "GPL-2.0-only"
6*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunPE = "1"
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunSRCREV = "631d5f72a223288aa1f48bb8e8d0313e75947400"
11*4882a593SmuzhiyunSRC_URI = "git://git.kernel.org/pub/scm/boot/dracut/dracut.git;protocol=http;branch=master \
12*4882a593Smuzhiyun           file://0001-util.h-include-sys-reg.h-when-libc-glibc.patch \
13*4882a593Smuzhiyun           file://0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch \
14*4882a593Smuzhiyun           "
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunDEPENDS += "kmod"
17*4882a593SmuzhiyunDEPENDS:append:libc-musl = " fts"
18*4882a593Smuzhiyun
19*4882a593Smuzhiyuninherit bash-completion pkgconfig
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunS = "${WORKDIR}/git"
22*4882a593Smuzhiyun
23*4882a593SmuzhiyunEXTRA_OECONF = "--prefix=${prefix} \
24*4882a593Smuzhiyun                --libdir=${prefix}/lib \
25*4882a593Smuzhiyun                --datadir=${datadir} \
26*4882a593Smuzhiyun                --sysconfdir=${sysconfdir} \
27*4882a593Smuzhiyun                --sbindir=${sbindir} \
28*4882a593Smuzhiyun                --disable-documentation \
29*4882a593Smuzhiyun                --bindir=${bindir} \
30*4882a593Smuzhiyun                --includedir=${includedir} \
31*4882a593Smuzhiyun                --localstatedir=${localstatedir} \
32*4882a593Smuzhiyun               "
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun# RDEPEND on systemd optionally
35*4882a593SmuzhiyunPACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
36*4882a593SmuzhiyunPACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,,,systemd"
37*4882a593Smuzhiyun
38*4882a593SmuzhiyunEXTRA_OEMAKE += 'libdir=${prefix}/lib LDLIBS="${LDLIBS}"'
39*4882a593Smuzhiyun
40*4882a593SmuzhiyunCFLAGS:append = " -fPIC"
41*4882a593SmuzhiyunLDLIBS:append:libc-musl = " -lfts"
42*4882a593Smuzhiyun
43*4882a593Smuzhiyundo_configure() {
44*4882a593Smuzhiyun    ./configure ${EXTRA_OECONF}
45*4882a593Smuzhiyun}
46*4882a593Smuzhiyun
47*4882a593Smuzhiyundo_install() {
48*4882a593Smuzhiyun    oe_runmake install DESTDIR=${D}
49*4882a593Smuzhiyun    # Its Makefile uses cp -arx to install modules.d, so fix the owner
50*4882a593Smuzhiyun    # to root:root
51*4882a593Smuzhiyun    chown -R root:root ${D}/${prefix}/lib/dracut/modules.d
52*4882a593Smuzhiyun}
53*4882a593Smuzhiyun
54*4882a593SmuzhiyunFILES:${PN} += "${prefix}/lib/kernel \
55*4882a593Smuzhiyun                ${prefix}/lib/dracut \
56*4882a593Smuzhiyun                ${systemd_unitdir} \
57*4882a593Smuzhiyun               "
58*4882a593SmuzhiyunFILES:${PN}-dbg += "${prefix}/lib/dracut/.debug"
59*4882a593Smuzhiyun
60*4882a593SmuzhiyunCONFFILES:${PN} += "${sysconfdir}/dracut.conf"
61*4882a593Smuzhiyun
62*4882a593SmuzhiyunRDEPENDS:${PN} = "findutils cpio util-linux-blkid util-linux-getopt util-linux bash ldd"
63*4882a593Smuzhiyun
64*4882a593Smuzhiyun# This could be optimized a bit, but let's avoid non-booting systems :)
65*4882a593SmuzhiyunRRECOMMENDS:${PN} = " \
66*4882a593Smuzhiyun                     kernel-modules \
67*4882a593Smuzhiyun                     busybox \
68*4882a593Smuzhiyun                     coreutils \
69*4882a593Smuzhiyun                    "
70*4882a593Smuzhiyun
71*4882a593Smuzhiyun# CVE-2010-4176 affects only Fedora
72*4882a593SmuzhiyunCVE_CHECK_IGNORE += "CVE-2010-4176"
73