source: scripts/start-qemu.bash @ 2990

Revision 2797, 951 bytes checked in by alanbach-guest, 7 years ago (diff)
  • Updated compile-iso.bash
  • Added chroot.bash, chroot helper script
  • Added start-qemu.bash, to start qemu for iso testing
  • Property svn:executable set to *
Line 
1#!/bin/bash
2# Bash script to start Qemu emulator to test ISOs
3# Coyright 2005-2008 Alan Baghumian / GNU/GPL
4
5usage()
6{
7  echo "Usage: start-qemu.sh <32|64> <iso-name> <boot>"
8  exit
9}
10
11if [ -z "${1}" -o -z "${2}" -o -z "${3}" ]; then
12   usage
13fi
14
15if [ "${1}" != "32" -a "${1}" != "64" ]; then
16   echo "Invalid arch."
17   exit
18fi
19
20mem_size="290"
21eth_iface="wlan0"
22qemuhdd="qemu-hdd"
23
24# load needed kernel modules
25modprobe kqemu major=0 &>/dev/null
26modprobe tun &>/dev/null
27
28# enable ip forwarding and masquerading
29echo "1" > /proc/sys/net/ipv4/ip_forward
30iptables -t nat -A POSTROUTING -o ${eth_iface} -j MASQUERADE
31
32umount /dev/shm &> /dev/null
33mount -t tmpfs -o size=${mem_size} none /dev/shm &>/dev/null
34
35#qemu-system-x86_64
36if [ "${1}" == "32" ]; then
37   qemu -cdrom ${2} -m 280 -boot ${3} -hda ${qemuhdd} -usb -net tap -net nic #-no-kqemu
38else
39   qemu-system-x86_64 -cdrom ${2} -m 280 -boot ${3} -hda ${qemuhdd} -usb -net tap -net nic -no-kqemu
40fi
Note: See TracBrowser for help on using the repository browser.