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

util: add fiemap fallback for errno ENOTTY #116

Conversation

pseiderer
Copy link
Contributor

Using genimage (for buildroot) on Ubuntu-20.04.1 on WSL fails
with (see [1] for details):

ERROR: hdimage(sdcard.img): fiemap .../buildroot-2020.08-rc1/images/boot.vfat: 25 Inappropriate ioctl for device

This is because the fiemap ioctl sets errno to ENOTTY instead of the
expected EOPNOTSUPP.

[1] https://bugs.busybox.net/show_bug.cgi?id=13146

Signed-off-by: Peter Seiderer ps.report@gmx.net

@yann-morin-1998
Copy link

yann-morin-1998 commented Aug 12, 2020

Using genimage (for buildroot) on Ubuntu-20.04.1 on WSL fails

Note: this is on WSL 1, not 2.

fiemap ioctl sets errno to ENOTTY

This is misleading: this only happen on WSL-1, not on a well-behaved system, so a better phrasing would be:

On WSL-1, genimage fails with:

    ERROR: hdimage(sdcard.img): fiemap .../boot.vfat: 25 Inappropriate ioctl for device

This is because WSL-1 is a limited Linux emulation layer, where the fiemap ioctl
incorrectly returns ENOTTY instead of EOPNOTSUPP.

No, I am not sure this is a good idea to add this workaround, because ENOTTY
really is not the correct error code.

Also, is supporting WSL-1 a good idea, when it is known to have quite some
limitations that have been lifted with WSL-2) and that do not happen with a
real Linux-based system) ?

@michaelolbrich
Copy link
Member

The patch quite simple, so I think it's acceptable in general, but the commit message should be modified as suggested.

On WSL-1, genimage fails with (see [1] for details):

  ERROR: hdimage(sdcard.img): fiemap .../boot.vfat: 25 Inappropriate ioctl for device

This is because WSL-1 is a limited Linux emulation layer, where the fiemap
ioctl incorrectly returns ENOTTY instead of the expected EOPNOTSUPP.

[1] https://bugs.busybox.net/show_bug.cgi?id=13146

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Changes v1 -> v2:
  - improved commit message (according to suggestion by Yann E. MORIN)
@pseiderer pseiderer force-pushed the ps-devel-genimage-ubuntu-20.04.1-wsl-001 branch from 437a318 to 4c2b02d Compare August 17, 2020 20:27
@michaelolbrich michaelolbrich merged commit a6b8a45 into pengutronix:master Nov 20, 2020
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

Successfully merging this pull request may close these issues.

None yet

3 participants