From 75f7cb2046cba9ad077a069d6ec4a88245b1f4aa Mon Sep 17 00:00:00 2001 From: Andrew Lukoshko Date: Fri, 4 Aug 2023 12:30:18 +0200 Subject: [PATCH] Create /etc/sysconfig/kernel if it's absent https://github.com/AlmaLinux/cloud-images/issues/154 --- SPECS/kernel.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SPECS/kernel.spec b/SPECS/kernel.spec index b7dcf22..8622201 100755 --- a/SPECS/kernel.spec +++ b/SPECS/kernel.spec @@ -3059,6 +3059,10 @@ if [ `uname -i` == "x86_64" -o `uname -i` == "i386" ] &&\ [ -f /etc/sysconfig/kernel ]; then\ /bin/sed -r -i -e 's/^DEFAULTKERNEL=%{-r*}$/DEFAULTKERNEL=kernel%{?-v:-%{-v*}}/' /etc/sysconfig/kernel || exit $?\ fi}\ +if [ ! -f /etc/sysconfig/kernel ]; then\ + echo DEFAULTKERNEL=kernel > /etc/sysconfig/kernel\ + echo UPDATEDEFAULT=yes >> /etc/sysconfig/kernel\ +fi\ mkdir -p %{_localstatedir}/lib/rpm-state/%{name}\ touch %{_localstatedir}/lib/rpm-state/%{name}/installing_core_%{KVERREL}%{?-v:+%{-v*}}\ %{nil}