mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Regression in automount between 2021.07.0 and 2022.05.0
@ 2022-07-12 16:45 Uwe Kleine-König
  2022-07-14  7:53 ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2022-07-12 16:45 UTC (permalink / raw)
  To: barebox

[-- Attachment #1: Type: text/plain, Size: 1732 bytes --]

Hello,

while updating barebox from 2021.07.0 to 2022.05.0 I hit a regression:

The behaviour of 2022.05.0 looks as follows:

	bootloader: automount -d /mnt/usbstorage 'usb && if [ -e /dev/disk0.0 ]; then mount /dev/disk0.0 /mnt/usbstorage; elif [ -e /dev/disk0 ]; then mount /dev/disk0 /mnt/usbstorage; fi'
	bootloader: ls /mnt/usbstorage/

Without an USB drive this hangs until the watchdog resets the board. I
guess the problem is that the automount script is called again and again
because nothing was mounted.

I can workaround that problem by doing:

	bootloader: automount -d /mnt/usbstorage 'usb && if [ -e /dev/disk0.0 ]; then mount /dev/disk0.0 /mnt/usbstorage; elif [ -e /dev/disk0 ]; then mount /dev/disk0 /mnt/usbstorage; else false; fi'
	bootloader: ls /mnt/usbstorage/
	running automount command 'usb && if [ -e /dev/disk0.0 ]; then mount /dev/disk0.0 /mnt/usbstorage; elif [ -e /dev/disk0 ]; then mount /dev/disk0 /mnt/usbstorage; else false; fi' failed
	ls: /mnt/usbstorage/: No such device
	running automount command 'usb && if [ -e /dev/disk0.0 ]; then mount /dev/disk0.0 /mnt/usbstorage; elif [ -e /dev/disk0 ]; then mount /dev/disk0 /mnt/usbstorage; else false; fi' failed

but there is still something non-optimal.

I can look into that, but I'm not entirely sure what the right behaviour
is.

Should a command that doesn't mount something considered to have failed?
(I think that's how it was with 2021.07.0.)

Even when making the command fail, it's run twice, is this worth
investigating/fixing?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: Regression in automount between 2021.07.0 and 2022.05.0
  2022-07-12 16:45 Regression in automount between 2021.07.0 and 2022.05.0 Uwe Kleine-König
@ 2022-07-14  7:53 ` Sascha Hauer
  2022-07-14 16:45   ` Uwe Kleine-König
  0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2022-07-14  7:53 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: barebox

On Tue, Jul 12, 2022 at 06:45:10PM +0200, Uwe Kleine-König wrote:
> Hello,
> 
> while updating barebox from 2021.07.0 to 2022.05.0 I hit a regression:
> 
> The behaviour of 2022.05.0 looks as follows:
> 
> 	bootloader: automount -d /mnt/usbstorage 'usb && if [ -e /dev/disk0.0 ]; then mount /dev/disk0.0 /mnt/usbstorage; elif [ -e /dev/disk0 ]; then mount /dev/disk0 /mnt/usbstorage; fi'
> 	bootloader: ls /mnt/usbstorage/
> 
> Without an USB drive this hangs until the watchdog resets the board. I
> guess the problem is that the automount script is called again and again
> because nothing was mounted.

I just tried 2021.07.0 and the behaviour seems to be the same. I don't
think it's a regression.

automount -d /mnt/foo true
ls /mnt/foo

makes barebox hang. That shouldn't happen of course.

> 
> I can workaround that problem by doing:
> 
> 	bootloader: automount -d /mnt/usbstorage 'usb && if [ -e /dev/disk0.0 ]; then mount /dev/disk0.0 /mnt/usbstorage; elif [ -e /dev/disk0 ]; then mount /dev/disk0 /mnt/usbstorage; else false; fi'
> 	bootloader: ls /mnt/usbstorage/
> 	running automount command 'usb && if [ -e /dev/disk0.0 ]; then mount /dev/disk0.0 /mnt/usbstorage; elif [ -e /dev/disk0 ]; then mount /dev/disk0 /mnt/usbstorage; else false; fi' failed
> 	ls: /mnt/usbstorage/: No such device
> 	running automount command 'usb && if [ -e /dev/disk0.0 ]; then mount /dev/disk0.0 /mnt/usbstorage; elif [ -e /dev/disk0 ]; then mount /dev/disk0 /mnt/usbstorage; else false; fi' failed
> 
> but there is still something non-optimal.
> 
> I can look into that, but I'm not entirely sure what the right behaviour
> is.
> 
> Should a command that doesn't mount something considered to have failed?
> (I think that's how it was with 2021.07.0.)

That sounds promising.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

* Re: Regression in automount between 2021.07.0 and 2022.05.0
  2022-07-14  7:53 ` Sascha Hauer
@ 2022-07-14 16:45   ` Uwe Kleine-König
  0 siblings, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2022-07-14 16:45 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

[-- Attachment #1: Type: text/plain, Size: 673 bytes --]

Hello Sascha,

On Thu, Jul 14, 2022 at 09:53:36AM +0200, Sascha Hauer wrote:
> On Tue, Jul 12, 2022 at 06:45:10PM +0200, Uwe Kleine-König wrote:
> > Should a command that doesn't mount something considered to have failed?
> > (I think that's how it was with 2021.07.0.)
> 
> That sounds promising.

Hmm, I starred at the code for a while, but failed to understand how to
check for there being a mountpoint. So I leave that for someone else.
(Just plugged a memory leak on the go.)

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2022-07-14 16:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-12 16:45 Regression in automount between 2021.07.0 and 2022.05.0 Uwe Kleine-König
2022-07-14  7:53 ` Sascha Hauer
2022-07-14 16:45   ` Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox