1
0
Fork 0

spec: fixed post scriptlet to work without grub

Resolves: rhbz#1265654

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
Jaroslav Škarvada 2015-09-24 11:06:32 +02:00
parent 7b4596ba21
commit 33f6bd10e4

View file

@ -147,8 +147,10 @@ rmdir %{buildroot}%{_sysconfdir}/grub.d
sed -i 's|.*/\([^/]\+\)/[^\.]\+\.conf|\1|' /etc/tuned/active_profile
# convert GRUB_CMDLINE_LINUX to GRUB_CMDLINE_LINUX_DEFAULT
sed -i 's/GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX \\$tuned_params"/GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT \\$tuned_params"/' \
%{_sysconfdir}/default/grub
if [ -r "%{_sysconfdir}/default/grub" ]; then
sed -i 's/GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX \\$tuned_params"/GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT \\$tuned_params"/' \
%{_sysconfdir}/default/grub
fi
%preun
@ -163,7 +165,9 @@ sed -i 's/GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX \\$tuned_params"/GRUB_CMDLINE_
if [ "$1" == 0 ]; then
rm -f %{_sysconfdir}/grub.d/00_tuned || :
# unpatch /etc/default/grub
sed -i '/GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT \\$tuned_params"/d' %{_sysconfdir}/default/grub
if [ -r "%{_sysconfdir}/default/grub" ]; then
sed -i '/GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT \\$tuned_params"/d' %{_sysconfdir}/default/grub
fi
fi