aboutsummaryrefslogtreecommitdiffstats
path: root/install.sh
diff options
context:
space:
mode:
authorBrijesh Singh <brijesh.singh@amd.com>2020-04-23 11:04:02 -0500
committerBrijesh Singh <brijesh.singh@amd.com>2020-04-23 11:09:53 -0500
commit654f67300bdf847d5b16f3a75e4b1714c36e1e35 (patch)
tree5e78459d60c88ac12417c80e85a187417acdd121 /install.sh
parentf1bdac7e7dc1f569c6624da7901aa2607461e8d6 (diff)
downloadcachepc-amdsev-654f67300bdf847d5b16f3a75e4b1714c36e1e35.tar.gz
cachepc-amdsev-654f67300bdf847d5b16f3a75e4b1714c36e1e35.zip
add option to create install package
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/install.sh b/install.sh
new file mode 100755
index 0000000..0d30a65
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+# This will install all the dependent packages for qemu and ovmf to run
+if [ "$ID_LIKE" = "debian" ]; then
+ apt-get -y install qemu ovmf
+else
+ dnf install qemu edk2-ovmf
+fi
+
+if [ "$ID_LIKE" = "debian" ]; then
+ dpkg -i linux/linux-image-*.deb
+else
+ rpm -ivh linux/kernel-*.rpm
+fi
+
+# update grub.cfg to disable THP
+if ! grep "transparent_hugepage=never" /etc/default/grub >/dev/null; then
+ orig_cmdline="`grep GRUB_CMDLINE_LINUX /etc/default/grub | cut -f2- -d=`"
+ cmdline="${orig_cmdline::-1}"
+ cmdline="${cmdline:1}"
+ cmdline="${cmdline} transparent_hugepage=never"
+
+ sed -i "/GRUB_CMDLINE_LINUX/c\GRUB_CMDLINE_LINUX=\"${cmdline}\"" /etc/default/grub
+
+ if [ "$ID_LIKE" = "debian" ]; then
+ update-grub2
+ else
+ grub2-mkconfig
+ fi
+fi
+
+#
+cp kvm.conf /etc/modprobe.d/
+
+echo
+echo "Reboot the host and select the SNP kernel"
+echo