16

I am trying to write a .bbappend file that will append to the initramfs-live-boot_1.0.bb which has a statement inside the do_install() that writes the contents of init-live.sh, a shell script that manages the boot procedure, to init, an initialisation script that runs upon boot. The purpose of my .bbappend file is to reference a modified version of the startup script to be copied in place of the original without changing the base openembedded-core and/or poky environments. The .bbappend file and my version of the script is therefore placed in my project directory with the rest of my own recipes to be built.

My initramfs-live-boot_1.0.bbappend looks like this:

SUMMARY = "Replacement recipe"
FILESEXTRAPATH_prepend := "${THISDIR}/files:"
SRC_URI += "file://init.sh"

do_install_append() {
        install -m 0755 ${WORKDIR}/init.sh ${D}/init
}

I have a folder files in the same directory as the .bbappend file that contains the init.sh script it should be reading from.

The problem is when I try to build the image, it spits out this error:

WARNING: Failed to fetch URL file://init.sh, attempting MIRRORS if available

and then attempts to search through the poky directory for the missing files rather than in my project directory.

Have I written my .bbappend file wrong? How would I go about editing the initramfs scripts using the .bbappend file?

1 Answer 1

21

FILESEXTRAPATH_prepend := "${THISDIR}/files:" should be FILESEXTRAPATHS_prepend := "${THISDIR}/files:". Note the last S in FILESEXTRAPATHS.

That should make it work for you.

Another improvement would be to rename you file file from init.sh to init-live.sh. I.e. use the same name as the file in the original initramfs-live-bootrecipe. That would allow you to remove your do_install_append()-function as well as SRC_URI += "file://init.sh" from the bbappend. The recipe itself would handle those for you. Thus, the only line you'd actually need is the FILESEXTRAPATHS_prepend := "${THISDIR}/files:".

3
  • So to clarify, all I need in my .bbappend is FILESEXTRAPATHS_prepend := "${THISDIR}/files:" ?
    – Shiri
    Dec 15, 2015 at 13:52
  • Yes, assuming you name the file init-live.sh, just as the original file.
    – Anders
    Dec 15, 2015 at 13:53
  • Awesome! Thanks for your answer, just tried it out and it hasn't thrown the error.
    – Shiri
    Dec 15, 2015 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.