grub-shell: Support arm64-efi
This commit is contained in:
parent
7eb27a49e9
commit
9efd79f376
1 changed files with 24 additions and 10 deletions
|
@ -65,7 +65,7 @@ serial_port=com0
|
||||||
serial_null=
|
serial_null=
|
||||||
halt_cmd=halt
|
halt_cmd=halt
|
||||||
pseries=n
|
pseries=n
|
||||||
disk=hda
|
disk="hda "
|
||||||
case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
|
case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
|
||||||
*-emu)
|
*-emu)
|
||||||
device_map=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
|
device_map=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
|
||||||
|
@ -145,7 +145,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
|
||||||
qemu=qemu-system-i386
|
qemu=qemu-system-i386
|
||||||
console=console
|
console=console
|
||||||
trim=1
|
trim=1
|
||||||
disk=hdb
|
disk="hdb "
|
||||||
;;
|
;;
|
||||||
i386-qemu)
|
i386-qemu)
|
||||||
boot=qemu
|
boot=qemu
|
||||||
|
@ -164,6 +164,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
|
||||||
boot=cd
|
boot=cd
|
||||||
console=console
|
console=console
|
||||||
trim=1
|
trim=1
|
||||||
|
qemuopts="-bios OVMF32.fd $qemuopts"
|
||||||
;;
|
;;
|
||||||
x86_64-efi)
|
x86_64-efi)
|
||||||
qemu=qemu-system-x86_64
|
qemu=qemu-system-x86_64
|
||||||
|
@ -172,6 +173,15 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
|
||||||
trim=1
|
trim=1
|
||||||
qemuopts="-bios OVMF.fd $qemuopts"
|
qemuopts="-bios OVMF.fd $qemuopts"
|
||||||
;;
|
;;
|
||||||
|
arm64-efi)
|
||||||
|
qemu=qemu-system-aarch64
|
||||||
|
boot=hd
|
||||||
|
console=console
|
||||||
|
trim=1
|
||||||
|
qemuopts="-machine virt -cpu cortex-a57 -bios /usr/share/qemu-efi/QEMU_EFI.fd $qemuopts"
|
||||||
|
disk="device virtio-blk-device,drive=hd1 -drive if=none,id=hd1,file="
|
||||||
|
serial_port=efi0
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
boot=hd
|
boot=hd
|
||||||
qemu=qemu-system-i386
|
qemu=qemu-system-i386
|
||||||
|
@ -227,13 +237,13 @@ for option in "$@"; do
|
||||||
echo "Too many disks" 1>&2
|
echo "Too many disks" 1>&2
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
qemuopts="$qemuopts -$disk $dsk"
|
qemuopts="$qemuopts -$disk$dsk"
|
||||||
if [ "$disk" = hda ]; then
|
if [ "$disk" = "hda " ]; then
|
||||||
disk=hdb;
|
disk="hdb ";
|
||||||
elif [ "$disk" = hdb ]; then
|
elif [ "$disk" = "hdb " ]; then
|
||||||
# CDROM is hdc
|
# CDROM is hdc
|
||||||
disk=hdd
|
disk="hdd "
|
||||||
elif [ "$disk" = hdd ]; then
|
elif [ "$disk" = "hdd " ]; then
|
||||||
# CDROM is hdc
|
# CDROM is hdc
|
||||||
disk=error
|
disk=error
|
||||||
fi
|
fi
|
||||||
|
@ -360,7 +370,9 @@ if [ x$boot != xnet ] && [ x$boot != xemu ]; then
|
||||||
${files} >/dev/null 2>&1
|
${files} >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
if [ x$boot = xhd ]; then
|
if [ x$boot = xhd ]; then
|
||||||
if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = mips-arc ]; then
|
if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm64-efi ]; then
|
||||||
|
device="device virtio-blk-device,drive=hd0 -drive if=none,id=hd0,file="
|
||||||
|
elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = mips-arc ]; then
|
||||||
device="hdb "
|
device="hdb "
|
||||||
else
|
else
|
||||||
device="hda "
|
device="hda "
|
||||||
|
@ -368,7 +380,9 @@ if [ x$boot = xhd ]; then
|
||||||
bootdev="-boot c"
|
bootdev="-boot c"
|
||||||
fi
|
fi
|
||||||
if [ x$boot = xcd ]; then
|
if [ x$boot = xcd ]; then
|
||||||
if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = powerpc-ieee1275 ] && [ x$pseries != xy ] ; then
|
if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm64-efi ]; then
|
||||||
|
device="device virtio-blk-device,drive=cd0 -drive if=none,id=cd0,media=cdrom,file="
|
||||||
|
elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = powerpc-ieee1275 ] && [ x$pseries != xy ] ; then
|
||||||
device="-drive if=ide,media=cdrom,file="
|
device="-drive if=ide,media=cdrom,file="
|
||||||
else
|
else
|
||||||
device="cdrom "
|
device="cdrom "
|
||||||
|
|
Loading…
Reference in a new issue