From: Marcin Krol Date: Fri, 4 Oct 2013 10:13:16 +0000 (+0000) Subject: - move initrd creation/boot loader update to posttrans X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=8bd21f839359075f609c9d51f5aab0744b540e9e;p=packages%2Fkernel.git - move initrd creation/boot loader update to posttrans --- diff --git a/kernel-vanilla.spec b/kernel-vanilla.spec index 3595bdf..f2a6d01 100644 --- a/kernel-vanilla.spec +++ b/kernel-vanilla.spec @@ -6,7 +6,7 @@ %define _basever 3.2 %define _postver .51 -%define _rel 1 +%define _rel 2 %define _enable_debug_packages 0 @@ -511,9 +511,10 @@ fi %post %depmod %{kernel_release} +%posttrans [ -f /etc/sysconfig/kernel ] && . /etc/sysconfig/kernel +# generate simple initramfs/initrd image if [[ "$USE_GENINITRD" != [Nn][Oo] ]]; then - # generate initrd after all dependant modules are installed /sbin/geninitrd -f %{initrd_dir}/initrd-%{kernel_release}.img %{kernel_release} fi @@ -523,11 +524,11 @@ if [[ "$USE_DRACUT" != [Nn][Oo] ]] && [ -x /sbin/dracut ]; then fi # update boot loader -[ -x /sbin/update-grub -a -f /etc/sysconfig/grub ] && . /etc/sysconfig/grub -if [[ "$UPDATE_GRUB" != [Nn][Oo] ]]; then - /sbin/update-grub +if [ -x /sbin/update-grub -a -f /etc/sysconfig/grub ]; then + if [ "$(. /etc/sysconfig/grub; echo ${UPDATE_GRUB:-no})" = "yes" ]; then + /sbin/update-grub >/dev/null + fi fi - if [ -x /sbin/new-kernel-pkg ]; then /sbin/new-kernel-pkg --initrdfile=%{initrd_dir}/initrd-%{kernel_release}.img --install %{kernel_release} --banner "TLD Linux %{alt_kernel}" fi