[PATCH 2/2] efi-block: detect when the block device is a USB Disk

Sascha Hauer s.hauer at pengutronix.de
Fri Nov 3 04:27:28 PDT 2017


On Thu, Nov 02, 2017 at 12:03:03PM +0100, Michael Olbrich wrote:
> On Fri, Oct 27, 2017 at 09:05:48AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > use usbdisk as a basename
> > 
> > This will be usefull as example when we want to search for a usb disk for
> > failsafe update or install.
> 
> I understand the use-case, but this breaks a different setup: Until now
> 'disk0' is usually the 'boot' device (the one barebox was loaded from). So
> it was rather simple to create one image with bootloader, kernel and rootfs
> that can be booted from USB and SATA.

I just talked to Michael and we agreed that depending on 'disk0' being
the device we have booted from is a bad idea. What we really want is
a pointer to the device we have booted from.
In fact that is on my mental todo list for a long time: Several boards
try to continue booting from the medium the bootloader came from. They
often do this by putting a switch/case around bootsource_get() in C or
around $bootsource in shell and trying to pick the right device for each
bootsource. We should rather directly return the device from which we booted
from.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list