From 59f17e5ee3730c23d43913487311ce7553861227 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Mon, 29 Jun 2020 14:01:12 +0200 Subject: [PATCH] Adding and using snippets/tpl.270.remove-uek.sh --- kickstart/template-oel7.ks | 5 +++++ snippets/tpl.270.remove-uek.sh | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 snippets/tpl.270.remove-uek.sh diff --git a/kickstart/template-oel7.ks b/kickstart/template-oel7.ks index 4ff768e..f8e754d 100644 --- a/kickstart/template-oel7.ks +++ b/kickstart/template-oel7.ks @@ -226,6 +226,11 @@ echo echo "Using snippet $pkgs_snippet" $SNIPPET($pkgs_snippet) +#set $remove_uek_snippet = "per_status/" + $SYSTEM_STATUS + "/tpl.270.remove-uek.sh" +echo +echo "Using snippet $remove_uek_snippet" +$SNIPPET($remove_uek_snippet) + #set $create_motd_snippet = "per_status/" + $SYSTEM_STATUS + "/tpl.300.create-motd.sh" echo echo "Using snippet $create_motd_snippet" diff --git a/snippets/tpl.270.remove-uek.sh b/snippets/tpl.270.remove-uek.sh new file mode 100644 index 0000000..b3e8d86 --- /dev/null +++ b/snippets/tpl.270.remove-uek.sh @@ -0,0 +1,25 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +remove_uek_packages() { + + echo + echo "${HASH_LINE}" + echo "Calling remove_uek_packages() ..." + echo + log "Switch kernel in /etc/sysconfig/kernel ..." + + sed -i -e 's/^\(DEFAULTKERNEL=\).*/\1kernel/i' /etc/sysconfig/kernel + + echo + log "Removing UEK packages ..." + + yum remove -y *-uek-* + +} + +remove_uek_packages + +#end raw +## vim: ts=4 et list -- 2.39.5