Files copied to /usr/local during installation get removed misteriously
Hi,
I have a recipe that creates some directories in /usr/local and copies there some files using do_install:append
Quoted 11 lines
inherit qmake5
OE_QMAKE_PATH_HEADERS= "${OE_QMAKE_PATH_QT_HEADERS}" DEPENDS += "qtbase qtdeclarative qtmultimedia libgpiod"RDEPENDS:${PN} += "qtxmlpatterns qtdeclarative-qmlplugins qtbase-plugins ttf-dejavu-sans qtquickcontrols qtquickcontrols2 qtfreevirtualkeyboard libgpiod valgrind
Quoted 14 lines
do_install:append () {
install -d ${D}${bindir}
install -d ${D}/usr/local/test
install -m 0775qt_test${D}${bindir}
install -m 0775 ${S}/test.db ${D}/usr/local/test cp -r ${WORKDIR}/Resources ${D}/usr/local/test/resources cp -r ${WORKDIR}/LocalFiles ${D}/usr/local/test/LocalFiles }
FILES:${PN} += "${bindir}/qt_test"
FILES:${PN} += "/opt/*"
FILES:${PN} += "/usr/local/test/*"
When I build the image, I see the folders appear in /usr/local as expected while creating the rootfs but at some point they are removed and, by the time the rootfs creation finishes, they are gone.
If I take the ipk package and install it on the embedded device the folders and files are created correctly so I guess that the recipe is fine but there is some task during the rootfs creation that deletes all the files in /usr/local (my folders are not the only ones that are deleted).
Who could be doing that or how can I debug it to find the culprit?
Kind regards,
Javi
Any help on this?
Quoted 18 lines · Javier Casas Marín
Hi,
I have a recipe that creates some directories in/usr/localand copies there some files using do_install:appendinherit qmake5
OE_QMAKE_PATH_HEADERS= "${OE_QMAKE_PATH_QT_HEADERS}" DEPENDS += "qtbase qtdeclarative qtmultimedia libgpiod"RDEPENDS:${PN} += "qtxmlpatterns qtdeclarative-qmlplugins qtbase-plugins ttf-dejavu-sans qtquickcontrols qtquickcontrols2 qtfreevirtualkeyboard libgpiod valgrind
do_install:append () {
install -d ${D}${bindir}
install -d ${D}/usr/local/test
install -m 0775qt_test${D}${bindir}
install -m 0775 ${S}/test.db ${D}/usr/local/testcp -r ${WORKDIR}/Resources ${D}/usr/local/test/resources cp -r ${WORKDIR}/LocalFiles ${D}/usr/local/test/LocalFiles }
Quoted 8 lines
FILES:${PN} += "${bindir}/qt_test"
FILES:${PN} += "/opt/*"
FILES:${PN} += "/usr/local/test/*"When I build the image, I see the folders appear in
/usr/localas expected while creating the rootfs but at some point they are removed and, by the time the rootfs creation finishes, they are gone.
If I take the ipk package and install it on the embedded device the folders and files are created correctly so I guess that the recipe is fine but there is some task during the rootfs creation that deletes all the files in/usr/local(my folders are not the only ones that are deleted).Who could be doing that or how can I debug it to find the culprit?
There could be a rootfs postprocessing task which could be involked after rootfs generation to do such tweaks. Look for what you have in ROOTFS_POSTPROCESS_COMMAND variable.
Quoted 17 lines
Kind regards,
Javi-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
You automatically follow any topics you start or reply to. View/Reply Online (#61649): https://lists.yoctoproject.org/g/yocto/message/61649
Mute This Topic: https://lists.yoctoproject.org/mt/102502363/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Just in case someone has the same problem, it is the do_userfs function the one that deletes /usr/local directories and files after copying them to ${image_userfs}:
cp -r /build/tmp/work/kontron_mx8mm-ked-linux/image-ked-qt/1.0-r0/rootfs${image_userfs_dir}/* ${image_userfs} rm -rf /build/tmp/work/kontron_mx8mm-ked-linux/image-ked-qt/1.0-r0/rootfs${image_userfs_dir}/*
I have changed the installation folder to /opt that seems more appropiate
Thanks
Quoted 5 lines · Javier Casas Marín via lists.yoctoproject.org
Just in case someone has the same problem, it is the
do_userfsfunction the one that deletes/usr/localdirectories and files after copying them to ${image_userfs}:cp -r /build/tmp/work/kontron_mx8mm-ked-linux/image-ked-qt/1.0-r0/rootfs${image_userfs_dir}/* ${image_userfs} rm -rf /build/tmp/work/kontron_mx8mm-ked-linux/image-ked-qt/1.0-r0/rootfs${image_userfs_dir}/*
Where is do_userfs defined? It’s not part of oe-core…
Ross
It is in run.do_userfs. I saw that the files where removed while do_image_userfs task was running so I looked at the image logs in temp directory and found it there
Quoted 2 lines · Javier Casas Marín via lists.yoctoproject.org
It is in run.do_userfs. I saw that the files where removed while
do_image_userfstask was running so I looked at the image logs in temp directory and found it there
Sure but _where_ does that come from?
This is the generic yocto channel, and this isn’t a standard part of Yocto:
~/Yocto/openembedded-core (master) $ git grep do_userfs ~/Yocto/openembedded-core (master) $
A bit of googling reveals this to be meta-ktn value-add. I suggest you tell them that this class should be documented more obviously so that yuo don’t waste time trying to figure out why your files are disappearing.
Ross
you are right, it is defined in layers/meta-ked/classes/userfs.bbclass I didn't consider that it could be something added by a custom layer but it is, as you said. I'll have a loot at it.
Thanks for the clarification
Javi