diff options
| author | nl6720 <nl6720@gmail.com> | 2020-08-17 20:33:50 +0300 |
|---|---|---|
| committer | nl6720 <nl6720@gmail.com> | 2020-08-18 21:21:23 +0300 |
| commit | ba3e8345ad335120af6de680766436640f9c3bd3 (patch) | |
| tree | 183570d90059cb9722d94ae36f5685a2ed47215d /scripts/run_archiso.sh | |
| parent | 55d9d1ffc4b43ef10e4e8a1cc43457e521a62cb3 (diff) | |
| download | archiso-ba3e8345ad335120af6de680766436640f9c3bd3.tar.gz archiso-ba3e8345ad335120af6de680766436640f9c3bd3.tar.bz2 | |
scripts/run_archiso.sh: support booting the image as a hard disk or an optical disc
Use virtio-scsi to attach the image. virtio-blk (if=virtio) is inconsistent about the used media type.
Diffstat (limited to 'scripts/run_archiso.sh')
| -rwxr-xr-x | scripts/run_archiso.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/run_archiso.sh b/scripts/run_archiso.sh index 5405ded..1ce00cf 100755 --- a/scripts/run_archiso.sh +++ b/scripts/run_archiso.sh @@ -22,6 +22,7 @@ Usage: Options: -b set boot type to 'BIOS' (default) + -d set image type to hard disk instead of optical disc -h print help -i [image] image to boot into -s use Secure Boot (only relevant when using UEFI) @@ -80,7 +81,9 @@ run_image() { -m "size=3072,slots=0,maxmem=$((3072*1024*1024))" \ -k en \ -name archiso,process=archiso_0 \ - -drive file="${image}",media=cdrom,readonly=on,if=virtio \ + -device virtio-scsi-pci,id=scsi0 \ + -device "scsi-${mediatype%rom},bus=scsi0.0,drive=${mediatype}0" \ + -drive "id=${mediatype}0,if=none,format=raw,media=${mediatype/hd/disk},readonly=on,file=${image}" \ -display sdl \ -vga virtio \ -device virtio-net-pci,romfile=,netdev=net0 -netdev user,id=net0 \ @@ -105,17 +108,21 @@ set_image() { image='' boot_type='bios' +mediatype='cdrom' secure_boot='off' qemu_options=() working_dir="$(mktemp -dt run_archiso.XXXXXXXXXX)" trap cleanup_working_dir EXIT if (( ${#@} > 0 )); then - while getopts 'bhi:su' flag; do + while getopts 'bdhi:su' flag; do case "$flag" in b) boot_type='bios' ;; + d) + mediatype='hd' + ;; h) print_help exit 0 |
