1SUMMARY = "Phosphor OpenBMC pre-init scripts for static-norootfs layout" 2DESCRIPTION = "Phosphor OpenBMC filesystem mount implementation for static-norootfs" 3LICENSE = "Apache-2.0" 4LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" 5PR = "r1" 6 7SOURCE_FILES = "\ 8 init \ 9 10-early-mounts \ 10 20-udev \ 11 21-factory-reset \ 12 30-ubiattach-or-format \ 13 50-mount-persistent \ 14 " 15SRC_URI += "\ 16 ${@' '.join(\ 17 [ 'file://' + x for x in d.getVar('SOURCE_FILES', True).split()])} \ 18 " 19 20S = "${WORKDIR}" 21 22NOROOTFS_PERSISTENT_DIRS = "var etc ${@ d.getVar('ROOT_HOME')[1:]}" 23 24inherit allarch 25inherit update-alternatives 26 27PKG_INSTALL_DIR="${libexecdir}/${BPN}" 28FILES:${PN} += "${PKG_INSTALL_DIR}" 29 30do_install() { 31 install -d ${D}${PKG_INSTALL_DIR} 32 33 for f in ${SOURCE_FILES} ; do 34 install -m 0755 ${S}/$f ${D}${PKG_INSTALL_DIR}/$f 35 done 36 37 # Create persistent mount points and add to mount script. 38 for mountpoint in ${NOROOTFS_PERSISTENT_DIRS} ; do 39 mkdir -p ${D}/$mountpoint 40 touch ${D}/$mountpoint/.keep.mount-persistent 41 done 42 sed -i "s#@NOROOTFS_PERSISTENT_DIRS@#${NOROOTFS_PERSISTENT_DIRS}#" \ 43 ${D}${PKG_INSTALL_DIR}/50-mount-persistent 44} 45 46RDEPENDS:${PN} += " \ 47 ${@d.getVar('PREFERRED_PROVIDER_u-boot-fw-utils', True) or \ 48 'u-boot-fw-utils'} \ 49 ${VIRTUAL-RUNTIME_base-utils} \ 50 mtd-utils-ubifs \ 51 udev \ 52" 53 54FILES:${PN}:append = " ${@ " ".join([ '/' + x + '/.keep.mount-persistent' for x in d.getVar('NOROOTFS_PERSISTENT_DIRS').split() ])}" 55 56ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init" 57# Use a number higher than the systemd init alternative so that 58# ours is enabled instead. 59ALTERNATIVE_PRIORITY[init] ?= "400" 60 61ALTERNATIVE:${PN} = "init" 62ALTERNATIVE_TARGET[init] = "${PKG_INSTALL_DIR}/init" 63