[yocto] Problem add and removing files to filesystem
Esponde, Joel
Joel.Esponde at Honeywell.com
Wed Feb 17 08:55:35 PST 2016
> On Mon Jul 27 10:53:36 PDT 2015, Lorin Vandegrift vandegriftlorin at gmail.com wrote:
>
> Hi there,
>
> Thanks for the response. Unfortunately we tried your suggestions with no
> luck. Below is the bb file for our package, do you see anything that we
> might of missed? The tar ball listed below is in a subdirectory called
> "files" in the same folder as the bb file.
>
> Thanks
>
> SUMMARY = "Extra filesystem files"
> SECTION = "rootfs"
> LICENSE = "CLOSED"
>
> SRC_URI = "file://extrafiles.tar.gz"
> S = "${WORKDIR}/files"
>
> ROOTFS_POSTPROCESS_COMMAND += "set_root_passwd;"
> ROOTFS_POSTPROCESS_COMMAND += "modify_filesystem;"
>
> do_install() {
> install -m 0755 testFile.sh ${D}/home/root
> rsync -avz wpa_supplicant ${D}${sysconfdir}
> rsync -avz root ${D}${sysconfdir}
> rsync -avz network ${D}${sysconfdir}
> rsync -avz test.txt ${D}${sysconfdir}
> rsync -avz syslog.conf ${D}${sysconfdir}
> rsync -avz rules.d ${D}${sysconfdir}/udev/
> rsync -avz sys_init.service ${D}${sysconfdir}/system/
> }
>
> modify_filesystem() {
> rm ${IMAGE_ROOTFS}${sysconfdir}/wpa_supplicant.conf;
> }
>
> set_root_passwd() {
> sed 's%^root:[^:]*:%root:$1$xyz$KSp5j8kx3cPgA3/ODPZ6E.:%' \
> < ${IMAGE_ROOTFS}/etc/shadow \
> > ${IMAGE_ROOTFS}/etc/shadow.new;
> mv ${IMAGE_ROOTFS}/etc/shadow.new ${IMAGE_ROOTFS}/etc/shadow ;
> }
>
> EXTRA_IMAGE_FEATURES += "read-only-rootfs"
Hi,
I guess my answer will happen too late but it may be useful for other devs asking themselves the same question.
I faced the same issue today and at the end I managed to solve it by moving ROOTFS_POSTPROCESS_COMMAND directive and corresponding functions to the image's recipe.
There is a way to check if ROOTFS_POSTPROCESS_COMMAND is correctly set without having to build the image.
First call bitbake with the -e option and store the result in a file:
bitbake core-image-minimal -e > core-image-minimal.env
Then edit core-image-minimal.env file, search for ROOTFS_POSTPROCESS_COMMAND variable and check that it has your function(s) in the list.
You can also check that the body of your functions are correctly set in the environment.
Joël
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20160217/8beef216/attachment.html>
More information about the yocto
mailing list