o clean up output of qemu-ifup
o s/qcow/qcow2/ as that is now the recommended default o bump pkgname
This commit is contained in:
parent
45c0553422
commit
8070b3354a
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.22 2007/09/16 00:45:13 merdely Exp $
|
||||
# $OpenBSD: Makefile,v 1.23 2008/01/09 10:17:54 todd Exp $
|
||||
|
||||
# no success building on other archs yet
|
||||
ONLY_FOR_ARCHS= amd64 arm i386 powerpc
|
||||
@ -6,6 +6,7 @@ ONLY_FOR_ARCHS= amd64 arm i386 powerpc
|
||||
COMMENT= multi system emulator
|
||||
|
||||
DISTNAME= qemu-0.9.0
|
||||
PKGNAME= qemu-0.9.0p0
|
||||
CATEGORIES= emulators
|
||||
|
||||
HOMEPAGE= http://fabrice.bellard.free.fr/qemu/
|
||||
|
@ -1,5 +1,4 @@
|
||||
#! /bin/sh
|
||||
set -x
|
||||
|
||||
_ETHER=trunk0
|
||||
_BRIDGE=bridge0
|
||||
@ -12,15 +11,15 @@ if test `id -u` -ne 0; then
|
||||
SUDO=sudo
|
||||
fi
|
||||
|
||||
echo "Initializing $1.."
|
||||
echo -n " {$1 ($BRIDGE <-> $ETHER)"
|
||||
|
||||
# Set the tun device into layer2 mode
|
||||
$SUDO ifconfig $1 link0 up
|
||||
|
||||
# Set up our bridge
|
||||
$SUDO ifconfig $1 group tun
|
||||
$SUDO ifconfig $BRIDGE create && {
|
||||
# Ony add rules if the bridge creation succeeds; otherwise
|
||||
$SUDO ifconfig $1 group tun > /dev/null 2>&1
|
||||
$SUDO ifconfig $BRIDGE create > /dev/null 2>&1 && {
|
||||
# Only add rules if the bridge creation succeeds; otherwise
|
||||
# duplicate rules get loaded each time qemu starts
|
||||
# The following two block carp packets from wasting cpu cycles inside the
|
||||
# qemu sessions, remove if testing carp inside qemu
|
||||
@ -30,13 +29,14 @@ $SUDO ifconfig $BRIDGE create && {
|
||||
# Since we can specify ETHER and BRIDGE above, its possible that
|
||||
# this tun interface or this physical interface was setup as part of
|
||||
# a different bridge earlier, and that is never cleaned up, so we have
|
||||
# to cleaup here first before we set it up; a physcal interface cannot
|
||||
# to cleanup here first before we set it up; a physcal interface cannot
|
||||
# be member to more than one bridge, thankfully, or I never would have
|
||||
# caught this
|
||||
ifconfig bridge | sed -n '/^bridge[0-9]*/{s/:.*$//;p;}' | while read brif
|
||||
do
|
||||
$SUDO brconfig $brif del $ETHER
|
||||
$SUDO brconfig $brif del $1
|
||||
$SUDO brconfig $brif del $ETHER > /dev/null 2>&1
|
||||
$SUDO brconfig $brif del $1 > /dev/null 2>&1
|
||||
done
|
||||
$SUDO brconfig $BRIDGE add $ETHER up
|
||||
$SUDO brconfig $BRIDGE add $1 up || true
|
||||
echo "}"
|
||||
|
@ -1,10 +1,10 @@
|
||||
+---------------
|
||||
| Quick Start:
|
||||
| 1. get a bootable floppy image
|
||||
| 2. qemu-img create -f qcow virtual.hd 10G
|
||||
| 2. qemu-img create -f qcow2 virtual.hd 10G
|
||||
| 3. qemu -m 32 -fda floppy.fs -boot a -monitor stdio virtual.hd
|
||||
| (initial install to hard drive)
|
||||
| 4. qemu-img convert -c -O qcow virtual.hd tmp && mv tmp virtual.hd
|
||||
| 4. qemu-img convert -c -O qcow2 virtual.hd tmp && mv tmp virtual.hd
|
||||
| (compress hard drive while qemu is not running)
|
||||
| 5. qemu -m 32 -monitor stdio virtual.hd
|
||||
| (normal boot from hard drive)
|
||||
|
Loading…
Reference in New Issue
Block a user