summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap/xload.c
diff options
context:
space:
mode:
authorVicente Bergas <vicencb@gmail.com>2015-10-02 00:08:39 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-10-02 09:10:16 +0200
commitf54c032120b6e24b622933af7acb8a817395eb34 (patch)
tree1e3504e4561db887898897a04e8c25807d35a544 /arch/arm/mach-omap/xload.c
parente89f1a1f188c196eade0d2ad05b662326d870be3 (diff)
downloadbarebox-f54c032120b6e24b622933af7acb8a817395eb34.tar.gz
barebox-f54c032120b6e24b622933af7acb8a817395eb34.tar.xz
xload: be more flexible when searching for second stage bootloader.
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@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-omap/xload.c')
-rw-r--r--arch/arm/mach-omap/xload.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c
index ebcbcbcde1..8805930215 100644
--- a/arch/arm/mach-omap/xload.c
+++ b/arch/arm/mach-omap/xload.c
@@ -117,7 +117,7 @@ static void *omap_xload_boot_mmc(void)
partname = asprintf("%s.0", diskdev);
- ret = mount(partname, "fat", "/", NULL);
+ ret = mount(partname, NULL, "/", NULL);
if (ret) {
printf("Unable to mount %s (%d)\n", partname, ret);
@@ -128,6 +128,8 @@ static void *omap_xload_boot_mmc(void)
free(partname);
buf = read_file("/barebox.bin", &len);
+ if (!buf)
+ buf = read_file("/boot/barebox.bin", &len);
if (!buf) {
printf("could not read barebox.bin from sd card\n");
return NULL;