Re: [U-Boot] [PATCH] pxe: prepend fdtdir to DTB name irrespective of source
On 02/14/2014 11:49 AM, Dennis Gilmore wrote: On Wed, 12 Feb 2014 14:30:04 -0700 Stephen Warren swar...@wwwdotorg.org wrote: From: Stephen Warren swar...@nvidia.com The directory name from an fdtdir directive in a PXE config file should always be pre-pended to the DTB filename; it shouldn't matter whether the DTB filename came from the $fdtfile environment variable, or whether it was constructed dynamically from ${soc}-${board}.dtb. Fix the code to always prepend the directory name. Reviewed-by: Dennis Gilmore den...@ausil.us Tested-by: Dennis Gilmore den...@ausil.us Thanks for the fix Tom, does this patch look good? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] pxe: prepend fdtdir to DTB name irrespective of source
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/19/2014 12:00 PM, Stephen Warren wrote: On 02/14/2014 11:49 AM, Dennis Gilmore wrote: On Wed, 12 Feb 2014 14:30:04 -0700 Stephen Warren swar...@wwwdotorg.org wrote: From: Stephen Warren swar...@nvidia.com The directory name from an fdtdir directive in a PXE config file should always be pre-pended to the DTB filename; it shouldn't matter whether the DTB filename came from the $fdtfile environment variable, or whether it was constructed dynamically from ${soc}-${board}.dtb. Fix the code to always prepend the directory name. Reviewed-by: Dennis Gilmore den...@ausil.us Tested-by: Dennis Gilmore den...@ausil.us Thanks for the fix Tom, does this patch look good? Yes. Sorry, I'm doing the following today: - - Clean out patches in my TODO list older than v9 of the kbuild series (done). - - Do v9 of kbuild series (in progress) - - Do stuff after v9 of kbuild series (hopefully later today). - -- Tom -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJTBOOuAAoJENk4IS6UOR1WhggP/1QSELUbzznfDUNcapSG9lhO 8tZTUGgmTaKTr2v6ruRHyKbf4RnzP+RfJrecXLXqdR2ymEzhS1Xs0TSrCBApAYub R2YFnvJWwH53IsZcwgH4B6zdGbO+OaaNcwL9waJ9aoXaSKYeiktrZQCEf8KYUx5r UaPAD/fPW7BygAjwys03YlVxW4GEsxfRGWXU7I/6uT+ytBXgbNkbHmkXcYSp0LpG YLbhc6pUZtkXTw8tXoKc6oxW+LNpVxdLZhtbPdse/h2T3SSGuuqnky1/agrlYXtg tJ3rOBmIP5n1Z2dvTLMTS58kB+lZssxcGcsDcMLT2BLZiPhhseISte4NMgBedk/E GMhOpvIktDa1VWShjOo5EI/8NFRO7mlhGqfFWV3HoO25olBdPGtHj9UZQJkOeKni pT/2OoGTjM+Wq/F2ybrUDOpRKBVwC+OjgTZ8trgmXiJMEaBspa+aE7w5k5FAoK3E IF6zE9HN6nEu68DP2XAV1ySKn8WAiet/6P6ePf9AI4C+H5XEUVmdscOsCymiu5or saORS7GrHd3CAJzSZtGDVjnCcAfg4W9Cwb5IVfWyfN4H0f0sx7RkbV6CfwK3AdPQ f/YhOtt4LDR9yY063bag7SX6rFStdWm3UUcmOhCtms2rZI2ueU0VPB4lR/k7wtyY SaBqo0iDDaUeeTeIWlan =bbfE -END PGP SIGNATURE- ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] pxe: prepend fdtdir to DTB name irrespective of source
On Wed, 12 Feb 2014 14:30:04 -0700 Stephen Warren swar...@wwwdotorg.org wrote: From: Stephen Warren swar...@nvidia.com The directory name from an fdtdir directive in a PXE config file should always be pre-pended to the DTB filename; it shouldn't matter whether the DTB filename came from the $fdtfile environment variable, or whether it was constructed dynamically from ${soc}-${board}.dtb. Fix the code to always prepend the directory name. Reviewed-by: Dennis Gilmore den...@ausil.us Tested-by: Dennis Gilmore den...@ausil.us Thanks for the fix ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] pxe: prepend fdtdir to DTB name irrespective of source
From: Stephen Warren swar...@nvidia.com The directory name from an fdtdir directive in a PXE config file should always be pre-pended to the DTB filename; it shouldn't matter whether the DTB filename came from the $fdtfile environment variable, or whether it was constructed dynamically from ${soc}-${board}.dtb. Fix the code to always prepend the directory name. Reported-by: Dennis Gilmore den...@ausil.us Fixes: c61d94d86035 (pxe: implement fdtdir extlinux.conf tag) Signed-off-by: Stephen Warren swar...@nvidia.com --- common/cmd_pxe.c | 77 +--- 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c index 29e48db20416..6aabd1357c7f 100644 --- a/common/cmd_pxe.c +++ b/common/cmd_pxe.c @@ -700,44 +700,47 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label) if (label-fdt) { fdtfile = label-fdt; } else if (label-fdtdir) { - fdtfile = getenv(fdtfile); - /* -* For complex cases, it might be worth calling a -* board- or SoC-provided function here to provide a -* better default: -* -* if (!fdtfile) -* fdtfile = gen_fdtfile(); -* -* If this is added, be sure to keep the default below, -* or move it to the default weak implementation of -* gen_fdtfile(). -*/ - if (!fdtfile) { - char *soc = getenv(soc); - char *board = getenv(board); - char *slash; - - len = strlen(label-fdtdir); - if (!len) - slash = ./; - else if (label-fdtdir[len - 1] != '/') - slash = /; - else - slash = ; - - len = strlen(label-fdtdir) + strlen(slash) + - strlen(soc) + 1 + strlen(board) + 5; - fdtfilefree = malloc(len); - if (!fdtfilefree) { - printf(malloc fail (FDT filename)\n); - return 1; - } - - snprintf(fdtfilefree, len, %s%s%s-%s.dtb, - label-fdtdir, slash, soc, board); - fdtfile = fdtfilefree; + char *f1, *f2, *f3, *f4, *slash; + + f1 = getenv(fdtfile); + if (f1) { + f2 = ; + f3 = ; + f4 = ; + } else { + /* +* For complex cases where this code doesn't +* generate the correct filename, the board +* code should set $fdtfile during early boot, +* or the boot scripts should set $fdtfile +* before invoking pxe or sysboot. +*/ + f1 = getenv(soc); + f2 = -; + f3 = getenv(board); + f4 = .dtb; + } + + len = strlen(label-fdtdir); + if (!len) + slash = ./; + else if (label-fdtdir[len - 1] != '/') + slash = /; + else + slash = ; + + len = strlen(label-fdtdir) + strlen(slash) + + strlen(f1) + strlen(f2) + strlen(f3) + + strlen(f4) + 1; + fdtfilefree = malloc(len); + if (!fdtfilefree) { + printf(malloc fail (FDT filename)\n); + return 1; } + + snprintf(fdtfilefree, len, %s%s%s%s%s%s, +label-fdtdir, slash, f1, f2, f3, f4); + fdtfile = fdtfilefree; } if (fdtfile) { -- 1.8.1.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot