Open bjurr opened 5 years ago
Hmm, so digging into the code, wic's current behaviour is to use the native sysroot for the image you've built on the assumption that contains everything it needs, but that may only be true when wic is being invoked from within a build (i.e. IMAGE_FSTYPES contains "wic"). To get the full set of tools for running wic from the command line you could build them with bitbake, but I'm not sure that will actually work with current versions of the build system without explicitly telling wic the native sysroot that will contain the tools (which wouldn't be a single path with the instructions given in the manual). I think this is a bug in wic.
@pauleggleton The requirements https://www.yoctoproject.org/docs/2.6/dev-manual/dev-manual.html#wic-requirements do say
Include "wic" as part of the IMAGE_FSTYPES variable
Are you saying even after following all the requirements, it still won't use the native-sysroot?
@bjurr, I'm assuming you have "wic" in your IMAGE_FSTYPES variable?
@rewitt1 I'm using the meta-intel MACHINE intel-corei7-64, which defines IMAGE_FSTYPES += "wic"
Just to be clear, the image.wic is generated properly, but I can't modify it without adding parted
to the container.
Facing the same issue. /opt/graylog-poky/build/tmp/deploy/images/genericx86-64$ wic ls core-image-full-cmdline-genericx86-64-20200707053041.rootfs.wic
ERROR: Can't find executable parted
This is a bug in wic. Ideally it would use the parted that exists in the native-sysroot, but it doesn't.
There is actually an argument for wic to specify the sysroot but it didn't work by default either:
$ wic ls -n tmp/sysroots-components/x86_64/parted-native tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic
ERROR: _exec_cmd: tmp/sysroots-components/x86_64/parted-native/usr/sbin/parted -sm tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic unit B print returned '127' instead of 0
output: tmp/sysroots-components/x86_64/parted-native/usr/sbin/parted: error while loading shared libraries: libreadline.so.8: cannot open shared object file: No such file or directory
However, I was able to get it to work by using LD_LIBRARY_PATH
$ LD_LIBRARY_PATH=tmp/sysroots-components/x86_64/readline-native/usr/lib/ wic ls -n tmp/sysroots-components/x86_64/parted-native tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic
Num Start End Size Fstype
1 1048576 26757119 25708544 fat16
2 27262976 53168127 25905152 ext4
This shouldn't be necessary. If I file a bug against wic, I'll update this issue. If anyone else does, please feel free to do the same.
wic ls -n tmp/sysroots-components/x86_64/parted-native tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic
I had some luck pointing wic to the recipe-sysroot-native directory build for wic-tools. Not sure why it doesn't use this by default.
$ wic ls -n tmp/work/armv7at2hf-neon-linux-gnueabi/wic-tools/1.0-r0/recipe-sysroot-native tmp/deploy/images/mitysom-am57x/arago-base-tisdk-image-mitysom-am57x.wic
Num Start End Size Fstype
1 4096 21814271 21810176 fat16
2 21815296 455231487 433416192 ext4
Hi @rewitt1,
If I file a bug against wic, I'll update this issue.
Just wondering if you did file such a bug?
FWIW, the -n tmp/sysroots-components/x86_64/parted-native
option worked for me.
Using the ubuntu-16.04 image, I noticed that some (all?) wic commands fail because of the dependency on parted:
Manually adding
parted
to the list of installed packages seems to fix the issue, but I'm unsure if this is really the way to go since the requirements listed in the Yocto Dev Manual states that parted should be built through bitbake?https://www.yoctoproject.org/docs/2.6/dev-manual/dev-manual.html#wic-requirements