aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/disk-image-builder/nested/patches/03-network
blob: ca5c4f952dd1bbecd75b28ab721b39aa10c40dd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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