[U-Boot] [RFC PATCH] qemu-x86: Use config_distro_bootcmd

Bin Meng
2019-06-22T14:51:11Z

Hi Joshua,

On Fri, Jun 21, 2019 at 11:17 PM Joshua Watt <jpewhacker@gmail.com> wrote:
>
> Converts qemu x86 machines to boot using distro_config. The intent is to
> allow u-boot in qemu to be maximally compatible with many boot methods
> without having to change the config. Currently, u-boot will only boot in
> a very limited set of circumstances where there is a /boot/vmlinuz on
> scsi 0:3 with no ramdisk.
>
> If distro_bootcmd fails, u-boot will fall back to the original method.
>
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
> include/configs/qemu-x86.h | 30 ++++++++++++++++++++++++++++++

Could you please enable

> 1 file changed, 30 insertions(+)
>
> diff --git a/include/configs/qemu-x86.h b/include/configs/qemu-x86.h
> index 64e7a60b8a..d9c96e295d 100644
> --- a/include/configs/qemu-x86.h
> +++ b/include/configs/qemu-x86.h
> @@ -10,8 +10,38 @@
> #ifndef __CONFIG_H
> #define __CONFIG_H
>
> +#include <linux/sizes.h>
> +
> +#define CONFIG_BOOTCOMMAND \
> + "run distro_bootcmd; " \
> + "ext2load scsi 0:3 01000000 /boot/vmlinuz; " \
> + "zboot 01000000"

This should be in the board defconfig files. I would like to only keep
the "run distro_bootcmd" command.

> +
> +#define BOOT_TARGET_DEVICES(func) \
> + func(USB, usb, 0) \
> + func(SCSI, scsi, 0) \
> + func(VIRTIO, virtio, 0) \
> + func(IDE, ide, 0) \
> + func(DHCP, dhcp, na)
> +
> +#include <config_distro_bootcmd.h>
> #include <configs/x86-common.h>
>
> +#undef CONFIG_ENV_SIZE
> +#define CONFIG_ENV_SIZE SZ_256K
> +
> +#define CONFIG_PREBOOT "pci enum"
> +
> +#undef CONFIG_EXTRA_ENV_SETTINGS
> +#define CONFIG_EXTRA_ENV_SETTINGS \
> + CONFIG_STD_DEVICES_SETTINGS \
> + "scriptaddr=0x8000000\0" \

QEMU default memory is 128MiB, so I would put this to somewhere that
does not break the default one, like 0x7000000?

> + "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" \
> --

CONFIG_DISTRO_DEFAULTS should also be turned on in the board defconfig files.

Could you please update the README.x86 about testing distro boot on
QEMU? Thanks!

Regards,
Bin