]> git.kernelconcepts.de Git - meta-kc-bsp.git/blobdiff - recipes-bsp/startup/custom-firststart_1.0.bb
custom-firststart: add sysvinit service to run scripts on first boot
[meta-kc-bsp.git] / recipes-bsp / startup / custom-firststart_1.0.bb
diff --git a/recipes-bsp/startup/custom-firststart_1.0.bb b/recipes-bsp/startup/custom-firststart_1.0.bb
new file mode 100644 (file)
index 0000000..1cc19c7
--- /dev/null
@@ -0,0 +1,40 @@
+SUMMARY = "Runs custom scripts on first boot of the target device"
+SECTION = "devel"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = " \
+       file://firststart.init \
+       file://firststart.sh \
+       file://banner.sh \
+"
+
+S = "${WORKDIR}"
+
+inherit allarch update-rc.d
+
+INITSCRIPT_NAME = "firststart"
+INITSCRIPT_PARAMS = "start 99 S ."
+
+do_configure() {
+       :
+}
+
+do_compile () {
+       :
+}
+
+do_install() {
+       install -d ${D}${sysconfdir}/firststart.d/
+       install -m 0755 ${WORKDIR}/banner.sh ${D}/${sysconfdir}/firststart.d/01banner
+       install -d ${D}${sysconfdir}/init.d/
+       install -m 0755 ${WORKDIR}/firststart.init ${D}${sysconfdir}/init.d/firststart
+       install -d ${D}${sbindir}
+       install -m 0755 ${WORKDIR}/firststart.sh ${D}${sbindir}/firststart.sh
+
+       sed -i -e 's:#SYSCONFDIR#:${sysconfdir}:g' \
+               -e 's:#SBINDIR#:${sbindir}:g' \
+               -e 's:#BASE_BINDIR#:${base_bindir}:g' \
+               -e 's:#LOCALSTATEDIR#:${localstatedir}:g' \
+               ${D}${sbindir}/firststart.sh
+}