diff options
author | Lars Wirzenius <liw@liw.fi> | 2019-12-25 14:59:31 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-02-29 10:48:03 +0200 |
commit | 86a0906902be2f5fc75f1f633bfaab06b626ed83 (patch) | |
tree | b2cdcc6804374e810514d01088faff3a09341e1a | |
parent | e2762720881ff3cfc91bf25605df0f3afcb3dccd (diff) | |
download | v-i-86a0906902be2f5fc75f1f633bfaab06b626ed83.tar.gz |
Add: script to run v-i image under Qemu with UEFI
-rw-r--r-- | README.md | 21 | ||||
-rwxr-xr-x | bootvm | 23 |
2 files changed, 44 insertions, 0 deletions
@@ -77,6 +77,15 @@ To write the resulting v-i.img to a USB drive: sudo dd if=v-i.img of=/dev/path/to/usb/drive/device status=progress oflag=direct ~~~ +Alternatively, use bmaptool (from bmap-tools), which does the same +thing as dd but skips holes in sparse files, so it's more efficient +for disk images: + +~~~sh +bmaptool create v-i.img > v-i.bmap +sudo bmaptool copy v-i.img /dev/path/to/usb/drive/device +~~~ + Plug in the USB drive to the laptop, boot off that. Log into the installer as root (no password), and run @@ -87,3 +96,15 @@ installer as root (no password), and run Reboot laptop from its hard drive and you should have a bare bones Debian system installed. + +Virtual test envionment +----------------------------------------------------------------------------- + +You probably want to test with virtual machines instead of real +hardware, for convenience. + +~~~sh +apt install qemu-system +qemu-img create ~/tmp/main.img 10G +./bootvm ~/tmp/main.img 10G v-i.img +~~~ @@ -0,0 +1,23 @@ +#!/bin/sh +# +# Based on: https://wiki.debian.org/SecureBoot/VirtualMachine + +set -eu + +main="$1" +vi="$2" +shift 2 + +if ! [ -e OVFM_VARS.fd ] +then + cp /usr/share/OVMF/OVMF_VARS.fd . +fi + +kvm \ + -m 2048 \ + --machine pc-q35-2.5 \ + -drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_CODE.fd \ + -drive if=pflash,format=raw,file=./OVMF_VARS.fd \ + -drive file="$vi",format=raw,index=0,media=disk \ + -drive file="$main",format=raw,index=1,media=disk \ + "$@" |