How to add a folder or file to the root in a recipe with a bitback?

I am trying to put a folder in the root of the file system. In the documentation (for example, here ) they use mainly variables, therefore files and folders from SRC_URI lead to saving in /usr/bin or something but never in / .

So here is my recipe:

 DESCRIPTION = "Example for adding files and folders to rootfs" SRC_URI += "file://example_folder" SRC_URI += "file://example_file" LICENSE = [...] do_install() { install -d ${D}/rootfolder cp -r ${WORKDIR}/example_folder ${D]/rootfolder/ install -m 0755 ${WORKDIR}/example_file ${D}/rootfolder } 

This is just one of the many do_install options I've tried. Each of them led either to Error: example not found in the base feeds [...] , or to files and folders was not placed in the root directory, but in /usr/bin , as described above.

+5
source share
1 answer

In cases where you received the error "Error: the example was not found in the base feeds [...]", it is likely that you really managed to create the recipe example.bb. Assuming, of course, that you get this error when creating your image that has IMAGE_INSTALL += "example" .

If you install your files in /rootfolder , there is nothing in OE who knows how to pack these files into rpm , ipk or deb package. You should add this to your recipe by adding a line, for example: FILES_${PN} += "/rootfolder" By doing this, your example above should work.

Depending on what files you are installing, you may add some of them to other packages, such as ${PN}-dbg , ${PN}-dev , etc.

+9
source

Source: https://habr.com/ru/post/1236780/


All Articles