x86: qemu: Fix non-working ramboot and nfsboot environment variables
authorBin Meng <bmeng.cn@gmail.com>
Sun, 28 Jul 2019 15:13:58 +0000 (08:13 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Fri, 9 Aug 2019 14:24:02 +0000 (22:24 +0800)
With qemu-x86 starting to use config_distro_bootcmd, the pre-defined
ramboot and nfsboot commands do not work any more. This is caused by
undefined environment variable 'ramdiskaddr' that was previously set
in CONFIG_EXTRA_ENV_SETTINGS but later CONFIG_EXTRA_ENV_SETTINGS was
redefined for distro boot.

Update the x86 generic CONFIG_EXTRA_ENV_SETTINGS to consider distro
boot, and remove the one in qemu-x86.h.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
include/configs/qemu-x86.h
include/configs/x86-common.h

index 097ed414f88e3919a36b338f7e34e98ffef6ce14..c5574201dd68620edc554530ea4c119592715e29 100644 (file)
 
 #define CONFIG_PREBOOT "pci enum"
 
-#undef CONFIG_EXTRA_ENV_SETTINGS
-#define CONFIG_EXTRA_ENV_SETTINGS \
-       CONFIG_STD_DEVICES_SETTINGS \
-       "scriptaddr=0x7000000\0" \
-       "kernel_addr_r=0x1000000\0" \
-       "ramdisk_addr_r=0x4000000\0" \
-       "consoledev=ttyS0\0" \
-       CONFIG_OTHBOOTARGS \
-       BOOTENV
-
 #define CONFIG_SYS_MONITOR_LEN         (1 << 20)
 
 #define CONFIG_STD_DEVICES_SETTINGS    "stdin=serial,i8042-kbd\0" \
index c4deef80af69492c7e61de0c201b8edcece39195..ca27a4f9e242038b19db1db0e87221766defa169 100644 (file)
 #define CONFIG_OTHBOOTARGS     "othbootargs=acpi=off\0"
 #endif
 
+#ifndef CONFIG_DISTRO_DEFAULTS
+#define BOOTENV
+#endif
+
 #define CONFIG_EXTRA_ENV_SETTINGS                      \
        CONFIG_STD_DEVICES_SETTINGS                     \
        "pciconfighost=1\0"                             \
        "netdev=eth0\0"                                 \
        "consoledev=ttyS0\0"                            \
        CONFIG_OTHBOOTARGS                              \
-       "ramdiskaddr=0x4000000\0"                       \
-       "ramdiskfile=initramfs.gz\0"
+       "scriptaddr=0x7000000\0"                        \
+       "kernel_addr_r=0x1000000\0"                     \
+       "ramdisk_addr_r=0x4000000\0"                    \
+       "ramdiskfile=initramfs.gz\0"                    \
+       BOOTENV
 
 #define CONFIG_RAMBOOTCOMMAND                          \
        "setenv bootargs root=/dev/ram rw "             \
        "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
        "console=$consoledev,$baudrate $othbootargs;"   \
-       "tftpboot $loadaddr $bootfile;"                 \
-       "tftpboot $ramdiskaddr $ramdiskfile;"           \
-       "zboot $loadaddr 0 $ramdiskaddr $filesize"
+       "tftpboot $kernel_addr_r $bootfile;"            \
+       "tftpboot $ramdisk_addr_r $ramdiskfile;"        \
+       "zboot $kernel_addr_r 0 $ramdisk_addr_r $filesize"
 
 #define CONFIG_NFSBOOTCOMMAND                          \
        "setenv bootargs root=/dev/nfs rw "             \
        "nfsroot=$serverip:$rootpath "                  \
        "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
        "console=$consoledev,$baudrate $othbootargs;"   \
-       "tftpboot $loadaddr $bootfile;"                 \
-       "zboot $loadaddr"
+       "tftpboot $kernel_addr_r $bootfile;"            \
+       "zboot $kernel_addr_r"
 
 
 #endif /* __CONFIG_H */