1
0
mirror of https://github.com/rancher/os.git synced 2025-09-04 16:21:07 +00:00

Add support for --efi to scripts/run

This commit is contained in:
Avi Deitcher
2016-10-10 09:06:05 +03:00
parent cc538ad523
commit d4fbc039a7

View File

@@ -41,6 +41,21 @@ while [ "$#" -gt 0 ]; do
--kvm) --kvm)
KVM=1 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) --no-format)
FORMAT=0 FORMAT=0
;; ;;
@@ -138,6 +153,7 @@ if [ "$QEMU" == "1" ]; then
${CPU} \ ${CPU} \
${machine["$ARCH"]} \ ${machine["$ARCH"]} \
-m 2048 \ -m 2048 \
${EFI} \
${network["$ARCH"]} \ ${network["$ARCH"]} \
$(eval "${hd["$ARCH"]} ${HD}") \ $(eval "${hd["$ARCH"]} ${HD}") \
${SECOND_DRIVE_ENABLE} \ ${SECOND_DRIVE_ENABLE} \
@@ -160,6 +176,7 @@ if [ "$QEMU" == "1" ]; then
-kernel ${KERNEL} \ -kernel ${KERNEL} \
-initrd ${INITRD} \ -initrd ${INITRD} \
-m 2048 \ -m 2048 \
${EFI} \
${network["$ARCH"]} \ ${network["$ARCH"]} \
$(eval "${hd["$ARCH"]} ${HD}") \ $(eval "${hd["$ARCH"]} ${HD}") \
${SECOND_DRIVE_ENABLE} \ ${SECOND_DRIVE_ENABLE} \