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/
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
# 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
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