From: davidplunkett Date: Thu, 23 May 2019 04:07:32 +0000 (+0000) Subject: add hugepages, kernel param, and vxlan support X-Git-Tag: 1.0.0~6 X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=852255121d64e3efd1e19ead0ef75322849728b1;p=redfish.git add hugepages, kernel param, and vxlan support Allow kernel parameters such as hugepage settings to be specific in the variable SRV_KERNEL_PARAMS and setup mount points for hugepages during first boot if hugepages is in the cmdline. Setup interface for VXLAN in firstboot template. Signed-off-by: davidplunkett Change-Id: I56c87c85d657df9e781c8077ea010fc2a01b6e2f Signed-off-by: davidplunkett --- diff --git a/firstboot-genesis.sh.template b/firstboot-genesis.sh.template index 87eaddf..fe21ec8 100644 --- a/firstboot-genesis.sh.template +++ b/firstboot-genesis.sh.template @@ -24,6 +24,20 @@ echo "Updating available packages" apt-get update apt-get install -y --install-recommends linux-generic-hwe-16.04 ipmitool +echo "Checking for hugepages" +if grep hugepages /proc/cmdline ; then + HUGEPAGESZ=$(grep -o 'hugepagesz=[^ ]*' /proc/cmdline | cut -f2 -d'=') + echo " Adding directory and mount for hugepages with size=$HUGEPAGESZ" + if [ -z "HUGEPAGESZ" ]; then + mkdir -p /dev/hugepages_$HUGEPAGESZ + echo "none /dev/hugepages_$HUGEPAGESZ hugetlbfs pagesize=$HUGEPAGESZ 0 0" >> /etc/fstab + else + mkdir -p /dev/hugepages + echo "none /dev/hugepages hugetlbfs 0 0" >> /etc/fstab + fi + mount -a +fi + # Adding 3 node cluster related changes swapoff --all ln -s /etc/apparmor.d/usr.sbin.ntpd /etc/apparmor.d/disable/ @@ -171,5 +185,26 @@ END fi fi +# Creating VXLAN interface + +if [ -n "@@SRV_VXLAN_INF@@" ]; then + echo "Configuring VXLAN Interface in the server" + tee -a /etc/network/interfaces << END + +# VXLAN +auto @@SRV_VXLAN_INF@@ +iface @@SRV_VXLAN_INF@@ inet static +address @@SRV_VXLAN_IP@@ + netmask 255.255.255.0 + mtu @@SRV_MTU@@ +END + ifup @@SRV_VXLAN_INF@@ + if [ $? -eq 0 ]; then + echo " VXLAN interface Created" + else + echo " Failed to create VXLAN Interface" + fi +fi + exit diff --git a/serverrc.template b/serverrc.template index b513bcf..fc8cd4d 100644 --- a/serverrc.template +++ b/serverrc.template @@ -43,6 +43,7 @@ SRV_HTTP_BOOT_DEV=NIC.Slot.3-1-1 # template to run to configure OS after first boot # current options are: firstboot.sh.template, firstboot-genesis.sh.tempate or firstboot-airship-iab.sh.template SRV_FIRSTBOOT_TEMPLATE=firstboot.sh.template +SRV_KERNEL_PARAMS= # VLAN to use during build and for final network configuration SRV_VLAN=41 diff --git a/ubuntu.seed.template b/ubuntu.seed.template index 22f1577..957645e 100644 --- a/ubuntu.seed.template +++ b/ubuntu.seed.template @@ -166,8 +166,9 @@ d-i preseed/late_command string \ in-target /bin/bash -c 'echo -n -e "auto @@SRV_BOND@@.@@SRV_VLAN@@\niface @@SRV_BOND@@.@@SRV_VLAN@@ inet static\n address @@SRV_IP@@\n netmask @@SRV_NETMASK@@\n" >> /etc/network/interfaces'; \ in-target /bin/bash -c 'echo -n -e " gateway @@SRV_GATEWAY@@\n dns-nameservers @@SRV_DNS@@\n dns-search @@SRV_DNSSEARCH@@\n vlan-raw-device @@SRV_BOND@@\n mtu @@SRV_MTU@@\n" >> /etc/network/interfaces'; \ in-target /bin/bash -c 'curl --noproxy "*" http://@@BUILD_WEBIP@@:@@BUILD_WEBPORT@@/sources.list > /etc/apt/sources.list'; \ - in-target /bin/bash -c 'curl --noproxy "*" http://@@BUILD_WEBIP@@:@@BUILD_WEBPORT@@/@@SRV_NAME@@.firstboot.sh > /root/@@SRV_NAME@@.firstboot.sh; chmod +x /root/@@SRV_NAME@@.firstboot.sh'; - + in-target /bin/bash -c 'curl --noproxy "*" http://@@BUILD_WEBIP@@:@@BUILD_WEBPORT@@/@@SRV_NAME@@.firstboot.sh > /root/@@SRV_NAME@@.firstboot.sh; chmod +x /root/@@SRV_NAME@@.firstboot.sh'; \ + in-target /bin/bash -c 'sed -i "s/GRUB_CMDLINE_LINUX=\"[^\"]*/& @@SRV_KERNEL_PARAMS@@/g" /etc/default/grub'; \ + in-target /bin/bash -c 'update-grub'; ### Finish # Reboot after the install is finished. d-i finish-install/reboot_in_progress note