diff mbox

[U-Boot,1/2] cmd_pxe.c add any option for filesystem with sysboot uses generic load

Message ID 1390501358-4564-2-git-send-email-dennis@ausil.us
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Dennis Gilmore Jan. 23, 2014, 6:22 p.m. UTC
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
---
 common/cmd_pxe.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

Comments

Wolfgang Denk Jan. 24, 2014, 1:49 p.m. UTC | #1
Dear Dennis Gilmore,

In message <1390501358-4564-2-git-send-email-dennis@ausil.us> you wrote:
> Signed-off-by: Dennis Gilmore <dennis@ausil.us>

"add any option for filesystem with sysboot uses generic load" ?

I'm sorry, but I cannot understand what this is supposed to mean.

> +#ifdef CONFIG_CMD_FS_GENERIC

Can you please add some documentation to the README what this (so far
undocumented) option means?

Thanks.

Wolfgang Denk
Tom Rini Jan. 24, 2014, 1:59 p.m. UTC | #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/24/2014 08:49 AM, Wolfgang Denk wrote:
> Dear Dennis Gilmore,
> 
> In message <1390501358-4564-2-git-send-email-dennis@ausil.us> you wrote:
>> Signed-off-by: Dennis Gilmore <dennis@ausil.us>
> 
> "add any option for filesystem with sysboot uses generic load" ?
> 
> I'm sorry, but I cannot understand what this is supposed to mean.
> 
>> +#ifdef CONFIG_CMD_FS_GENERIC
> 
> Can you please add some documentation to the README what this (so far
> undocumented) option means?

For the record, this is another (relatively) long-standing undocumented
option.

- -- 
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJS4nG/AAoJENk4IS6UOR1WpowQAJ9mvamsYIp9/EiyG7+i6Y5x
rjPNTiwWq0CVCpQsHOkTkzC0Fsgu1Pv9zPBqiVE+u4R/oItnEXxPZVexKreaT6YN
F4BP2z4+x65TCMclbMKSmRMgaQOlnaowofP6vesE5NwwEtdC1wPG5cx0cAXYSE3E
CsqADFm1O62Zpi5uNSkQjYZ0dJhX1Iupykx+nFpwx/mrGis9iyDnqHD6cKTGFMwn
58knHK0/r6icda04LPUTaZ6M8lmvgSvNhgjS76we/EhkFTeCgvbwQa8wOJynZoYE
Nralsd4c8JlUjLtTaHnB8TQACq4wE9/EYNeGwJmutrUnBAHLV0AH7QS4gnPvSyXQ
HO+fuA4g/6zAAMIPDrLWDn6jsAHQ4IIDmCcvqI7g2Irut9OHw2kKdyktKFcIW4+x
VLkZoi8pFrpSdHab9o4xzqpehSNA/bTKp1q2foHrdfxbRw6BIwEkwgrqUNI7XRg9
rzFb9eTdKedTszHBX7WQquyAZhSx1YqvGYXXGRZj1MQ6uvl+X2As1eva9ajoNKqQ
x2ahXpXr5+di3AZmGYgfD6TG7jnOnYynEj3ATxpLkR615tXnojByvCKR4fJeyio3
q9BZqEq8Zc9CTU7aZUCRyI88Ewvn6Q3lYE/E57xAoyoXMPvTmErmmxbgZAy8qZWh
sNEV+Jl6A2w5QxzfGqGt
=wHiM
-----END PGP SIGNATURE-----
Stephen Warren Feb. 3, 2014, 9:20 p.m. UTC | #3
On 01/24/2014 06:59 AM, Tom Rini wrote:
> On 01/24/2014 08:49 AM, Wolfgang Denk wrote:
>> Dear Dennis Gilmore,
> 
>> In message <1390501358-4564-2-git-send-email-dennis@ausil.us> you wrote:
>>> Signed-off-by: Dennis Gilmore <dennis@ausil.us>
> 
>> "add any option for filesystem with sysboot uses generic load" ?
> 
>> I'm sorry, but I cannot understand what this is supposed to mean.
> 
>>> +#ifdef CONFIG_CMD_FS_GENERIC
> 
>> Can you please add some documentation to the README what this (so far
>> undocumented) option means?
> 
> For the record, this is another (relatively) long-standing undocumented
> option.

Just so this thread is up-to-date, I have sent patch "README: document
CONFIG_CMD_FS_GENERIC" to resolve this objection.
diff mbox

Patch

diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c
index c27ec35..20569bb 100644
--- a/common/cmd_pxe.c
+++ b/common/cmd_pxe.c
@@ -11,6 +11,7 @@ 
 #include <linux/ctype.h>
 #include <errno.h>
 #include <linux/list.h>
+#include <fs.h>
 
 #include "menu.h"
 
@@ -160,6 +161,19 @@  static int do_get_fat(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
 	return -ENOENT;
 }
 
+static int do_get_any(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
+{
+#ifdef CONFIG_CMD_FS_GENERIC
+	fs_argv[0] = "load";
+	fs_argv[3] = file_addr;
+	fs_argv[4] = (void *)file_path;
+
+	if (!do_load(cmdtp, 0, 5, fs_argv, FS_TYPE_ANY))
+		return 1;
+#endif
+	return -ENOENT;
+}
+
 /*
  * As in pxelinux, paths to files referenced from files we retrieve are
  * relative to the location of bootfile. get_relfile takes such a path and
@@ -1539,6 +1553,8 @@  int do_sysboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		do_getfile = do_get_ext2;
 	else if (strstr(argv[3], "fat"))
 		do_getfile = do_get_fat;
+	else if (strstr(argv[3], "any"))
+		do_getfile = do_get_any;
 	else {
 		printf("Invalid filesystem: %s\n", argv[3]);
 		return 1;
@@ -1576,7 +1592,7 @@  int do_sysboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 U_BOOT_CMD(
 	sysboot, 7, 1, do_sysboot,
 	"command to get and boot from syslinux files",
-	"[-p] <interface> <dev[:part]> <ext2|fat> [addr] [filename]\n"
-	"    - load and parse syslinux menu file 'filename' from ext2 or fat\n"
-	"      filesystem on 'dev' on 'interface' to address 'addr'"
+	"[-p] <interface> <dev[:part]> <ext2|fat|any> [addr] [filename]\n"
+	"    - load and parse syslinux menu file 'filename' from ext2, fat\n"
+	"      or any filesystem on 'dev' on 'interface' to address 'addr'"
 );