diff options
author | Michael Janczyk | 2010-04-06 22:21:25 +0200 |
---|---|---|
committer | Michael Janczyk | 2010-04-06 22:21:25 +0200 |
commit | ad9e7762c242a4b8a85330f530726fdf9da15b61 (patch) | |
tree | f8df5ce5a67ee9357f9fdfbef95db4daee6a61c6 | |
parent | qemu tap coniguration hell (diff) | |
download | core-ad9e7762c242a4b8a85330f530726fdf9da15b61.tar.gz core-ad9e7762c242a4b8a85330f530726fdf9da15b61.tar.xz core-ad9e7762c242a4b8a85330f530726fdf9da15b61.zip |
ifup modified of qemukvm
-rw-r--r-- | os-plugins/plugins/bootsplash/init-hooks/10-nw-if-config/bootsplash.sh (renamed from os-plugins/plugins/bootsplash/init-hooks/10-have-nw-modules/bootsplash.sh) | 0 | ||||
-rw-r--r-- | os-plugins/plugins/qemukvm/XX_qemukvm.sh | 7 | ||||
-rw-r--r-- | os-plugins/plugins/qemukvm/files/ifup | 22 | ||||
-rw-r--r-- | os-plugins/plugins/qemukvm/files/run-virt.include | 15 | ||||
-rw-r--r-- | os-plugins/plugins/virtualbox/files/run-virt.include | 2 | ||||
-rw-r--r-- | os-plugins/plugins/xen/init-hooks/10-nw-if-config/xennet.sh (renamed from os-plugins/plugins/xen/init-hooks/10-have-nw-modules/xennet.sh) | 0 |
6 files changed, 28 insertions, 18 deletions
diff --git a/os-plugins/plugins/bootsplash/init-hooks/10-have-nw-modules/bootsplash.sh b/os-plugins/plugins/bootsplash/init-hooks/10-nw-if-config/bootsplash.sh index 7f3d563e..7f3d563e 100644 --- a/os-plugins/plugins/bootsplash/init-hooks/10-have-nw-modules/bootsplash.sh +++ b/os-plugins/plugins/bootsplash/init-hooks/10-nw-if-config/bootsplash.sh diff --git a/os-plugins/plugins/qemukvm/XX_qemukvm.sh b/os-plugins/plugins/qemukvm/XX_qemukvm.sh index 2a907861..ac97b52f 100644 --- a/os-plugins/plugins/qemukvm/XX_qemukvm.sh +++ b/os-plugins/plugins/qemukvm/XX_qemukvm.sh @@ -99,17 +99,20 @@ ${qemukvm_imagesrc}." nonfatal [ -n "${qemu}" ] && echo "ALL ALL=NOPASSWD: ${qemu}" >>/mnt/etc/sudoers done #killall=$(binfinder killall) + #ippath=$(binfinder ip) cat >> /mnt/etc/sudoers << EOF # allow to start and stop kvm services / load-/unload kvm modules ALL ALL=NOPASSWD: /etc/init.d/qemukvm +ALL ALL=NOPASSWD: /opt/openslx/uclib-rootfs/sbin/tunctl -t tap* +ALL ALL=NOPASSWD: /opt/openslx/uclib-rootfs/usr/sbin/brctl addif br0 tap* + # TODO: check if kvm / qemu sufficient #ALL ALL=NOPASSWD: ${killall} udhcpd #ALL ALL=NOPASSWD: ${PLUGINDIR}/ifup #ALL ALL=NOPASSWD: ${PLUGINDIR}/ifdown #ALL ALL=NOPASSWD: /opt/openslx/uclib-rootfs/usr/sbin/udhcpd -S /tmp/qemukvm/if* -#ALL ALL=NOPASSWD: /opt/openslx/uclib-rootfs/sbin/tunctl -t tap* +#ALL ALL=NOPASSWD: ${ippath} link set dev tap* #ALL ALL=NOPASSWD: /opt/openslx/uclib-rootfs/sbin/ip addr add * dev tap* -#ALL ALL=NOPASSWD: /opt/openslx/uclib-rootfs/usr/sbin/brctl addif br0 tap* EOF fi else diff --git a/os-plugins/plugins/qemukvm/files/ifup b/os-plugins/plugins/qemukvm/files/ifup index ee5fdecf..9d94ac64 100644 --- a/os-plugins/plugins/qemukvm/files/ifup +++ b/os-plugins/plugins/qemukvm/files/ifup @@ -30,24 +30,25 @@ QKTMPDIR=/tmp/qemukvm/${USER}/${VM_ID} case "$1" in tapbridge0*) # Adding the tap0 interface to the existing bridge configured in stage3 - sudo /opt/openslx/uclib-rootfs/sbin/tunctl -t $1 >/dev/null 2>&1 + #sudo /opt/openslx/uclib-rootfs/sbin/tunctl -t $1 >/dev/null 2>&1 sudo ip link set dev $1 up - sudo /opt/openslx/uclib-rootfs/usr/sbin/brctl addif br0 $1 + #sudo /opt/openslx/uclib-rootfs/usr/sbin/brctl addif br0 $1 echo "1" >/proc/sys/net/ipv4/conf/br0/forwarding echo "1" >/proc/sys/net/ipv4/conf/$1/forwarding ;; tapnat0*) # Configuring DHCP on host tap1 interface and enable IP masquerading - sudo /opt/openslx/uclib-rootfs/sbin/tunctl -t $1 >/dev/null 2>&1 + #sudo /opt/openslx/uclib-rootfs/sbin/tunctl -t $1 >/dev/null 2>&1 sudo ip addr add ${nataddress} dev $1 + sudo ip link set dev $1 up # not necessary since already done by run-virt.include #[ -d ${QKTMPDIR} ] || mkdir -p ${QKTMPDIR} # cut the last .NNN/MM from nataddress ${natnetwork%.*} # TODO: we use here atatic address, maybe change later - sed -e "s,NWIF,$1,;s,/misc/,/qemu/," \ - -e "s,CNETWORK,192.168.1${VM_ID}.254,;s,PIDFILE,${QKTMPDIR}/udhcpd.pid," \ + sed -e "s,NWIF,$1,;s,CNETWORK,192.168.1${VM_ID}," \ + -e "s,PIDFILE,${QKTMPDIR}/udhcpd.pid," \ -e "s,LEASEFILE,${QKTMPDIR}/udhcpd.leases," \ - ${OPENSLX_DEFAULT_CONFDIR}/udhcpd.conf \ + ${OPENSLX_DEFAULT_CONFDIR}/udhcpd.conf \ >${QKTMPDIR}/udhcpd.conf touch ${QKTMPDIR}/udhcpd.leases # ip link set $1 up @@ -58,10 +59,13 @@ case "$1" in ;; taphost0*) # Configuring DHCP on host tap2 interface - sudo /opt/openslx/uclib-rootfs/sbin/tunctl -t $1 >/dev/null 2>&1 + #sudo /opt/openslx/uclib-rootfs/sbin/tunctl -t $1 >/dev/null 2>&1 sudo ip addr add ${hoaddress} dev $1 - [ -d ${QKTMPDIR} ] || mkdir -p ${QKTMPDIR} - sed "s,NWIF,$1,;s,/misc/,/qemu/,;s,USER,$USER,;s,CNETWORK,192.168.1${VM_ID}.254," \ + sudo ip link set dev $1 up + #[ -d ${QKTMPDIR} ] || mkdir -p ${QKTMPDIR} + sed -e "s,NWIF,$1,;s,USER,${USER},;s,CNETWORK,192.168.1${VM_ID}," \ + -e "s,PIDFILE,${QKTMPDIR}/udhcpd.pid," \ + -e "s,LEASEFILE,${QKTMPDIR}/udhcpd.leases," \ ${OPENSLX_DEFAULT_CONFDIR}/udhcpd.conf >${QKTMPDIR}/udhcpd.conf touch ${QKTMPDIR}/udhcpd.leases # ip link set $1 up diff --git a/os-plugins/plugins/qemukvm/files/run-virt.include b/os-plugins/plugins/qemukvm/files/run-virt.include index 69c5dad4..08a8b4f1 100644 --- a/os-plugins/plugins/qemukvm/files/run-virt.include +++ b/os-plugins/plugins/qemukvm/files/run-virt.include @@ -122,18 +122,18 @@ qemu_ifscr="script=${PLUGINDIRQK}/ifup,downscript=${PLUGINDIRQK}/ifdown" case "${network_kind}" in bridge*) VIRTCMDOPTS="${VIRTCMDOPTS} -net tap,ifname=tapbridge${VM_ID},${qemu_ifscr}" - #sudo /opt/openslx/uclib-rootfs/sbin/tunctl -t tapbridge${VM_ID} 2>/tmp/asdf - #sudo /opt/openslx/uclib-rootfs/usr/sbin/brctl addif br0 tapbridge${VM_ID} 2>>/tmp/asdf + sudo /opt/openslx/uclib-rootfs/sbin/tunctl -t tapbridge${VM_ID} #2>/dev/null + sudo /opt/openslx/uclib-rootfs/usr/sbin/brctl addif br0 tapbridge${VM_ID} ;; NAT|nat) VIRTCMDOPTS="${VIRTCMDOPTS} -net tap,ifname=tapnat${VM_ID},${qemu_ifscr}" - #sudo /opt/openslx/uclib-rootfs/sbin/tunctl -t tapbnat${VM_ID} 2>/tmp/asdf - #sudo /opt/openslx/uclib-rootfs/usr/sbin/brctl addif br0 tapnat${VM_ID} 2>>/tmp/asdf + sudo /opt/openslx/uclib-rootfs/sbin/tunctl -t tapnat${VM_ID} + sudo /opt/openslx/uclib-rootfs/usr/sbin/brctl addif br0 tapnat${VM_ID} ;; hostonly|host-only) VIRTCMDOPTS="${VIRTCMDOPTS} -net tap,ifname=taphost${VM_ID},${qemu_ifscr}" - #sudo /opt/openslx/uclib-rootfs/sbin/tunctl -t tapbhost${VM_ID} 2>/tmp/asdf - #sudo /opt/openslx/uclib-rootfs/usr/sbin/brctl addif br0 taphost${VM_ID} 2>>/tmp/asdf + sudo /opt/openslx/uclib-rootfs/sbin/tunctl -t taphost${VM_ID} + sudo /opt/openslx/uclib-rootfs/usr/sbin/brctl addif br0 taphost${VM_ID} ;; *) network_kind="user" @@ -299,4 +299,5 @@ VIRTCMDOPTSHL="${VIRTCMDOPTS} -nographic ${diskfile}" # graphical start VIRTCMD="$VIRTCMD" # vga std/cirrus/vmware? -VIRTCMDOPTS="${VIRTCMDOPTS} -vga std -full-screen ${diskfile}" +#VIRTCMDOPTS="${VIRTCMDOPTS} -vga std -full-screen ${diskfile}" +VIRTCMDOPTS="${VIRTCMDOPTS} ${diskfile}" diff --git a/os-plugins/plugins/virtualbox/files/run-virt.include b/os-plugins/plugins/virtualbox/files/run-virt.include index 2a0b84a2..5fc0641a 100644 --- a/os-plugins/plugins/virtualbox/files/run-virt.include +++ b/os-plugins/plugins/virtualbox/files/run-virt.include @@ -48,6 +48,8 @@ machconfig="${machfolder}/${vm_shortname}/${vm_shortname}.xml" diskfolder="${confdir}/HardDisks" snapshotdir=${machfolder}/${vm_shortname}/Snapshots mkdir -p ${diskfolder} ${snapshotdir} 2>/dev/null +# check if diskless var empty? +[ -z "${diskless}" ] && diskless=0 # configure our own rwimg, empty image which we support if [ "${imgmode}" = "rwimg" ]; then diff --git a/os-plugins/plugins/xen/init-hooks/10-have-nw-modules/xennet.sh b/os-plugins/plugins/xen/init-hooks/10-nw-if-config/xennet.sh index d514b68d..d514b68d 100644 --- a/os-plugins/plugins/xen/init-hooks/10-have-nw-modules/xennet.sh +++ b/os-plugins/plugins/xen/init-hooks/10-nw-if-config/xennet.sh |