forked from ivandavidov/minimal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqemu-uefi.sh
More file actions
executable file
·34 lines (29 loc) · 1.13 KB
/
Copy pathqemu-uefi.sh
File metadata and controls
executable file
·34 lines (29 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
# Use this script without arguments to run the generated ISO image with QEMU.
# If you pass '-hdd' or '-h' the virtual hard disk 'hdd.img' will be attached.
# Note that this virtual hard disk has to be created in advance. You can use
# the script 'generate_hdd.sh' to generate the hard disk image file. Once you
# have hard disk image, you can use it as overlay device and persist all your
# changes. See the '.config' file for more information on the overlay support.
#
# If you get kernel panic with message "No working init found", then try to
# increase the RAM from 128M to 256M.
# Location of the local file 'OVMF.fd' which is used as main firmware. You can
# download it here:
#
# https://sourceforge.net/projects/edk2/files/OVMF/
#
OVMF_LOCATION=~/Downloads/OVMF.fd
if [ "`uname -m`" = "x86_64" ] ; then
ARCH="x86_64"
else
ARCH="i386"
fi
cmd="qemu-system-$ARCH -pflash $OVMF_LOCATION -m 128M -cdrom minimal_linux_live.iso -boot d -vga std"
if [ "$1" = "-hdd" -o "$1" = "-h" ] ; then
echo "Starting QEMU with attached ISO image and hard disk."
$cmd -hda hdd.img
else
echo "Starting QEMU with attached ISO image."
$cmd
fi