7

How could we add some additional kernel files to sysroot directory? I want to extend do_populate_sysroot task, how can we to copy few more files into sysroot after do_populate_sysroot and before do_package? I tried to create do_populate_sysroot_append() in recipe but it is getting parsing error. How could we add file in sysroot after populate_sysroot and before do_package task starts? How can we create new task in between?

Metacarpus
  • 15
  • 4
Vivek
  • 181
  • 3
  • 10

3 Answers3

6

do_populate_sysroot is a python function so if you append it with shell then parse errors are to be expected.

If you want to stage more files then you can either append sysroot_stage_all or write a function that calls sysroot_stage_dir and add it to SYSROOT_PREPROCESS_FUNCS.

There are examples of both of these methods in oe-core.

Metacarpus
  • 15
  • 4
Ross Burton
  • 3,516
  • 13
  • 12
2

Based on the answer of @ross-burton I searched for recipes that append to sysroot_stage_all and found for instance poky/meta/recipes-core/meta/signing-keys.bb.

Anyway this is useful if you have a package which packages files in a non-standard directory in the sys root directory and a depending package needs to access these files.

Adding something of the style below accomplishes the task for me.

sysroot_stage_all_append () {                                     
    sysroot_stage_dir ${D}${sysconfdir}/pki ${SYSROOT_DESTDIR}${sysconfdir}/pki
}   
Paulo Neves
  • 1,096
  • 14
  • 22
2

modify the "SYSROOT_DIRS" variable in your kernel recipe would be a easy soultion,

SYSROOT_DIRS += "${localstatedir}"

with the above change, the "var" directory will also be copied to sysroot.

https://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#var-SYSROOT_DIRS

Ted Feng
  • 829
  • 1
  • 17
  • 22