am33x-cm3: Split init script into its own package
[glsdk/meta-ti-glsdk.git] / recipes-bsp / ti / am33x-cm3_git.bb
index 247ba4d8d91f2af0669f724a27e7f7f8aaf174e5..3549fcdba98e9980f55cb383ec07aa5e8cff5760 100644 (file)
@@ -3,10 +3,25 @@ DESCRIPTION = "Cortex-M3 binary blob for suspend-resume"
 LICENSE = "TI-BSD"
 LIC_FILES_CHKSUM = "file://License.txt;md5=858099c817e47ea63559fc6b67ae8d91"
 
-PV = "04.06.00.07"
-SRCREV = "cf07b841d6e8c5e026eecb259d143f3dff412c8e"
+PV = "04.06.00.10"
+PR = "r3"
 
-SRC_URI = "git://arago-project.org/git/projects/am33x-cm3.git"
+# SRCREV corresponds to tag "AM335xPSP_04.06.00.10-rc1"
+SRCREV = "27ca4643e422245a95723de1df0247a00eada45b"
+BRANCH ?= "master"
+
+INITSCRIPT_NAME = "am335x-pm-firmware-load"
+INITSCRIPT_PARAMS = "defaults 96"
+
+inherit update-rc.d
+
+UPDATERCPN = "${PN}-initscript"
+
+RDEPENDS_${PN}-initscript = "am33x-cm3"
+
+SRC_URI = "git://arago-project.org/git/projects/am33x-cm3.git;protocol=git;branch=${BRANCH} \
+           file://init-am33x-cm3 \
+          "
 
 S = "${WORKDIR}/git"
 
@@ -17,7 +32,14 @@ do_compile() {
 do_install() {
        install -d ${D}${base_libdir}/firmware
        install -m 0644 bin/am335x-pm-firmware.bin ${D}${base_libdir}/firmware/
+
+       # Install the init script to load the PM firmware at boot
+       install -d ${D}${sysconfdir}/init.d
+       install -m 0755 ${WORKDIR}/init-am33x-cm3 ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
 }
 
-FILES_${PN} = "${base_libdir}/firmware"
+PACKAGES =+ "${PN}-initscript"
+
+FILES_${PN} += "${base_libdir}/firmware"
 
+FILES_${PN}-initscript = "${sysconfdir}/*"