aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/disk-image-builder/nested/image-patches
diff options
context:
space:
mode:
Diffstat (limited to 'resources/tools/disk-image-builder/nested/image-patches')
-rwxr-xr-xresources/tools/disk-image-builder/nested/image-patches/01-serial-console23
-rwxr-xr-xresources/tools/disk-image-builder/nested/image-patches/02-users37
-rwxr-xr-xresources/tools/disk-image-builder/nested/image-patches/03-network37
-rwxr-xr-xresources/tools/disk-image-builder/nested/image-patches/04-qemu-ga33
-rwxr-xr-xresources/tools/disk-image-builder/nested/image-patches/05-ssh-hostkeys11
-rwxr-xr-xresources/tools/disk-image-builder/nested/image-patches/06-dpdk-support98
-rwxr-xr-xresources/tools/disk-image-builder/nested/image-patches/07-isolate-cpu8
-rwxr-xr-xresources/tools/disk-image-builder/nested/image-patches/08-virtio-disk8
8 files changed, 0 insertions, 255 deletions
diff --git a/resources/tools/disk-image-builder/nested/image-patches/01-serial-console b/resources/tools/disk-image-builder/nested/image-patches/01-serial-console
deleted file mode 100755
index 8dfede413b..0000000000
--- a/resources/tools/disk-image-builder/nested/image-patches/01-serial-console
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-patch boot/grub/menu.lst <<"_EOF"
-2c2,4
-< timeout 10
----
-> timeout 1
-> serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
-> terminal --timeout=0 serial console
-15c17
-< kernel /boot/bzImage rw root=/dev/sda1 rootwait
----
-> kernel /boot/bzImage rw root=/dev/sda1 rootwait console=ttyS0,115200n8
-_EOF
-
-patch etc/inittab <<"_EOF"
-27c27,29
-< console::respawn:/sbin/getty -L console 0 vt100 # GENERIC_SERIAL
----
-> console::respawn:/sbin/getty -L console 0 vt100 # GENERIC_SERIAL
-> # ttyS1 to be used by qemu-ga
-> ttyS2::respawn:/sbin/getty -L ttyS2 0 vt100 # Additional serial
-_EOF
diff --git a/resources/tools/disk-image-builder/nested/image-patches/02-users b/resources/tools/disk-image-builder/nested/image-patches/02-users
deleted file mode 100755
index 9b7db0969a..0000000000
--- a/resources/tools/disk-image-builder/nested/image-patches/02-users
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh -e
-
-patch etc/sudoers <<"_EOF"
-97a98,100
->
-> csit ALL=(root) NOPASSWD:ALL
-> cisco ALL=(root) NOPASSWD:ALL
-_EOF
-
-patch etc/passwd <<"_EOF"
-10a11,12
-> csit:x:1001:1001:CSIT user:/tmp:/bin/sh
-> cisco:x:1002:1002:Cisco user:/tmp:/bin/sh
-_EOF
-
-patch etc/shadow <<"_EOF"
-1c1
-< root::10933:0:99999:7:::
----
-> root:5pcUkhKEiBBfw:16892:0:99999:7:::
-10a11,12
-> csit:5pcUkhKEiBBfw:16892:0:99999:7:::
-> cisco:5piAVSAyGsbaI:16892:0:99999:7:::
-_EOF
-
-patch etc/group <<"_EOF"
-27a28,29
-> csit:x:1001:
-> cisco:x:1002:
-_EOF
-
-patch etc/ssh/sshd_config <<"_EOF"
-44c44
-< #PermitRootLogin prohibit-password
----
-> PermitRootLogin yes
-_EOF
diff --git a/resources/tools/disk-image-builder/nested/image-patches/03-network b/resources/tools/disk-image-builder/nested/image-patches/03-network
deleted file mode 100755
index e7d215c00a..0000000000
--- a/resources/tools/disk-image-builder/nested/image-patches/03-network
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-
-patch boot/grub/menu.lst <<"_EOF"
-17c17
-< kernel /boot/bzImage rw root=/dev/sda1 rootwait console=ttyS0,115200n8
----
-> kernel /boot/bzImage rw root=/dev/sda1 rootwait 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
diff --git a/resources/tools/disk-image-builder/nested/image-patches/04-qemu-ga b/resources/tools/disk-image-builder/nested/image-patches/04-qemu-ga
deleted file mode 100755
index 2897260d10..0000000000
--- a/resources/tools/disk-image-builder/nested/image-patches/04-qemu-ga
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-cat - > etc/init.d/S45qemu-ga <<"_EOF"
-#!/bin/sh
-#
-# Start QEMU guest agent
-#
-QEMU_GA_MODE="isa-serial"
-QEMU_GA_DEV="/dev/ttyS1"
-
-case "$1" in
- start)
- echo "Starting qemu guest agent..."
- /usr/bin/qemu-ga -m $QEMU_GA_MODE -p $QEMU_GA_DEV -d
- ;;
- stop)
- echo "Stopping quemu guest agent..."
- killall qemu-ga
- ;;
- restart|reload)
- "$0" stop
- "$0" start
- ;;
- *)
- echo "Usage: $0 {start|stop|restart}"
- exit 1
-esac
-
-exit $?
-_EOF
-
-chown root.root etc/init.d/S45qemu-ga
-chmod 755 etc/init.d/S45qemu-ga
diff --git a/resources/tools/disk-image-builder/nested/image-patches/05-ssh-hostkeys b/resources/tools/disk-image-builder/nested/image-patches/05-ssh-hostkeys
deleted file mode 100755
index de8be15798..0000000000
--- a/resources/tools/disk-image-builder/nested/image-patches/05-ssh-hostkeys
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-# Generate host keys here. This will speed up first boot time ever so slightly.
-# It does however mean that keys are not unique across installations -- which
-# shouldn't be an issue for our use case though.
-
-sudo mkdir -m 0775 -p etc/ssh
-for a in rsa ecdsa ed25519 dsa
-do
- sudo ssh-keygen -f etc/ssh/ssh_host_${a}_key -N "" -t ${a}
-done
diff --git a/resources/tools/disk-image-builder/nested/image-patches/06-dpdk-support b/resources/tools/disk-image-builder/nested/image-patches/06-dpdk-support
deleted file mode 100755
index 2de4ad6962..0000000000
--- a/resources/tools/disk-image-builder/nested/image-patches/06-dpdk-support
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/bin/sh
-
-### This may be a temporary file. Once DPDK is working stable in the nested
-### VM, and if and when ### we decide we want to do all testing with DPDK,
-### the steps executed here may become default configuration for the image.
-###
-### For now, to give us the flexibility to work with and without DPDK, keep
-### this as a separate script.
-
-DPDK_START_FILE="start-testpmd.sh"
-DPDK_STOP_FILE="stop-testpmd.sh"
-
-cat - > ${DPDK_START_FILE} <<"_EOF"
-#!/bin/sh
-
-TARGET_DRIVER="igb_uio"
-PATH_TO_IGB_UIO_MODULE="/usr/local/kmod/igb_uio.ko"
-NUM_HUGEPAGES=512
-TESTPMD_LOG=/tmp/testpmd.log
-TESTPMD_PID=/tmp/testpmd.pid
-
-if [ -f ${TESTPMD_PID} ]
-then
- echo Testpmd is already running. Please stop running instance first.
- echo Delete PID file ${TESTPMD_PID} if you are sure this is a stale PID file.
- exit 1
-fi
-
-# Load igb_uio module if this is the driver we want to use
-if [ "${TARGET_DRIVER}" = "igb_uio" ]
-then
- insmod ${PATH_TO_IGB_UIO_MODULE}
-fi
-
-# Set up hugepages
-echo "vm.nr_hugepages = ${NUM_HUGEPAGES}" > /etc/sysctl.conf
-echo "vm.swappiness = 0" >> /etc/sysctl.conf
-echo "kernel.randomize_va_space = 0" >> /etc/sysctl.conf
-sysctl -p
-mkdir -p /mnt/huge
-grep -q hugetlbfs /etc/fstab || echo "hugetlbfs /mnt/huge hugetlbfs mode=1770,gid=2021 0 0" >> /etc/fstab
-mount -a
-
-#
-echo 1af4 1000 > /sys/bus/pci/drivers/${TARGET_DRIVER}/new_id
-#
-for dev in $(find /sys/bus/pci/drivers/virtio-pci -type l -name '*:*:*.*' | sed -e 's/.*\///')
-do
- class=$(cat /sys/bus/pci/drivers/virtio-pci/${dev}/class)
- if [ "$class" = "0x020000" ]; then
- echo Unbinding $dev from virtio-pci
- echo $dev > /sys/bus/pci/drivers/virtio-pci/unbind
- echo Binding $dev to ${TARGET_DRIVER}
- echo $dev > /sys/bus/pci/drivers/${TARGET_DRIVER}/bind
- fi
-done
-
-# RCU and IRQ affinity
-for i in $(ls /proc/irq/ | grep [0-9])
-do
- echo 1 > /proc/irq/$i/smp_affinity
-done
-echo 1 | sudo tee /sys/bus/workqueue/devices/writeback/cpumask
-
-# There is a bug causing packet loss when VM is initialized. This workaround is
-# supposed to re-initialize CPUs.
-for i in $(ls -d /sys/devices/system/cpu/cpu[1-9]/online); do
- echo 0 | sudo tee $i
- sleep 2
- echo 1 | sudo tee $i
-done
-
-# Start testpmd in the background. This looks a bit convoluted; we need to redirect stdin
-# (and keep stdin active) or else testpmd will quit.
-tail -f /dev/null | nohup testpmd $@ > ${TESTPMD_LOG} 2>&1 &
-echo $! > ${TESTPMD_PID}
-_EOF
-
-cat - > ${DPDK_STOP_FILE} <<"_EOF"
-#!/bin/sh
-
-TESTPMD_LOG=/tmp/testpmd.log
-TESTPMD_PID=/tmp/testpmd.pid
-
-if [ ! -f ${TESTPMD_PID} ]
-then
- echo Testpmd is not running.
- exit 1
-fi
-
-kill $(cat ${TESTPMD_PID})
-rm -f ${TESTPMD_PID}
-
-cat ${TESTPMD_LOG}
-_EOF
-
-chmod 755 ${DPDK_START_FILE}
-chmod 755 ${DPDK_STOP_FILE}
diff --git a/resources/tools/disk-image-builder/nested/image-patches/07-isolate-cpu b/resources/tools/disk-image-builder/nested/image-patches/07-isolate-cpu
deleted file mode 100755
index f057a51b0e..0000000000
--- a/resources/tools/disk-image-builder/nested/image-patches/07-isolate-cpu
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-patch boot/grub/menu.lst <<"_EOF"
-17c17
-< kernel /boot/bzImage rw root=/dev/sda1 rootwait ipv6.disable=1 console=ttyS0,115200n8
----
-> kernel /boot/bzImage rw root=/dev/sda1 rootwait ipv6.disable=1 console=ttyS0,115200n8 isolcpus=1,2,3,4 nohz_full=1,2,3,4 rcu_nocbs=1,2,3,4 intel_pstate=disable
-_EOF
diff --git a/resources/tools/disk-image-builder/nested/image-patches/08-virtio-disk b/resources/tools/disk-image-builder/nested/image-patches/08-virtio-disk
deleted file mode 100755
index 6e6feaecc5..0000000000
--- a/resources/tools/disk-image-builder/nested/image-patches/08-virtio-disk
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-patch boot/grub/menu.lst <<"_EOF"
-17c17
-< kernel /boot/bzImage rw root=/dev/sda1 rootwait ipv6.disable=1 console=ttyS0,115200n8 isolcpus=1,2,3,4 nohz_full=1,2,3,4 rcu_nocbs=1,2,3,4 intel_pstate=disable
----
-> kernel /boot/bzImage rw root=/dev/vda1 rootwait ipv6.disable=1 console=ttyS0,115200n8 isolcpus=1,2,3,4 nohz_full=1,2,3,4 rcu_nocbs=1,2,3,4 intel_pstate=disable noapic
-_EOF