From 20af6a738d3d5ca1889c530dcdc2180eb32dc8ff Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sat, 25 Mar 2017 15:15:08 -0400 Subject: qemu script will use built-in linux loader by default The script was modified so that it would still use PXE to load the other things that are loaded during network boot. The network style booting is also now the default This is the fastest way to boot, though it does not permit testing the bootloader on the CDROM or the PXE boot setup. To test the bootloader, you must now export SLOW_BOOT=y To boot from CDROM image, you must export USE_ISO=y --- src/qemu.sh | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'src/qemu.sh') diff --git a/src/qemu.sh b/src/qemu.sh index 207ca68..f9982c4 100755 --- a/src/qemu.sh +++ b/src/qemu.sh @@ -2,11 +2,8 @@ . samizdat-paths.sh -# iso=debian-live-8.4.0-amd64-gnome-desktop.iso -# iso=debian-live-8.4.0-amd64-standard.iso -# iso=debian-live-8.4.0-amd64-standard.btrfs.iso iso=${samizdat_iso_dir}/samizdat.iso -disk=${samizdat_iso_dir}/debian-live-8.4.0-amd64-standard.btrfs.disk +disk=${samizdat_iso_dir}/samizdat.disk.img layered=${samizdat_iso_dir}/${iso%.iso}.layered.iso [ -f "$layered" ] && iso=$layered @@ -17,21 +14,22 @@ initrd.sh || { echo "initrd.sh failed" >&2; exit 1; }; NET='tap,vlan=0,ifname=tap0,script=no,downscript=no' -# To test local pxe boot server: +[ "$SLOW_BOOT" ] || QEMU_LOADS_LINUX=y + +# To use qemu built-in pxe boot server: # NET='user,tftp=isolinux,bootfile=/pxelinux.0' initrd=${samizdat_isolinux_dir}/linux/initrd.img kernel=${samizdat_isolinux_dir}/linux/vmlinuz -kcmdline='boot=samizdat components quiet splash' - -if [ "$QEMU_LOADS_LINUX" ]; then - set -- -initrd "$initrd" -kernel "$kernel" -append "$kcmdline" -fi +kcmdline_NET='boot=samizdat components quiet splash nbdroot=192.168.10.1,samizdat.btrfs nbddev=/dev/nbd0 ip=dhcp' +kcmdline_CDROM='boot=samizdat components quiet splash' if [ "$USE_ISO" ]; then - set -- -cdrom "$iso" + [ "$QEMU_LOADS_LINUX" ] && set -- -initrd "$initrd" -kernel "$kernel" -append "$kcmdline_CDROM" + set -- -cdrom "$iso" else - set -- -boot n + [ "$QEMU_LOADS_LINUX" ] && set -- -initrd "$initrd" -kernel "$kernel" -append "$kcmdline_NET" + set -- -boot n fi sudo qemu-system-x86_64 -enable-kvm -smp 2 -m 640 -k en-us \ -- cgit v1.2.3