SPECS (LINUX_2_6): kernel.spec - suffix -pae to alt_kernel if with...

zbyniu zbyniu at pld-linux.org
Tue May 6 09:44:46 CEST 2008


Author: zbyniu                       Date: Tue May  6 07:44:46 2008 GMT
Module: SPECS                         Tag: LINUX_2_6
---- Log message:
- suffix -pae to alt_kernel if with_pae
- additional symlinks in /boot if alt_kernel

---- Files affected:
SPECS:
   kernel.spec (1.441.2.1887 -> 1.441.2.1888) 

---- Diffs:

================================================================
Index: SPECS/kernel.spec
diff -u SPECS/kernel.spec:1.441.2.1887 SPECS/kernel.spec:1.441.2.1888
--- SPECS/kernel.spec:1.441.2.1887	Tue May  6 01:10:56 2008
+++ SPECS/kernel.spec	Tue May  6 09:44:40 2008
@@ -125,10 +125,7 @@
 %define		netfilter_snap		20070806
 %define		xen_version		3.0.2
 
-%define		__alt_kernel	%{?with_pax:-pax}%{?with_grsec_full:-grsecurity}%{?with_xen0:-xen0}%{?with_xenU:-xenU}%{?with_rescuecd:-rescuecd}
-%if "%{__alt_kernel}" != "-"
-%define		_alt_kernel	%{__alt_kernel}
-%endif
+%define		_alt_kernel	%{?with_pax:-pax}%{?with_grsec_full:-grsecurity}%{?with_xen0:-xen0}%{?with_xenU:-xenU}%{?with_rescuecd:-rescuecd}%{?with_pae:-pae}
 
 # kernel release (used in filesystem and eventually in uname -r)
 # modules will be looked from /lib/modules/%{kernel_release}
@@ -1394,7 +1391,7 @@
 perl %{SOURCE7} %{_kernelsrcdir} $KERNEL_BUILD_DIR
 
 # ghosted initrd
-touch $RPM_BUILD_ROOT/boot/initrd-%{kernel_release}.gz
+touch $RPM_BUILD_ROOT%{initrd_dir}/initrd-%{kernel_release}.gz
 
 # rpm obeys filelinkto checks for ghosted symlinks, convert to files
 rm -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
@@ -1410,19 +1407,27 @@
 
 %post
 %ifarch ia64
-mv -f /boot/efi/vmlinuz /boot/efi/vmlinuz.old 2> /dev/null > /dev/null
+mv -f /boot/efi/vmlinuz{,.old} 2> /dev/null
+%{?alt_kernel:mv -f /boot/efi/vmlinuz-%{alt_kernel}{,.old} 2> /dev/null}
 ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz
+%{?alt_kernel:ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz-%{alt_kernel}}
 %endif
-mv -f /boot/vmlinuz /boot/vmlinuz.old 2> /dev/null > /dev/null
-mv -f /boot/System.map /boot/System.map.old 2> /dev/null > /dev/null
+mv -f /boot/vmlinuz{,.old} 2> /dev/null
+%{?alt_kernel:mv -f /boot/vmlinuz-%{alt_kernel}{,.old} 2> /dev/null}
+mv -f /boot/System.map{,.old} 2> /dev/null
+%{?alt_kernel:mv -f /boot/System-%{alt_kernel}.map{,.old} 2> /dev/null}
 ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz
+%{?alt_kernel:ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz-%{alt_kernel}}
 ln -sf System.map-%{kernel_release} /boot/System.map
+%{?alt_kernel:ln -sf System.map-%{kernel_release} /boot/System.map}
 
 %depmod %{kernel_release}
 
-/sbin/geninitrd -f --initrdfs=rom %{initrd_dir}/initrd-%{kernel_release}.gz %{kernel_release}
-mv -f %{initrd_dir}/initrd %{initrd_dir}/initrd.old 2> /dev/null > /dev/null
+/sbin/geninitrd -f --initrdfs=rom %{initrd_dir}/initrd-%{kernel_release}.gz %{kernel_release}mv -f %{initrd_dir}/initrd{,.old} 2> /dev/null
+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}}
 
 if [ -x /sbin/new-kernel-pkg ]; then
 	if [ -f /etc/pld-release ]; then
@@ -1442,8 +1447,10 @@
 fi
 
 %post vmlinux
-mv -f /boot/vmlinux /boot/vmlinux.old 2> /dev/null > /dev/null
+mv -f /boot/vmlinux{,.old} 2> /dev/null
+%{?alt_kernel:mv -f /boot/vmlinux-%{alt_kernel}{,.old} 2> /dev/null}
 ln -sf vmlinux-%{kernel_release} /boot/vmlinux
+%{?alt_kernel:ln -sf vmlinux-%{kernel_release} /boot/vmlinux-%{alt_kernel}}
 
 %post libs
 %{_sbindir}/mkvmlinuz /boot/zImage-%{kernel_release} %{kernel_release}
@@ -1503,7 +1510,7 @@
 %endif
 /boot/vmlinuz-%{kernel_release}
 /boot/System.map-%{kernel_release}
-%ghost /boot/initrd-%{kernel_release}.gz
+%ghost %{initrd_dir}/initrd-%{kernel_release}.gz
 %dir /lib/modules/%{kernel_release}
 %dir /lib/modules/%{kernel_release}/kernel
 %ifnarch sparc
@@ -1709,6 +1716,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.441.2.1888  2008-05-06 07:44:40  zbyniu
+- suffix -pae to alt_kernel if with_pae
+- additional symlinks in /boot if alt_kernel
+
 Revision 1.441.2.1887  2008-05-05 23:10:56  zbyniu
 - up to 2.6.24.6
 - reverted "little fix for /boot symlinks (support alt_kernel, drop .old trash)" from rel 1.441.2.1862
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/kernel.spec?r1=1.441.2.1887&r2=1.441.2.1888&f=u



More information about the pld-cvs-commit mailing list