Commit a8da9ff4 authored by Lukas Auer's avatar Lukas Auer Committed by Andes
Browse files

distro_bootcmd: add VirtIO distro boot command



Add a boot command to distro boot to support disks connected over the
VirtIO bus. The boot command uses the shared block environment.
Signed-off-by: default avatarLukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Bin Meng's avatarBin Meng <bmeng.cn@gmail.com>
Reviewed-by: default avatarAlexander Graf <agraf@suse.de>
parent c3b1a990
...@@ -292,7 +292,7 @@ Each entry in the macro defines a single boot device (e.g. a specific eMMC ...@@ -292,7 +292,7 @@ Each entry in the macro defines a single boot device (e.g. a specific eMMC
device or SD card) or type of boot device (e.g. USB disk). The parameters to device or SD card) or type of boot device (e.g. USB disk). The parameters to
the func macro (passed in by the internal implementation of the header) are: the func macro (passed in by the internal implementation of the header) are:
- Upper-case disk type (MMC, SATA, SCSI, IDE, USB, DHCP, PXE). - Upper-case disk type (MMC, SATA, SCSI, IDE, USB, DHCP, PXE, VIRTIO).
- Lower-case disk type (same options as above). - Lower-case disk type (same options as above).
- ID of the specific disk (MMC only) or ignored for other types. - ID of the specific disk (MMC only) or ignored for other types.
...@@ -398,6 +398,7 @@ The list of possible targets consists of: ...@@ -398,6 +398,7 @@ The list of possible targets consists of:
* scsi * scsi
* ide * ide
* usb * usb
* virtio
Other *boot* variables than the ones defined above are only for internal use Other *boot* variables than the ones defined above are only for internal use
of the boot environment and are not guaranteed to exist or work in the same of the boot environment and are not guaranteed to exist or work in the same
......
...@@ -242,6 +242,18 @@ ...@@ -242,6 +242,18 @@
BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB
#endif #endif
#ifdef CONFIG_CMD_VIRTIO
#define BOOTENV_SHARED_VIRTIO BOOTENV_SHARED_BLKDEV(virtio)
#define BOOTENV_DEV_VIRTIO BOOTENV_DEV_BLKDEV
#define BOOTENV_DEV_NAME_VIRTIO BOOTENV_DEV_NAME_BLKDEV
#else
#define BOOTENV_SHARED_VIRTIO
#define BOOTENV_DEV_VIRTIO \
BOOT_TARGET_DEVICES_references_VIRTIO_without_CONFIG_CMD_VIRTIO
#define BOOTENV_DEV_NAME_VIRTIO \
BOOT_TARGET_DEVICES_references_VIRTIO_without_CONFIG_CMD_VIRTIO
#endif
#if defined(CONFIG_CMD_DHCP) #if defined(CONFIG_CMD_DHCP)
#if defined(CONFIG_EFI_LOADER) #if defined(CONFIG_EFI_LOADER)
/* http://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml */ /* http://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml */
...@@ -350,6 +362,7 @@ ...@@ -350,6 +362,7 @@
BOOTENV_SHARED_IDE \ BOOTENV_SHARED_IDE \
BOOTENV_SHARED_UBIFS \ BOOTENV_SHARED_UBIFS \
BOOTENV_SHARED_EFI \ BOOTENV_SHARED_EFI \
BOOTENV_SHARED_VIRTIO \
"boot_prefixes=/ /boot/\0" \ "boot_prefixes=/ /boot/\0" \
"boot_scripts=boot.scr.uimg boot.scr\0" \ "boot_scripts=boot.scr.uimg boot.scr\0" \
"boot_script_dhcp=boot.scr.uimg\0" \ "boot_script_dhcp=boot.scr.uimg\0" \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment