Search code examples
gdbyoctobitbake

yocto: Add .gdbinit in build while building gdb


I'm trying to add a .gdbinit file into /home/root of my filesystem while building gdb.

I made this bbappend file : gdb_8.0.bbappend

PACKAGECONFIG_append  = " python"

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" 
SRC_URI += "file://.gdbinit"

FILES_${PN} += "/home/root/*"

do_install_append() {        
    install -d ${D}/home/root        
    install -m 0755 ${WORKDIR}/.gdbinit ${D}/home/root/.gdbinit       
}

However, when building, I get this error :

ERROR: gdb-8.0-r0 do_package: QA Issue: gdb: Files/directories were installed but not shipped in any package:
  /home
  /home/root
  /home/root/.gdbinit
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
gdb: 3 installed and not shipped files. [installed-vs-shipped]

I can't understand why the file is not shipped.
I definitively missing something, do you have any inputs ?

Thank you !


Solution

  • The wildcard doesn't match hidden files. It is similar to shell. Just run ls in your home directory, hidden files won't be listed. So the best way is:

    FILES_${PN} += "/home/root/.gdbinit"
    

    I've tested and the /home/root/.* wildcard also works, but it matches parent directory (..) in shell. It doesn't match parent directory in OpenEmbedded, but I wouldn't use it anyway.

    BTW, I would also think about separate recipe for the configuration.