packages (LINUX_2_6_27): kernel/kernel.spec - add grub2 hook, generate init...

glen glen at pld-linux.org
Sat May 8 19:35:02 CEST 2010


Author: glen                         Date: Sat May  8 17:35:02 2010 GMT
Module: packages                      Tag: LINUX_2_6_27
---- Log message:
- add grub2 hook, generate initrd in %posttrans

---- Files affected:
packages/kernel:
   kernel.spec (1.441.2.2036.2.57 -> 1.441.2.2036.2.58) 

---- Diffs:

================================================================
Index: packages/kernel/kernel.spec
diff -u packages/kernel/kernel.spec:1.441.2.2036.2.57 packages/kernel/kernel.spec:1.441.2.2036.2.58
--- packages/kernel/kernel.spec:1.441.2.2036.2.57	Sat May  8 19:28:16 2010
+++ packages/kernel/kernel.spec	Sat May  8 19:34:55 2010
@@ -5,6 +5,9 @@
 # - apparmor (needs testing)
 # - add a subpackage (kernel-firmware?) for ~35 firmware files
 #
+# LATEST VERSION CHECKER:
+# curl -s http://www.kernel.org/kdist/finger_banner | grep 2.6.27
+#
 # FUTURE:
 # - update xen patch
 # - pom-ng quake3-conntrack-nat -> nf_conntrack ?
@@ -1372,17 +1375,24 @@
 
 %depmod %{kernel_release}
 
+%posttrans
+# generate initrd after all dependant modules are installed
 /sbin/geninitrd -f --initrdfs=rom %{initrd_dir}/initrd-%{kernel_release}.gz %{kernel_release}
 mv -f %{initrd_dir}/initrd{,.old} 2> /dev/null
 %{?alt_kernel:mv -f %{initrd_dir}/initrd%{_alt_kernel}{,.old} 2> /dev/null}
 ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd
 %{?alt_kernel:ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd%{_alt_kernel}}
 
+# update boot loaders when old package files are gone from filesystem
+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
-	title="PLD Linux (%{pld_release})%{?alt_kernel: / %{alt_kernel}}"
-
-	/sbin/new-kernel-pkg --initrdfile=%{initrd_dir}/initrd-%{kernel_release}.gz --install %{kernel_release} --banner "$title"
-elif [ -x /sbin/rc-boot ]; then
+	/sbin/new-kernel-pkg --initrdfile=%{initrd_dir}/initrd-%{kernel_release}.gz --install %{kernel_release} --banner "PLD Linux (%{pld_release})%{?alt_kernel: / %{alt_kernel}}"
+fi
+if [ -x /sbin/rc-boot ]; then
 	/sbin/rc-boot 1>&2 || :
 fi
 
@@ -1677,6 +1687,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.441.2.2036.2.58  2010/05/08 17:34:55  glen
+- add grub2 hook, generate initrd in %posttrans
+
 Revision 1.441.2.2036.2.57  2010/05/08 17:28:16  glen
 - up to 2.6.27.46
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/kernel/kernel.spec?r1=1.441.2.2036.2.57&r2=1.441.2.2036.2.58&f=u



More information about the pld-cvs-commit mailing list