diff options
| author | Peter Seiderer <ps.report@gmx.net> | 2020-08-12 21:10:36 +0200 |
|---|---|---|
| committer | Peter Seiderer <ps.report@gmx.net> | 2020-08-17 22:22:48 +0200 |
| commit | 4c2b02df0861e06ca9320d80ad60994d4a239ad6 (patch) | |
| tree | 93bba58d462b6e1a10293a57518a7677c0e66ac5 | |
| parent | 5086ffd2e396a75235c019de4e5ff94a87f66ea9 (diff) | |
| download | genimage-4c2b02df0861e06ca9320d80ad60994d4a239ad6.tar.gz genimage-4c2b02df0861e06ca9320d80ad60994d4a239ad6.tar.xz | |
util: add fiemap fallback for errno ENOTTY
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)
| -rw-r--r-- | util.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -387,7 +387,7 @@ err_out: free(fiemap); /* If failure is due to no filesystem support, return a single extent */ - if (ret == -EOPNOTSUPP) + if (ret == -EOPNOTSUPP || ret == -ENOTTY) return whole_file_exent(size, extents, extent_count); image_error(image, "fiemap %s: %d %s\n", filename, errno, strerror(errno)); |
