1
votes

I have a directory like this:

 app
  --bin
  --lib
  --conf
  --data

and compress it into app.tar.gz, how I copy the app.tar.gz to rootfs to as follows:

 bin/*-->/usr/bin
 lib/*--->/usr/lib or /usr/lib64
 conf/*-->/etc
 data/*--->/usr/share
1

1 Answers

1
votes

You want a recipe which takes the tarball (from a SRC_URI) and a do_install function which places the files as needed into ${D}. The recipe will automatically create a package from the files. You can then install that package into the rootfs (e.g. using IMAGE_INSTALL += "").

You could copy the files directly into the rootfs with some kind of post rootfs function however you'd then lose the benefits of package management and manifest tracking of the bill of materials that went into the image and so on. If you really do want to do this, see meta/classes/rootfs-postcommands.bbclass for examples of functions which manipulate the rootfs image.