1SUMMARY = "Phosphor OpenBMC pre-init scripts"
2DESCRIPTION = "Phosphor OpenBMC filesystem mount reference implementation."
3LICENSE = "Apache-2.0"
4LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
5PR = "r1"
6
7SRC_URI += "file://obmc-init.sh"
8SRC_URI += "file://obmc-shutdown.sh"
9SRC_URI += "file://obmc-update.sh"
10SRC_URI += "file://whitelist"
11
12S = "${WORKDIR}"
13
14inherit allarch
15
16do_install() {
17        for f in init-download-url init-options
18        do
19                if test -e $f
20                then
21                        install -m 0755 ${WORKDIR}/$f ${D}/$f
22                fi
23        done
24        install -m 0755 ${WORKDIR}/obmc-init.sh ${D}/init
25        install -m 0755 ${WORKDIR}/obmc-shutdown.sh ${D}/shutdown
26        install -m 0755 ${WORKDIR}/obmc-update.sh ${D}/update
27
28        # verify white list entries
29        # each entry should have no '//', '/./', '/../' or trailing '/', '/.', '/..'
30        while read -r f
31        do
32                if test $(realpath -L -m ${WORKDIR}$f) != ${WORKDIR}$f
33                then
34                        bberror "Bad whitelist entry ${f}."
35                fi
36        done < ${WORKDIR}/whitelist
37        install -m 0644 ${WORKDIR}/whitelist ${D}/whitelist
38        install -d ${D}/dev
39        mknod -m 622 ${D}/dev/console c 5 1
40}
41
42RDEPENDS:${PN} += "${VIRTUAL-RUNTIME_base-utils}"
43
44FILES:${PN} += " /init /shutdown /update /whitelist /dev "
45FILES:${PN} += " /init-options /init-download-url "
46