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