1

I'm writing a recipe that copies some configuration files over to my image (like a cramfs.conf that goes into /etc/modprobe.d to disable cramfs). Here is the structure of my recipe directory:

.
├── compliance-config.bb
└── configs
    └── fs
        ├── 1-1-1-1-cramfs.conf
        ├── 1-1-1-2-freevxfs.conf
        ...

In my recipe I do the following:

SRC_URI += "file://fs"                                                              
                                                                                    
do_install() {                                                                      
    install -d ${D}${sysconfdir}/modprobe.d/                                        
    install -m 0644 ${WORKDIR}/fs/*.conf ${D}${sysconfdir}/modprobe.d/              
}

This works, but when I change the folder name of fs to something more descriptive (and of course accordingly change the SRC_URI and path in do_install()), it doesn't find the files anymore and gives me (Edit: to clarify, this error happens when I change the directory name from fs to fsconfigs for example, tried different names to make sure I don't accidentally name it in a forbidden way, names like abctest also don't work).

ERROR: compliance-config-1.0-r0 do_fetch: Fetcher failure: Unable to find file file://fsconfigs anywhere. The paths that were searched were:
[...long list of paths...]

So I thought I needed to do a clean build, but running bitbake -c clean <image> or bitbake -fc cleanall <image> beforehand doesn't help.

Why does bitbake not find my files if I change the specified directory?

Clifford
  • 88,407
  • 13
  • 85
  • 165
Brian
  • 117
  • 1
  • 13

1 Answers1

0

This is a better :

.
├── compliance-config.bb
└── files
      ├── 1-1-1-1-cramfs.conf
      ├── 1-1-1-2-freevxfs.conf

Then add SRC_URI += "file://fsconfigs" for instance.

You should know that the default FILESPATH variable is the default set of directories the OpenEmbedded build system uses when searching for patches and files.

The default value for the FILESPATH variable is defined in the base.bbclass as follow :

FILESPATH = "${@base_set_filespath(["${FILE_DIRNAME}/${BP}", \
"${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files"], d)}"

Here ${BP} stand for the base recipe name and your Package Version: ${BPN}-${PV}

If you want the build system to look in directories other than the defaults, the best practiec is to extend the FILESPATH variable by using the FILESEXTRAPATHS variable.

Note that SRC_URI is used to specify files, not directories.

https://docs.yoctoproject.org/ref-manual/variables.html?highlight=filesextrapaths

void_brain
  • 642
  • 2
  • 13
  • The files are in the directory, the example I provided above works, but it doesn't work anymore when I change the directory name, for example from `fs` to `fsconfigs`. I wonder why that is, since even with a clean build it doesn't change. – Brian Feb 14 '23 at 15:19