]> TLD Linux GIT Repositories - packages/kernel.git/commitdiff
- cosmetics in posttrans
authorMarcin Krol <hawk@tld-linux.org>
Fri, 4 Oct 2013 10:08:55 +0000 (10:08 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Fri, 4 Oct 2013 10:08:55 +0000 (10:08 +0000)
kernel-vanilla.spec

index e5fdbfb40aec577102ff2f7244a264238061a1df..99138dba13dbc421e73ec990c4a4b5c07fa9c52d 100644 (file)
@@ -526,8 +526,8 @@ fi
 
 %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 --initrdfs=initramfs %{initrd_dir}/initrd-%{kernel_release}.img %{kernel_release}
 fi
 
@@ -537,9 +537,10 @@ if [[ "$USE_DRACUT" != [Nn][Oo] ]] && [ -x /sbin/dracut ]; then
 fi
 
 # update boot loaders
-[ -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: %{alt_kernel}}"