- chmod +x $utility
- done
-
- mkdir -p etc/sysconfig/network-scripts
- configure_netdev () {
- mkdir -p sys/class/net/${1}
- echo ${2} > sys/class/net/${1}/address
- echo ${3} > sys/class/net/${1}/tx_queue_len
-
- : >> etc/sysconfig/network-scripts/ifcfg-${1}
- }
-
- configure_netdev lo 00:00:00:00:00:00 0
- configure_netdev eth0 00:22:19:22:4b:af 1000
- configure_netdev eth1 00:22:19:22:4b:b1 1000
- configure_netdev eth2 00:15:17:a0:29:80 1000
- configure_netdev eth3 00:15:17:a0:29:81 1000
- configure_netdev eth4 00:1b:21:29:ce:51 1000
-
- mkdir -p var/xapi
- cat > var/xapi/network.dbcache <<'EOF'
+ chmod +x $utility
+ done
+
+ mkdir -p usr/bin
+ cat > usr/bin/ovs-vsctl <<'EOF'
+#! /bin/sh
+echo ${0} ${*} >&2
+
+while test ${#} -ge 4; do
+ if test X"${1}" = Xget && \
+ test X"${2}" = Xinterface && \
+ test X"${4}" = Xofport; then
+ if test X"${3}" = Xeth2; then
+ echo 5
+ else
+ echo -1
+ fi
+ fi
+
+ shift
+done
+EOF
+ chmod +x usr/bin/ovs-vsctl
+
+ cat > usr/bin/ovs-ofctl <<'EOF'
+#! /bin/sh
+echo ${0} ${*} >&2
+
+# Check that the flow is properly formed.
+ovs-ofctl parse-flow "${3}" >/dev/null
+EOF
+ chmod +x usr/bin/ovs-ofctl
+
+ mkdir -p etc/sysconfig/network-scripts
+ configure_netdev () {
+ mkdir -p sys/class/net/${1}
+ echo ${2} > sys/class/net/${1}/address
+ echo ${3} > sys/class/net/${1}/tx_queue_len
+ if test ${1} = eth1; then
+ # No VLAN acceleration.
+ echo 0x829 > sys/class/net/${1}/features
+ else
+ # Supports VLAN acceleration.
+ echo 0x10b89 > sys/class/net/${1}/features
+ fi
+ mkdir sys/class/net/${1}/device
+ ln -s ../../../bus/pci/drivers/e1000 sys/class/net/${1}/device/driver
+
+ : >> etc/sysconfig/network-scripts/ifcfg-${1}
+ }
+
+ configure_netdev lo 00:00:00:00:00:00 0
+ configure_netdev eth0 00:22:19:22:4b:af 1000
+ configure_netdev eth1 00:22:19:22:4b:b1 1000
+ configure_netdev eth2 00:15:17:a0:29:80 1000
+ configure_netdev eth3 00:15:17:a0:29:81 1000
+ configure_netdev eth4 00:1b:21:29:ce:51 1000
+
+ mkdir -p var/xapi
+ cat > var/xapi/network.dbcache <<'EOF'