[U-Boot] [PATCH] BugFix: PXE Boot fails on old arm kernel with initrd without FDT

Sven Glodowski sven.glodowski at arcor.de
Mon Oct 30 13:37:17 UTC 2017


Hello,

PXE/Extlinux boot fails on old Kernel which requires initrd but doesn't have FDT!

sysboot loads initrd loaded into RAM, but system boots without initrd and hangs.

Kernel:
  Linux odroid 3.8.13.30 #1 SMP PREEMPT Wed Feb 1 20:17:12 CET 2017 armv7l armv7l armv7l GNU/Linux

Looking into [master]u-boot/cmd/pxe.c, 
  function  label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)

Number of boot parameter initializing with 2
 622:         int bootm_argc = 2;

Before calling boot_m / boot_z, 
number of boot parameters updated only if FTD is used!

 783	if (!bootm_argv[3])
 784		bootm_argv[3] = getenv("fdt_addr");
 785
 786         if (bootm_argv[3]) {
 787                 if (!bootm_argv[2])
 788                         bootm_argv[2] = "-";
 789                 bootm_argc = 4;

Applying this patch, Number of boot parameters set to 3 if initrd loaded before.

-----------------------------------
--- a/u-boot/cmd/pxe.c.orig	2017-10-30 11:53:20.470526920 +0100
+++ b/u-boot/cmd/pxe.c	2017-10-30 11:56:43.526036397 +0100
@@ -780,6 +780,9 @@ static int label_boot(cmd_tbl_t *cmdtp,
 		}
 	}
 
+	if (bootm_argv[2])
+		bootm_argc = 3;
+
 	if (!bootm_argv[3])
 		bootm_argv[3] = env_get("fdt_addr");
 
--------------------------------

After that, board boots even without FTD.
 
checked on device with patched U-Boot 2016.11-rc3-g8a65327.

for u-boot branch [master] 
  calling do_bootm /  do_bootz not changed so maybe bug still exists.

For u-boot branch [next] this is fixed.
  bootm_argc initilized with 3 and boot commands called with "-" on systems without initrd
  

Best regards

Sven Glodowski

-------------
Boot log after applying patch


U-Boot 2016.11-rc3-g8a65327-dirty (Oct 30 2017 - 10:28:32 +0100)

CPU:   Exynos4412 @ 1 GHz
Model: Odroid based on Exynos4412
Board: Odroid based on Exynos4412
Type:  u3
DRAM:  2 GiB
LDO20 at VDDQ_EMMC_1.8V: set 1800000 uV; enabling
LDO22 at VDDQ_EMMC_2.8V: set 2800000 uV; enabling
LDO21 at TFLASH_2.8V: set 2800000 uV; enabling
MMC:   EXYNOS DWMMC: 0, SAMSUNG SDHCI: 1
Net:   No ethernet found.
Autobooting in 1 seconds, press <ESC> twice to stop.
Retrieving file: extlinux.conf
reading extlinux.conf
572 bytes read in 2 ms (279.3 KiB/s)
Odroid boot options
1:      Odroid-3.8.13 (1080p-edid)
2:      Odroid-3.8.13 (1080p-noedid)
Enter choice: 2:        Odroid-3.8.13 (1080p-noedid)
Retrieving file: uInitrd
reading uInitrd
9325833 bytes read in 330 ms (27 MiB/s)
Retrieving file: zImage
reading zImage
2344680 bytes read in 86 ms (26 MiB/s)
append: console=tty1 console=ttySAC1,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro mem=2047M drm_kms_helper.edid_firmware=edid/1920x1080.bin
Kernel image @ 0x42000000 [ 0x000000 - 0x23c6e8 ]
## Loading init Ramdisk from Legacy Image at 45000000 ...
   Image Name:   initrd.img-3.8.13.30
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9325769 Bytes = 8.9 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0xa00
...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pxe.patch
Type: text/x-patch
Size: 300 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171030/c7fcf3f5/attachment.bin>


More information about the U-Boot mailing list