summaryrefslogtreecommitdiff
path: root/recipes-core/initrdscripts/readonly-rootfs-overlay-init-script.inc
blob: d1b81046f6ea0ab9a527afe1335345167f28763a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
SUMMARY = "Read only rootfs with overlay init script"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
DEPENDS = "virtual/kernel"

# This was derived from https://github.com/cmhe/meta-readonly-rootfs-overlay

# script uses bash, findfs, busybox is problematic, so use real fsck,
# and add ext4 utilities in case some one needs to try to recover the
# user_data file system
RDEPENDS_${PN} = " \
    bash \
    util-linux-findfs \
    util-linux-fsck \
    e2fsprogs \
    e2fsprogs-mke2fs \
    e2fsprogs-badblocks \
    e2fsprogs-e2fsck \
    e2fsprogs-tune2fs \
    e2fsprogs-resize2fs \
    "

SRC_URI = "file://init-readonly-rootfs-overlay-boot.sh"

S = "${WORKDIR}"

do_install() {
        install -m 0755 ${WORKDIR}/init-readonly-rootfs-overlay-boot.sh ${D}/init
        install -d "${D}/run/media/rfs/ro"
        install -d "${D}/run/media/rfs/rw"
}

FILES_${PN} += " /init /run"

# Due to kernel dependency
PACKAGE_ARCH = "${MACHINE_ARCH}"