All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH/2021.2 v1] package/genimage: fix for WSL (Windows-Subsystem for Linux)
@ 2021-03-10 19:16 Peter Seiderer
  2021-03-10 22:33 ` Yann E. MORIN
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Peter Seiderer @ 2021-03-10 19:16 UTC (permalink / raw)
  To: buildroot

- add upstream patch ([1]) to fix usage with WSL (Windows-Subsystem for Linux)

Fixes:

  - https://bugs.busybox.net/show_bug.cgi?id=13146
  - https://bugs.busybox.net/show_bug.cgi?id=13601

  ERROR: hdimage(sdcard.img): fiemap .../images/boot.vfat: 25 Inappropriate ioctl for device
  ERROR: hdimage(sdcard.img): failed to write image partition 'boot'

[1] https://github.com/pengutronix/genimage/commit/4c2b02df0861e06ca9320d80ad60994d4a239ad6.patch

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
 ...add-fiemap-fallback-for-errno-ENOTTY.patch | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 package/genimage/0001-util-add-fiemap-fallback-for-errno-ENOTTY.patch

diff --git a/package/genimage/0001-util-add-fiemap-fallback-for-errno-ENOTTY.patch b/package/genimage/0001-util-add-fiemap-fallback-for-errno-ENOTTY.patch
new file mode 100644
index 0000000000..4ce91ed19b
--- /dev/null
+++ b/package/genimage/0001-util-add-fiemap-fallback-for-errno-ENOTTY.patch
@@ -0,0 +1,37 @@
+From 6b61b55807fdce5d09ea470e7b5c8ca1e40f724f Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Wed, 12 Aug 2020 21:10:36 +0200
+Subject: [PATCH] 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>
+[From https://github.com/pengutronix/genimage/commit/4c2b02df0861e06ca9320d80ad60994d4a239ad6.patch]
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+ util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util.c b/util.c
+index 381c5d9..2dcf396 100644
+--- a/util.c
++++ b/util.c
+@@ -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));
+-- 
+2.30.1
+
-- 
2.30.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH/2021.2 v1] package/genimage: fix for WSL (Windows-Subsystem for Linux)
  2021-03-10 19:16 [Buildroot] [PATCH/2021.2 v1] package/genimage: fix for WSL (Windows-Subsystem for Linux) Peter Seiderer
@ 2021-03-10 22:33 ` Yann E. MORIN
  2021-03-14 22:19 ` Thomas Petazzoni
  2021-04-07  9:07 ` Peter Korsgaard
  2 siblings, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2021-03-10 22:33 UTC (permalink / raw)
  To: buildroot

Peter, Peter, All,

On 2021-03-10 20:16 +0100, Peter Seiderer spake thusly:
> - add upstream patch ([1]) to fix usage with WSL (Windows-Subsystem for Linux)
> 
> Fixes:
> 
>   - https://bugs.busybox.net/show_bug.cgi?id=13146
>   - https://bugs.busybox.net/show_bug.cgi?id=13601
> 
>   ERROR: hdimage(sdcard.img): fiemap .../images/boot.vfat: 25 Inappropriate ioctl for device
>   ERROR: hdimage(sdcard.img): failed to write image partition 'boot'
> 
> [1] https://github.com/pengutronix/genimage/commit/4c2b02df0861e06ca9320d80ad60994d4a239ad6.patch
> 
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>

Acked-by: Yann E. MORIN <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  ...add-fiemap-fallback-for-errno-ENOTTY.patch | 37 +++++++++++++++++++
>  1 file changed, 37 insertions(+)
>  create mode 100644 package/genimage/0001-util-add-fiemap-fallback-for-errno-ENOTTY.patch
> 
> diff --git a/package/genimage/0001-util-add-fiemap-fallback-for-errno-ENOTTY.patch b/package/genimage/0001-util-add-fiemap-fallback-for-errno-ENOTTY.patch
> new file mode 100644
> index 0000000000..4ce91ed19b
> --- /dev/null
> +++ b/package/genimage/0001-util-add-fiemap-fallback-for-errno-ENOTTY.patch
> @@ -0,0 +1,37 @@
> +From 6b61b55807fdce5d09ea470e7b5c8ca1e40f724f Mon Sep 17 00:00:00 2001
> +From: Peter Seiderer <ps.report@gmx.net>
> +Date: Wed, 12 Aug 2020 21:10:36 +0200
> +Subject: [PATCH] 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>
> +[From https://github.com/pengutronix/genimage/commit/4c2b02df0861e06ca9320d80ad60994d4a239ad6.patch]
> +Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> +---
> + util.c | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/util.c b/util.c
> +index 381c5d9..2dcf396 100644
> +--- a/util.c
> ++++ b/util.c
> +@@ -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));
> +-- 
> +2.30.1
> +
> -- 
> 2.30.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH/2021.2 v1] package/genimage: fix for WSL (Windows-Subsystem for Linux)
  2021-03-10 19:16 [Buildroot] [PATCH/2021.2 v1] package/genimage: fix for WSL (Windows-Subsystem for Linux) Peter Seiderer
  2021-03-10 22:33 ` Yann E. MORIN
@ 2021-03-14 22:19 ` Thomas Petazzoni
  2021-03-14 22:43   ` Peter Seiderer
  2021-04-07  9:07 ` Peter Korsgaard
  2 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2021-03-14 22:19 UTC (permalink / raw)
  To: buildroot

