Thanks Nayfe & danlor, Now I can add(copy)/touch files into other Yocto rootfs, my recipe is shown below:
# Test copy a file to rootfs - WPI Eric Fan
DESCRIPTION = "Hello World eric test"
LICENSE = "CLOSED"
PV = "0.9453"
PR = "r0.9487"
#my test envirement WORKDIR="/home/eric/s32v_yocto_bsp/build_s32v234evb/tmp/work/aarch64-fsl-linux/eric0.9453-r0.9487/"
do_install(){
install -d lib/erictest/94539487
install -m 0644 /home/eric/liberictest.so lib/
touch lib/libtouchtest.so
cp --no-preserve=ownership /home/eric/libericcptest.so lib/
}
Now I tried to do the same thing on my real Yocto project(fsl-image-auto), but it didn't work and have some error message...
ERROR: linux-s32-4.14-r0 do_package: QA Issue: linux-s32: Files/directories were installed but not shipped in any package:
/lib/libericcptest.so
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
linux-s32: 1 installed and not shipped files. [installed-vs-shipped]
ERROR: linux-s32-4.14-r0 do_package: Fatal QA errors found, failing task.
ERROR: linux-s32-4.14-r0 do_package: Function failed: do_package
ERROR: Logfile of failure stored in: /home/eric.fan/s32v_yocto_bsp/build_s32v234evb/tmp/work/s32v234evb-fsl-linux/linux-s32/4.14-r0/temp/log.do_package.5942
ERROR: Task (/home/eric.fan/s32v_yocto_bsp/sources/meta-alb/recipes-kernel/linux/linux-s32_4.14.bb:do_package) failed with exit code '1'
externalsrc
as explained in manual – Nayfe