Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMichael Vorburger <mike@vorburger.ch>2020-12-30 04:02:34 +0100
committerMichael Vorburger.ch <mike@vorburger.ch>2021-01-23 16:43:55 +0000
commit608d1100c8a87b3284efa8163ea483e8c11bc311 (patch)
tree4b632db393fb0def1a9eb7995666bac9b682b88a /scripts
parent88304719d0f15b6987aedf5b7ed4a4a00dc1744a (diff)
add -c => -cdrom cloud-init.iso support to run_archiso.sh
Co-authored-by: nl6720 <nl6720@gmail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/run_archiso.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/scripts/run_archiso.sh b/scripts/run_archiso.sh
index b19d280..74f3096 100755
--- a/scripts/run_archiso.sh
+++ b/scripts/run_archiso.sh
@@ -29,6 +29,7 @@ Options:
-s use Secure Boot (only relevant when using UEFI)
-u set boot type to 'UEFI'
-v use VNC display (instead of default SDL)
+ -c [image] attach an additional optical disc image (e.g. for cloud-init)
Example:
Run an image using UEFI:
@@ -85,6 +86,13 @@ run_image() {
)
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 \
-boot order=d,menu=on,reboot-timeout=5000 \
-m "size=3072,slots=0,maxmem=$((3072*1024*1024))" \
@@ -120,6 +128,7 @@ set_image() {
}
image=''
+oddimage=''
accessibility=''
boot_type='bios'
mediatype='cdrom'
@@ -130,7 +139,7 @@ working_dir="$(mktemp -dt run_archiso.XXXXXXXXXX)"
trap cleanup_working_dir EXIT
if (( ${#@} > 0 )); then
- while getopts 'abdhi:suv' flag; do
+ while getopts 'abc:dhi:suv' flag; do
case "$flag" in
a)
accessibility='on'
@@ -138,6 +147,9 @@ if (( ${#@} > 0 )); then
b)
boot_type='bios'
;;
+ c)
+ oddimage="$OPTARG"
+ ;;
d)
mediatype='hd'
;;