#!/usr/bin/env bash # # Copyright (C) 2020 David Runge # # SPDX-License-Identifier: GPL-3.0-or-later # # A simple script to run an parabolaiso image using qemu. The image can be booted # using BIOS or UEFI. # # Requirements: # - qemu # - edk2-ovmf (when UEFI booting) set -eu print_help() { local usagetext IFS='' read -r -d '' usagetext < 0 )); then while getopts 'bdhi:su' flag; do case "$flag" in b) boot_type='bios' ;; d) mediatype='hd' ;; h) print_help exit 0 ;; i) image="$OPTARG" ;; u) boot_type='uefi' ;; s) secure_boot='on' ;; *) printf '%s\n' "Error: Wrong option. Try 'run_parabolaiso -h'." exit 1 ;; esac done else print_help exit 1 fi check_image run_image