1
votes

I'm currently using yocto to build the system imx6sxsabresd (IMX6 Solo X). I have successfully built the image however I want to add a script to init.d to turn on a led. I'm appending to the linux-imx recipes within the meta-fsl-bsp-release layer.

This is my linux-imx.bbappend file:

FILESEXTRAPATHS_prepend := "${THISDIR}/linux-imx:"



SRC_URI += "file://0001-added-pad-for-heartbeat-led.patch \
        file://heartbeat.sh \
        file://heartbeat "



PACKAGECONFIG_append = " heartbeat"



inherit update-rc.d

INITSCRIPT_PACKAGES = "${PN}"

INITSCRIPT_PARAMS = "start"

INITSCRIPT_NAME = "heartbeat.sh"



do_install_append() 
{

  install -d ${D}${sysconfdir}/init.d

  install -m 0755 ${WORKDIR}/heartbeat.sh ${D}${sysconfdir}/init.d/heartbeat.sh




  install -d ${D}/home/root

  install -m 0755 ${WORKDIR}/heartbeat ${D}/home/root/heartbeat

}



FILES_${PN} += "${sysconfdir}/init.d/heartbeat.sh /home/root/heartbeat"

PACKAGES = "${PN}"

I'm able to create the sdcard image succesfully with the patch I've included in this bbappend file, however, the files heartbeat.sh and heartbeat are not copying to the final rootfs added to the output sdcard file. This is very odd because I'm able to see these files in their paths copied to ../tmp/work/imx6sxsabresd-poky-linux-gnueabi/linux-imx/4.14.98-r0/image/

1
Linux-imx sounds like a kernel, right? I would not expect a kernel package to necessarily get installed on a rootfs. Have you considered using a new recipe?Jussi Kukkonen
Yes it is. Why wouldn't it? Is there another recipe that creates the rootfs? I was having issues getting my recipe to be executed when i had it separate. It's ontop of the provided bsp from nxp.Jon Clay
Anything that is needed during boot before rootfs is mounted cannot by definition be stored on the rootfs. Kernel is one of those things.Jussi Kukkonen

1 Answers

0
votes

As the comments suggests appending to the kernel recipe is the wrong way to go about this. You should instead add your own recipe and reference that recipe from the image definition (append to IMAGE_INSTALL).

Your recipe could look something like:

SUMMARY = "LED heartbeat init script"

inherit update-rc.d

SRC_URI += "\
    file://heartbeat.sh \
"

do_install() {
    install -d ${D}${sysconfdir}/init.d
    install -m 0755 ${WORKDIR}/heartbeat.sh ${D}${sysconfdir}/init.d/
}

FILES_${PN} =  "${sysconfdir}/init.d/heartbeat.sh"

INITSCRIPT_NAME = "heartbeat.sh"
INITSCRIPT_PARAMS = "start 90 5 . stop 20 0 1 6 ."