mirror of
https://github.com/rancher/os.git
synced 2025-09-01 14:48:55 +00:00
Add support for --efi to scripts/run
This commit is contained in:
17
scripts/run
17
scripts/run
@@ -41,6 +41,21 @@ while [ "$#" -gt 0 ]; do
|
||||
--kvm)
|
||||
KVM=1
|
||||
;;
|
||||
--efi)
|
||||
# set where our EFI firmware binary is
|
||||
EFIFIRMWARE="./build/OVMF.fd"
|
||||
# create the command-line to pass to qemu
|
||||
EFI="--bios $EFIFIRMWARE"
|
||||
# if the firmware does not yet exist, download it
|
||||
if [[ ! -e "$EFIFIRMWARE" ]]; then
|
||||
echo "Downloading OVMF EFI firmware"
|
||||
# because unzip does not support streaming from stdin...
|
||||
curl --location http://downloads.sourceforge.net/project/edk2/OVMF/OVMF-X64-r15214.zip > ./build/ovmf.zip
|
||||
unzip ./build/ovmf.zip -d ./build OVMF.fd
|
||||
rm -f ./build/ovmf.zip
|
||||
echo "Download OVMF EFI firmware complete"
|
||||
fi
|
||||
;;
|
||||
--no-format)
|
||||
FORMAT=0
|
||||
;;
|
||||
@@ -138,6 +153,7 @@ if [ "$QEMU" == "1" ]; then
|
||||
${CPU} \
|
||||
${machine["$ARCH"]} \
|
||||
-m 2048 \
|
||||
${EFI} \
|
||||
${network["$ARCH"]} \
|
||||
$(eval "${hd["$ARCH"]} ${HD}") \
|
||||
${SECOND_DRIVE_ENABLE} \
|
||||
@@ -160,6 +176,7 @@ if [ "$QEMU" == "1" ]; then
|
||||
-kernel ${KERNEL} \
|
||||
-initrd ${INITRD} \
|
||||
-m 2048 \
|
||||
${EFI} \
|
||||
${network["$ARCH"]} \
|
||||
$(eval "${hd["$ARCH"]} ${HD}") \
|
||||
${SECOND_DRIVE_ENABLE} \
|
||||
|
Reference in New Issue
Block a user