Hello Peter,

On Wed, 10 Mar 2021 20:16:51 +0100
Peter Seiderer <ps.report@gmx.net> wrote:

> - add upstream patch ([1]) to fix usage with WSL (Windows-Subsystem for Linux)
> 
> Fixes:
> 
>   - https://bugs.busybox.net/show_bug.cgi?id=13146
>   - https://bugs.busybox.net/show_bug.cgi?id=13601
> 
>   ERROR: hdimage(sdcard.img): fiemap .../images/boot.vfat: 25 Inappropriate ioctl for device
>   ERROR: hdimage(sdcard.img): failed to write image partition 'boot'
> 
> [1] https://github.com/pengutronix/genimage/commit/4c2b02df0861e06ca9320d80ad60994d4a239ad6.patch
> 
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>

You tagged this patch 2021.02. Does this mean that:

 - It should be applied *only* for 2021.02, and not master? If so, for
   what reason?

 - It should be applied to both 2021.02 and master ?

Thanks for having investigated this, just this week, I had a
participant to my training course running under WSL2 who faced exactly
that issue.

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH/2021.2 v1] package/genimage: fix for WSL (Windows-Subsystem for Linux)
  2021-03-14 22:19 ` Thomas Petazzoni
@ 2021-03-14 22:43   ` Peter Seiderer
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Seiderer @ 2021-03-14 22:43 UTC (permalink / raw)
  To: buildroot

Hello Thomas,

On Sun, 14 Mar 2021 23:19:51 +0100, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:

> Hello Peter,
>
> On Wed, 10 Mar 2021 20:16:51 +0100
> Peter Seiderer <ps.report@gmx.net> wrote:
>
> > - add upstream patch ([1]) to fix usage with WSL (Windows-Subsystem for Linux)
> >
> > Fixes:
> >
> >   - https://bugs.busybox.net/show_bug.cgi?id=13146
> >   - https://bugs.busybox.net/show_bug.cgi?id=13601
> >
> >   ERROR: hdimage(sdcard.img): fiemap .../images/boot.vfat: 25 Inappropriate ioctl for device
> >   ERROR: hdimage(sdcard.img): failed to write image partition 'boot'
> >
> > [1] https://github.com/pengutronix/genimage/commit/4c2b02df0861e06ca9320d80ad60994d4a239ad6.patch
> >
> > Signed-off-by: Peter Seiderer <ps.report@gmx.net>
>
> You tagged this patch 2021.02. Does this mean that:
>
>  - It should be applied *only* for 2021.02, and not master? If so, for
>    what reason?

On master genimage version is already bumped to 14 (containing the
upstream patch already)..., on 2021.02 genimage is still on version
13...

Regards,
Peter

>
>  - It should be applied to both 2021.02 and master ?
>
> Thanks for having investigated this, just this week, I had a
> participant to my training course running under WSL2 who faced exactly
> that issue.
>
> Best regards,
>
> Thomas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH/2021.2 v1] package/genimage: fix for WSL (Windows-Subsystem for Linux)
  2021-03-10 19:16 [Buildroot] [PATCH/2021.2 v1] package/genimage: fix for WSL (Windows-Subsystem for Linux) Peter Seiderer
  2021-03-10 22:33 ` Yann E. MORIN
  2021-03-14 22:19 ` Thomas Petazzoni
@ 2021-04-07  9:07 ` Peter Korsgaard
  2 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2021-04-07  9:07 UTC (permalink / raw)
  To: buildroot

>>>>> "Peter" == Peter Seiderer <ps.report@gmx.net> writes:

 > - add upstream patch ([1]) to fix usage with WSL (Windows-Subsystem for Linux)
 > Fixes:

 >   - https://bugs.busybox.net/show_bug.cgi?id=13146
 >   - https://bugs.busybox.net/show_bug.cgi?id=13601

 >   ERROR: hdimage(sdcard.img): fiemap .../images/boot.vfat: 25 Inappropriate ioctl for device
 >   ERROR: hdimage(sdcard.img): failed to write image partition 'boot'

 > [1] https://github.com/pengutronix/genimage/commit/4c2b02df0861e06ca9320d80ad60994d4a239ad6.patch

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

Committed to 2021.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-07  9:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 19:16 [Buildroot] [PATCH/2021.2 v1] package/genimage: fix for WSL (Windows-Subsystem for Linux) Peter Seiderer
2021-03-10 22:33 ` Yann E. MORIN
2021-03-14 22:19 ` Thomas Petazzoni
2021-03-14 22:43   ` Peter Seiderer
2021-04-07  9:07 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.