1SUMMARY = "Modular initramfs system"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4RDEPENDS:${PN} += "${VIRTUAL-RUNTIME_base-utils}"
5RRECOMMENDS:${PN} = "${VIRTUAL-RUNTIME_base-utils-syslog}"
6
7
8inherit allarch
9
10SRC_URI = "file://init \
11           file://exec \
12           file://nfsrootfs \
13           file://rootfs \
14           file://finish \
15           file://mdev \
16           file://udev \
17           file://e2fs \
18           file://debug \
19           file://lvm \
20           file://overlayroot \
21          "
22
23S = "${WORKDIR}"
24
25do_install() {
26    install -d ${D}/init.d
27
28    # base
29    install -m 0755 ${WORKDIR}/init ${D}/init
30    install -m 0755 ${WORKDIR}/nfsrootfs ${D}/init.d/85-nfsrootfs
31    install -m 0755 ${WORKDIR}/rootfs ${D}/init.d/90-rootfs
32    install -m 0755 ${WORKDIR}/finish ${D}/init.d/99-finish
33
34    # exec
35    install -m 0755 ${WORKDIR}/exec ${D}/init.d/89-exec
36
37    # mdev
38    install -m 0755 ${WORKDIR}/mdev ${D}/init.d/01-mdev
39
40    # udev
41    install -m 0755 ${WORKDIR}/udev ${D}/init.d/01-udev
42
43    # e2fs
44    install -m 0755 ${WORKDIR}/e2fs ${D}/init.d/10-e2fs
45
46    # debug
47    install -m 0755 ${WORKDIR}/debug ${D}/init.d/00-debug
48
49    # lvm
50    install -m 0755 ${WORKDIR}/lvm ${D}/init.d/09-lvm
51
52    # overlayroot needs to run after rootfs module but before finish
53    install -m 0755 ${WORKDIR}/overlayroot ${D}/init.d/91-overlayroot
54
55    # Create device nodes expected by some kernels in initramfs
56    # before even executing /init.
57    install -d ${D}/dev
58    mknod -m 622 ${D}/dev/console c 5 1
59}
60
61PACKAGES = "${PN}-base \
62            initramfs-module-exec \
63            initramfs-module-mdev \
64            initramfs-module-udev \
65            initramfs-module-e2fs \
66            initramfs-module-nfsrootfs \
67            initramfs-module-rootfs \
68            initramfs-module-debug \
69            initramfs-module-lvm \
70            initramfs-module-overlayroot \
71           "
72
73FILES:${PN}-base = "/init /init.d/99-finish /dev"
74
75# 99-finish in base depends on some other module which mounts
76# the rootfs, like 90-rootfs. To replace that default, use
77# BAD_RECOMMENDATIONS += "initramfs-module-rootfs" in your
78# initramfs recipe and install something else, or install
79# something that runs earlier (for example, a 89-my-rootfs)
80# and mounts the rootfs. Then 90-rootfs will proceed immediately.
81RRECOMMENDS:${PN}-base += "initramfs-module-rootfs"
82
83SUMMARY:initramfs-module-exec = "initramfs support for easy execution of applications"
84RDEPENDS:initramfs-module-exec = "${PN}-base"
85FILES:initramfs-module-exec = "/init.d/89-exec"
86
87SUMMARY:initramfs-module-mdev = "initramfs support for mdev"
88RDEPENDS:initramfs-module-mdev = "${PN}-base busybox-mdev"
89FILES:initramfs-module-mdev = "/init.d/01-mdev"
90
91SUMMARY:initramfs-module-udev = "initramfs support for udev"
92RDEPENDS:initramfs-module-udev = "${PN}-base udev"
93FILES:initramfs-module-udev = "/init.d/01-udev"
94
95SUMMARY:initramfs-module-e2fs = "initramfs support for ext4/ext3/ext2 filesystems"
96RDEPENDS:initramfs-module-e2fs = "${PN}-base"
97FILES:initramfs-module-e2fs = "/init.d/10-e2fs"
98
99SUMMARY:initramfs-module-nfsrootfs = "initramfs support for locating and mounting the root partition via nfs"
100RDEPENDS:initramfs-module-nfsrootfs = "${PN}-base"
101FILES:initramfs-module-nfsrootfs = "/init.d/85-nfsrootfs"
102
103SUMMARY:initramfs-module-rootfs = "initramfs support for locating and mounting the root partition"
104RDEPENDS:initramfs-module-rootfs = "${PN}-base"
105FILES:initramfs-module-rootfs = "/init.d/90-rootfs"
106
107SUMMARY:initramfs-module-debug = "initramfs dynamic debug support"
108RDEPENDS:initramfs-module-debug = "${PN}-base"
109FILES:initramfs-module-debug = "/init.d/00-debug"
110
111SUMMARY:initramfs-module-lvm = "initramfs lvm rootfs support"
112RDEPENDS:initramfs-module-lvm = "${PN}-base"
113FILES:initramfs-module-lvm = "/init.d/09-lvm"
114
115SUMMARY:initramfs-module-overlayroot = "initramfs support for mounting a RW overlay on top of a RO root filesystem"
116RDEPENDS:initramfs-module-overlayroot = "${PN}-base initramfs-module-rootfs"
117FILES:initramfs-module-overlayroot = "/init.d/91-overlayroot"
118