spec: fixed post scriptlet to work without grub
Resolves: rhbz#1265654 Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
parent
7b4596ba21
commit
33f6bd10e4
1 changed files with 7 additions and 3 deletions
10
tuned.spec
10
tuned.spec
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue