Commit 608d1100 authored by Michael Vorburger.ch's avatar Michael Vorburger.ch Committed by Michael Vorburger.ch
Browse files

add -c => -cdrom cloud-init.iso support to run_archiso.sh


Co-authored-by: nl6720's avatarnl6720 <nl6720@gmail.com>
parent 88304719
...@@ -29,6 +29,7 @@ Options: ...@@ -29,6 +29,7 @@ Options:
-s use Secure Boot (only relevant when using UEFI) -s use Secure Boot (only relevant when using UEFI)
-u set boot type to 'UEFI' -u set boot type to 'UEFI'
-v use VNC display (instead of default SDL) -v use VNC display (instead of default SDL)
-c [image] attach an additional optical disc image (e.g. for cloud-init)
Example: Example:
Run an image using UEFI: Run an image using UEFI:
...@@ -85,6 +86,13 @@ run_image() { ...@@ -85,6 +86,13 @@ run_image() {
) )
fi fi
if [[ -n "${oddimage}" ]]; then
qemu_options+=(
'-device' 'scsi-cd,bus=scsi0.0,drive=cdrom1'
'-drive' "id=cdrom1,if=none,format=raw,media=cdrom,readonly=on,file=${oddimage}"
)
fi
qemu-system-x86_64 \ qemu-system-x86_64 \
-boot order=d,menu=on,reboot-timeout=5000 \ -boot order=d,menu=on,reboot-timeout=5000 \
-m "size=3072,slots=0,maxmem=$((3072*1024*1024))" \ -m "size=3072,slots=0,maxmem=$((3072*1024*1024))" \
...@@ -120,6 +128,7 @@ set_image() { ...@@ -120,6 +128,7 @@ set_image() {
} }
image='' image=''
oddimage=''
accessibility='' accessibility=''
boot_type='bios' boot_type='bios'
mediatype='cdrom' mediatype='cdrom'
...@@ -130,7 +139,7 @@ working_dir="$(mktemp -dt run_archiso.XXXXXXXXXX)" ...@@ -130,7 +139,7 @@ working_dir="$(mktemp -dt run_archiso.XXXXXXXXXX)"
trap cleanup_working_dir EXIT trap cleanup_working_dir EXIT
if (( ${#@} > 0 )); then if (( ${#@} > 0 )); then
while getopts 'abdhi:suv' flag; do while getopts 'abc:dhi:suv' flag; do
case "$flag" in case "$flag" in
a) a)
accessibility='on' accessibility='on'
...@@ -138,6 +147,9 @@ if (( ${#@} > 0 )); then ...@@ -138,6 +147,9 @@ if (( ${#@} > 0 )); then
b) b)
boot_type='bios' boot_type='bios'
;; ;;
c)
oddimage="$OPTARG"
;;
d) d)
mediatype='hd' mediatype='hd'
;; ;;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment