[PATCH] xload: be more flexible when searching for second stage bootloader.

Sascha Hauer s.hauer at pengutronix.de
Tue Sep 29 00:05:23 PDT 2015


On Sun, Sep 27, 2015 at 03:08:51PM +0100, Vicente Bergas wrote:
> A first stage bootloader can read fat and ext4 filesystems, and
> even both can be compiled-in at the same time.
> But then xload has a hardcoded fat filesystem mount option which
> renders ext4 unusable.
> This patch tries to mount it as ext4 if the fat attempt fails.
> 
> Then, a typical use case of an ext4 formatted filesystem
> is it to be a standard linux filesystem, which contains
> boot-related files in /boot. So, when searching for the second stage
> bootloader, try /boot/barebox.bin after not finding it in /barebox.bin
> 
> Signed-off-by: Vicente Bergas <vicencb at gmail.com>
> ---
>  arch/arm/mach-omap/xload.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c
> index ebcbcbc..c5e29f8 100644
> --- a/arch/arm/mach-omap/xload.c
> +++ b/arch/arm/mach-omap/xload.c
> @@ -118,6 +118,8 @@ static void *omap_xload_boot_mmc(void)
>  	partname = asprintf("%s.0", diskdev);
>  
>  	ret = mount(partname, "fat", "/", NULL);
> +	if (ret)
> +		ret = mount(partname, "ext4", "/", NULL);

It should also be possible to pass NULL as fs type in which case we
automatically detect the fs type. Could you check that?

Where does the MLO come from when you don't have a FAT on your MMC/SD
device? Don't we need FAT on the first partition to let the boot ROM
load the MLO?

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