custom-firststart: add sysvinit service to run scripts on first boot
[meta-kc-bsp.git] / recipes-bsp / startup / custom-firststart_1.0.bb
1 SUMMARY = "Runs custom scripts on first boot of the target device"
2 SECTION = "devel"
3 LICENSE = "MIT"
4 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
5
6 SRC_URI = " \
7         file://firststart.init \
8         file://firststart.sh \
9         file://banner.sh \
10 "
11
12 S = "${WORKDIR}"
13
14 inherit allarch update-rc.d
15
16 INITSCRIPT_NAME = "firststart"
17 INITSCRIPT_PARAMS = "start 99 S ."
18
19 do_configure() {
20         :
21 }
22
23 do_compile () {
24         :
25 }
26
27 do_install() {
28         install -d ${D}${sysconfdir}/firststart.d/
29         install -m 0755 ${WORKDIR}/banner.sh ${D}/${sysconfdir}/firststart.d/01banner
30         install -d ${D}${sysconfdir}/init.d/
31         install -m 0755 ${WORKDIR}/firststart.init ${D}${sysconfdir}/init.d/firststart
32         install -d ${D}${sbindir}
33         install -m 0755 ${WORKDIR}/firststart.sh ${D}${sbindir}/firststart.sh
34
35         sed -i -e 's:#SYSCONFDIR#:${sysconfdir}:g' \
36                -e 's:#SBINDIR#:${sbindir}:g' \
37                -e 's:#BASE_BINDIR#:${base_bindir}:g' \
38                -e 's:#LOCALSTATEDIR#:${localstatedir}:g' \
39                ${D}${sbindir}/firststart.sh
40 }