#!/bin/bash - # virt-efivars test script # @configure_input@ # (C) Copyright 2014-2015 Red Hat Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # Written by Richard W.M. Jones unset CDPATH set -e qemu="@QEMU@" varstore="example-varstore" output="example-varstore-edited" cp "$varstore" "$output" console="console=ttyS0" mach= extra_args= scsi=virtio-scsi-pci case `uname -m` in aarch64) uefi_code=/usr/share/AAVMF/AAVMF_CODE.fd console="console=ttyAMA0" mach="-M virt -cpu cortex-a57" scsi=virtio-scsi-device ;; i?86|x86_64) uefi_code=/usr/share/OVMF/OVMF_CODE.fd extra_args="-device sga" ;; *) esac set -x "$qemu" \ -nodefaults \ -nographic \ $mach \ -m 1024 \ -no-reboot \ -kernel kernel \ -initrd initrd \ -append "$console" \ -drive if=pflash,format=raw,file=$uefi_code,readonly \ -drive if=pflash,format=raw,file=$output \ -device $scsi,id=scsi \ -drive file=virt-efivars.qcow2,snapshot=on,cache=unsafe,format=qcow2,if=none,id=hd0 \ -device scsi-hd,drive=hd0 \ -serial stdio \ $extra_args