manjaro-tools/bin/testiso.in

40 lines
1.1 KiB
Text
Raw Permalink Normal View History

2014-12-04 19:19:54 +01:00
#!/bin/bash
2014-12-04 19:20:28 +01:00
#
# 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; version 2 of the License.
#
# 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.
version=@version@
2014-12-04 19:19:54 +01:00
if [ $# -eq 0 ]; then
2016-09-15 23:58:18 +02:00
echo "
usage: testiso <isofile> [id|ic|sd|sc|vd|vc]
2014-12-04 19:19:54 +01:00
2016-09-15 23:58:18 +02:00
id boot iso as IDE disk
ic boot iso as IDE cd-rom
sd boot iso as SCSI disk
sc boot iso as SCSI cd-rom
vd boot iso as virtio disk
vc boot iso as virtio cd-rom
"
exit 1
2014-12-04 19:19:54 +01:00
fi
case "${2}" in
2016-09-15 23:58:18 +02:00
id) IF="ide"; MEDIA="disk";;
ic) IF="ide"; MEDIA="cdrom";;
sd) IF="scsi"; MEDIA="disk";;
sc) IF="scsi"; MEDIA="cdrom";;
vd) IF="virtio"; MEDIA="disk";;
vc) IF="virtio"; MEDIA="cdrom";;
*) IF="scsi"; MEDIA="cdrom";;
2014-12-04 19:19:54 +01:00
esac
echo qemu -m 256 -drive file=${1},if=${IF},media=${MEDIA},boot=on
qemu -m 256 -drive file=${1},if=${IF},media=${MEDIA},boot=on