From fa3ccf4ce309ac0143c5afafc4ab8187bd0b4723 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 29 Jul 2016 15:11:16 +0200 Subject: add modules for infiniband/bootnet sysconfig scripts --- builder/bootnet-conf/module-setup.sh | 13 +++++++++++++ builder/bootnet-conf/scripts/gen-bootnet-conf.sh | 18 ++++++++++++++++++ builder/ib-conf/module-setup.sh | 13 +++++++++++++ builder/ib-conf/scripts/gen-ib-conf.sh | 24 ++++++++++++++++++++++++ packager/openslx.config | 2 +- 5 files changed, 69 insertions(+), 1 deletion(-) create mode 100755 builder/bootnet-conf/module-setup.sh create mode 100755 builder/bootnet-conf/scripts/gen-bootnet-conf.sh create mode 100755 builder/ib-conf/module-setup.sh create mode 100755 builder/ib-conf/scripts/gen-ib-conf.sh diff --git a/builder/bootnet-conf/module-setup.sh b/builder/bootnet-conf/module-setup.sh new file mode 100755 index 00000000..0a80d89e --- /dev/null +++ b/builder/bootnet-conf/module-setup.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +check() { + # Tell dracut that this module should only be included if it is required + # explicitly. + return 255 +} +depends() { + echo dnbd3-rootfs +} +install() { + inst_hook pre-pivot 50 "$moddir/scripts/gen-ib-conf.sh" +} diff --git a/builder/bootnet-conf/scripts/gen-bootnet-conf.sh b/builder/bootnet-conf/scripts/gen-bootnet-conf.sh new file mode 100755 index 00000000..ec82f143 --- /dev/null +++ b/builder/bootnet-conf/scripts/gen-bootnet-conf.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +type emergency_shell >/dev/null 2>&1 || source /lib/dracut-lib.sh + +mac="$(getargs BOOTIF=)" +mac="$(echo $mac | cut -c 4- | tr '-' ':')" +if [ -n "${mac}" ]; then + cat << EOF >> "${NEWROOT}/etc/sysconfig/network-scripts/ifcfg-bootnet" +DEVICE=bootnet +NAME=bootnet +HWADDR=${mac} +BOOTPROTO=dhcp +ONBOOT=yes +NM_CONTROLLED=yes +EOF +else + echo "Could not parse MAC" +fi diff --git a/builder/ib-conf/module-setup.sh b/builder/ib-conf/module-setup.sh new file mode 100755 index 00000000..0a80d89e --- /dev/null +++ b/builder/ib-conf/module-setup.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +check() { + # Tell dracut that this module should only be included if it is required + # explicitly. + return 255 +} +depends() { + echo dnbd3-rootfs +} +install() { + inst_hook pre-pivot 50 "$moddir/scripts/gen-ib-conf.sh" +} diff --git a/builder/ib-conf/scripts/gen-ib-conf.sh b/builder/ib-conf/scripts/gen-ib-conf.sh new file mode 100755 index 00000000..2d4b7a27 --- /dev/null +++ b/builder/ib-conf/scripts/gen-ib-conf.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +type emergency_shell >/dev/null 2>&1 || source /lib/dracut-lib.sh + +IPSUFFIX=$( + ip -4 -o addr show dev bootnet | \ + awk '{split($4,a,"/");split(a[1],b,".");print b[3]"."b[4]}' +) + +cat << EOF >> "${NEWROOT}/etc/sysconfig/network-scripts/ifcfg-ib0" +DEVICE=ib0 +NAME=ib0 +TYPE=Infiniband +BOOTPROTO=static +IPADDR=10.12.${IPSUFFIX} +BROADCAST=10.12.255.255 +NETWORK=10.12.0.0 +NETMASK=255.255.0.0 +ONBOOT=yes +NM_CONTROLLED=yes +CONNECTED_MODE=yes +MTU=65520 +EOF + diff --git a/packager/openslx.config b/packager/openslx.config index 0f785e1b..985ace1a 100644 --- a/packager/openslx.config +++ b/packager/openslx.config @@ -9,7 +9,7 @@ DEFAULT_RSYNC_OPTS="--acls \ --verbose" # default options used by rsync -DEFAULT_RSYNC_RSH="ssh -c blowfish -o StrictHostKeyChecking=no" +DEFAULT_RSYNC_RSH="ssh -c aes256-ctr -o StrictHostKeyChecking=no" # default size for the qcow2-container DEFAULT_CONTAINER_SIZE="20G" -- cgit v1.2.3-55-g7522