Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run some wic commands #30

Open
bjurr opened this issue Nov 28, 2018 · 7 comments
Open

Cannot run some wic commands #30

bjurr opened this issue Nov 28, 2018 · 7 comments
Assignees

Comments

@bjurr
Copy link

bjurr commented Nov 28, 2018

Using the ubuntu-16.04 image, I noticed that some (all?) wic commands fail because of the dependency on parted:

pokyuser@edc7b75281c4:/workdir/poky/build/tmp/deploy/images/intel-corei7-64$ wic ls core-image-sato-intel-corei7-64.wic

ERROR: Can't find executable 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

$ bitbake parted-native dosfstools-native mtools-native
@pauleggleton-intel
Copy link

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.

@rewitt1
Copy link
Contributor

rewitt1 commented Nov 29, 2018

@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?

@bjurr
Copy link
Author

bjurr commented Nov 29, 2018

@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.

@SrijanNandi
Copy link

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

@rewitt1
Copy link
Contributor

rewitt1 commented Jul 9, 2020

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.

@jjcf89
Copy link

jjcf89 commented Aug 6, 2020

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

@DavidAntliff
Copy link

DavidAntliff commented Sep 7, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants