summaryrefslogtreecommitdiffstats
path: root/build/setkernelparam.sh
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2016-05-24 15:41:51 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-05-24 15:41:51 +0000
commit5fec80057dbd799d52a4c1ff2f35a1c8cc5ad6ea (patch)
treefb621e88b7ad9bdd8d6b1edbecdcde1ff85ea5a0 /build/setkernelparam.sh
parentcefd51c360e3d3c4bc160844a467255d84c9f16c (diff)
parentfb0f275cd373aec28a8a970ced0f1d20ca8abbfc (diff)
Merge "Add pinning support"
Diffstat (limited to 'build/setkernelparam.sh')
-rw-r--r--build/setkernelparam.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/build/setkernelparam.sh b/build/setkernelparam.sh
new file mode 100644
index 00000000..b6986d6c
--- /dev/null
+++ b/build/setkernelparam.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+##############################################################################
+# Copyright (c) 2016 Red Hat Inc.
+# Michael Chapman <michapma@redhat.com>
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+GRUBCONF='/boot/grub2/grub.conf'
+
+if [ "$1" == "" ]; then
+ echo "No kernel parameter name provided, not modifying grub.conf"
+ exit 1
+fi
+
+if [ "$2" == "" ]; then
+ echo "No kernel parameter value provided, not modifying grub.conf"
+ exit 1
+fi
+
+echo "Setting $1=$2 in $GRUBCONF"
+echo "GRUB_CMDLINE_LINUX=\"\$GRUB_CMDLINE_LINUX $1=$2\"" >> /etc/default/grub
+grub2-mkconfig > $GRUBCONF
+exit 0