Add accessibility support based on option flag
scripts/run_archiso.sh: Add the `-a` option flag to add accessibility support on demand for `run_archiso`. Add accessibility specific options to qemu in `run_image()`. Not providing the specific braille chardev hardware otherwise blocks running run_archiso with `qemu-system-x86_64: -chardev braille,id=brltty: brlapi__openConnection: connect: No such file or directory`. Fixes #77
This commit is contained in:
parent
8bb3e8c12f
commit
e748a770b1
@ -21,6 +21,7 @@ Usage:
|
|||||||
run_archiso [options]
|
run_archiso [options]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
|
-a set accessibility support using brltty
|
||||||
-b set boot type to 'BIOS' (default)
|
-b set boot type to 'BIOS' (default)
|
||||||
-d set image type to hard disk instead of optical disc
|
-d set image type to hard disk instead of optical disc
|
||||||
-h print help
|
-h print help
|
||||||
@ -76,6 +77,13 @@ run_image() {
|
|||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${accessibility}" == 'on' ]]; then
|
||||||
|
qemu_options+=(
|
||||||
|
'-chardev' 'braille,id=brltty'
|
||||||
|
'-device' 'usb-braille,id=usbbrl,chardev=brltty'
|
||||||
|
)
|
||||||
|
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))" \
|
||||||
@ -87,17 +95,15 @@ run_image() {
|
|||||||
-display sdl \
|
-display sdl \
|
||||||
-vga virtio \
|
-vga virtio \
|
||||||
-audiodev pa,id=snd0 \
|
-audiodev pa,id=snd0 \
|
||||||
-chardev braille,id=brltty \
|
|
||||||
-device ich9-intel-hda \
|
-device ich9-intel-hda \
|
||||||
-device hda-output,audiodev=snd0 \
|
-device hda-output,audiodev=snd0 \
|
||||||
-device virtio-net-pci,romfile=,netdev=net0 -netdev user,id=net0 \
|
-device virtio-net-pci,romfile=,netdev=net0 -netdev user,id=net0 \
|
||||||
-device usb-braille,id=usbbrl,chardev=brltty \
|
|
||||||
-machine type=q35,smm=on,accel=kvm,usb=on,pcspk-audiodev=snd0 \
|
-machine type=q35,smm=on,accel=kvm,usb=on,pcspk-audiodev=snd0 \
|
||||||
-global ICH9-LPC.disable_s3=1 \
|
-global ICH9-LPC.disable_s3=1 \
|
||||||
-enable-kvm \
|
-enable-kvm \
|
||||||
"${qemu_options[@]}" \
|
"${qemu_options[@]}" \
|
||||||
-no-reboot \
|
-serial stdio \
|
||||||
-serial stdio
|
-no-reboot
|
||||||
}
|
}
|
||||||
|
|
||||||
set_image() {
|
set_image() {
|
||||||
@ -113,6 +119,7 @@ set_image() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
image=''
|
image=''
|
||||||
|
accessibility=''
|
||||||
boot_type='bios'
|
boot_type='bios'
|
||||||
mediatype='cdrom'
|
mediatype='cdrom'
|
||||||
secure_boot='off'
|
secure_boot='off'
|
||||||
@ -121,8 +128,11 @@ 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 'bdhi:su' flag; do
|
while getopts 'abdhi:su' flag; do
|
||||||
case "$flag" in
|
case "$flag" in
|
||||||
|
a)
|
||||||
|
accessibility='on'
|
||||||
|
;;
|
||||||
b)
|
b)
|
||||||
boot_type='bios'
|
boot_type='bios'
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user