diff options
author | Carsten Koester <ckoester@cisco.com> | 2016-06-13 06:39:40 -0400 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2016-08-01 14:52:10 +0000 |
commit | bb847371cf77f1fac6579d0444d6168b5b43c2a0 (patch) | |
tree | fd4b84edcda8535033b436d6f3f39cd432350107 /resources/tools/disk-image-builder/nested/image-patches/03-network | |
parent | ec3512ff7f1405f2e7bc74bbfadf5691afc352c4 (diff) |
CSIT-156: DPDK support for Nested VM image
Change-Id: Iefa9ec90d1b243c9e1108f63a182c3d9ef6e6474
Signed-off-by: Carsten Koester <ckoester@cisco.com>
Diffstat (limited to 'resources/tools/disk-image-builder/nested/image-patches/03-network')
-rwxr-xr-x | resources/tools/disk-image-builder/nested/image-patches/03-network | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/resources/tools/disk-image-builder/nested/image-patches/03-network b/resources/tools/disk-image-builder/nested/image-patches/03-network new file mode 100755 index 0000000000..ca5c4f952d --- /dev/null +++ b/resources/tools/disk-image-builder/nested/image-patches/03-network @@ -0,0 +1,37 @@ +#!/bin/sh + +patch boot/grub/menu.lst <<"_EOF" +17c17 +< kernel /boot/bzImage rw root=/dev/sda1 console=ttyS0,115200n8 +--- +> kernel /boot/bzImage rw root=/dev/sda1 ipv6.disable=1 console=ttyS0,115200n8 +_EOF + +patch etc/network/interfaces <<"_EOF" +4a5,7 +> +> auto mgmt0 +> iface mgmt0 inet dhcp +_EOF + +patch etc/init.d/S40network <<"_EOF" +11a12,29 +> +> # Rename interfaces. The e1000 interface is managment. +> NUM_VIRTIO=0 +> NUM_MGMT=0 +> for dev in /sys/class/net/eth* +> do +> devname=`basename $dev` +> driver=`readlink ${dev}/device/driver` +> if test "${driver#*virtio}" != "$driver" +> then +> ip link set dev $devname name virtio${NUM_VIRTIO} +> NUM_VIRTIO=$(($NUM_VIRTIO+1)) +> else +> ip link set dev $devname name mgmt${NUM_MGMT} +> NUM_MGMT=$((NUM_MGMT+1)) +> fi +> done +> +_EOF |