The same error has been reported here: https://www.yoctoproject.org/pipermail/yocto/2019-July/046023.html The proposed solution / workaround of renaming wks to wks.in doesn't work for me and isn't documented. Description: It should be possible to use the --rootfs-dir= parameter to specify a subtree as root of the partition. This works if an absolute path is provided, but not if the IMAGE_ROOTFS variable is used like this: part /opt/app --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/opt/app This usage is shown also in: https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/scripts/lib/wic/canned-wks/efi-bootdisk.wks.in?h=dunfell#n2 but it doesn't seem to (always?) work, as reported here are well: https://www.yoctoproject.org/pipermail/yocto/2018-November/043184.html When the __get_rootfs_dir function gets called, the rootfs_dir variable is not expanded, its value is for example: ${IMAGE_ROOTFS}/opt/app https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/scripts/lib/wic/plugins/source/rootfs.py?h=dunfell#n70 https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/scripts/lib/wic/plugins/source/rootfs.py?h=dunfell#n39 and then misc.get_var looks for a unexpanded path: ... /imgdata/${IMAGE_ROOTFS}/opt/app.env https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/scripts/lib/wic/misc.py?h=dunfell#n199
Ricardo, we wondered if you had any insight into this?
variables can only be used on .wks.in files, and they have to be run by bitbake NOT by wic. The wks.in to wks conversion is done by bitbake on https://git.openembedded.org/openembedded-core/tree/meta/classes/image_types_wic.bbclass#n62 If you were to use directly wic you cannot add any variable. BUT, there is an alternative, since https://git.openembedded.org/openembedded-core/commit/?id=2265d089a58e1f78f26d623ee667c420cb1c3bd4 You can use this syntax: part / --source rootfs --ondisk sda --fstype=ext4 --exclude-path=etc/ part /etc --source rootfs --fstype=ext4 --change-directory=etc It is compatible with both bitbake and wic and keep the right permissions on the destination folder. I would suggest to check if there is other usercase for wks.in than expanding ${IMAGE_ROOTFS}, because if that is the case I would suggest to deprecate it, as now we have a better solution.
Diego, do you need more help regarding this? Can I close the issue?
(In reply to comment #3) > Diego, do you need more help regarding this? Can I close the issue? Thank you Ricardo, I got confused by the wks.in vs wks.inc subtle but substantial difference: the main wks file referenced by the WKS_FILE var should actually be a "wks.in". I think that the only missing thing is a bit of documentation in the manual.
Thanks, I close this bug then.