pengutronix / genimage

tool to generate multiple filesystem and flash images from a tree
GNU General Public License v2.0
308 stars 110 forks source link

util: add fiemap fallback for errno ENOTTY #116

Closed pseiderer closed 3 years ago

pseiderer commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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