SPECS (LINUX_2_6_22): kernel.spec - merge module-build symlinks, a...
glen
glen at pld-linux.org
Mon Mar 31 23:44:34 CEST 2008
Author: glen Date: Mon Mar 31 21:44:34 2008 GMT
Module: SPECS Tag: LINUX_2_6_22
---- Log message:
- merge module-build symlinks, alt_kernel macro unify, kabi/vermagic macros from LINUX_2_6_16
- switch to initramfs by default
---- Files affected:
SPECS:
kernel.spec (1.441.2.1796.2.68 -> 1.441.2.1796.2.69)
---- Diffs:
================================================================
Index: SPECS/kernel.spec
diff -u SPECS/kernel.spec:1.441.2.1796.2.68 SPECS/kernel.spec:1.441.2.1796.2.69
--- SPECS/kernel.spec:1.441.2.1796.2.68 Mon Mar 17 23:12:57 2008
+++ SPECS/kernel.spec Mon Mar 31 23:44:28 2008
@@ -103,8 +103,8 @@
%define _prepatch %{nil}
%define _pre_rc %{nil}
%define _rc %{nil}
-%define _rel 5
-%define subname %{?with_pax:-pax}%{?with_grsec_full:-grsecurity}%{?with_xen0:-xen0}%{?with_xenU:-xenU}
+# NB! pay attention to KABI macro
+%define _rel 5.1
%define _enable_debug_packages 0
@@ -113,12 +113,27 @@
%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}
+%if "%{__alt_kernel}" != ""
+%define alt_kernel %{__alt_kernel}
+%endif
+
+# kernel release (used in filesystem and eventually in uname -r)
+# modules will be looked from /lib/modules/%{kernel_release}
+# _localversion is just that without version for "> localversion"
+%define _localversion %{KABI}
+%define kernel_release %{version}%{?alt_kernel:_%{alt_kernel}}-%{_localversion}
+
+# Our Kernel ABI, increase this when you want the out of source modules being rebuilt
+# Usually same as %{_rel}
+%define KABI 5
+
Summary: The Linux kernel (the core of the Linux operating system)
Summary(de.UTF-8): Der Linux-Kernel (Kern des Linux-Betriebssystems)
Summary(et.UTF-8): Linuxi kernel (ehk operatsioonisüsteemi tuum)
Summary(fr.UTF-8): Le Kernel-Linux (La partie centrale du systeme)
Summary(pl.UTF-8): Jądro Linuksa
-Name: kernel%{subname}
+Name: kernel%{_alt_kernel}
%if "%{_prepatch}" == "%{nil}"
Version: %{_basever}%{_postver}
@@ -414,6 +429,7 @@
Requires: geninitrd >= 2.57
Requires: module-init-tools >= 0.9.9
Provides: %{name}(netfilter) = %{netfilter_snap}
+Provides: %{name}(vermagic) = %{kernel_release}
%if %{with xen0} || %{with xenU}
Provides: kernel(xen) = %{_xen_version}
%endif
@@ -457,12 +473,7 @@
%define initrd_dir /boot
%endif
-# kernel release (used in filesystem and eventually in uname -r)
-# modules will be looked from /lib/modules/%{kernel_release}
-# _localversion is just that without version for "> localversion"
-%define _localversion %{release}
-%define kernel_release %{version}%{subname}-%{_localversion}
-%define _kernelsrcdir /usr/src/linux%{subname}-%{version}
+%define _kernelsrcdir /usr/src/linux%{_alt_kernel}-%{version}
%if "%{_target_base_arch}" != "%{_arch}"
%define CrossOpts ARCH=%{_target_base_arch} CROSS_COMPILE=%{_target_cpu}-pld-linux-
@@ -1018,7 +1029,7 @@
%endif
# Fix EXTRAVERSION in main Makefile
-sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{_postver}%{subname}#g' Makefile
+sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{_postver}%{?alt_kernel:_%{alt_kernel}}#g' Makefile
# on sparc this line causes CONFIG_INPUT=m (instead of =y), thus breaking build
sed -i -e '/select INPUT/d' net/bluetooth/hidp/Kconfig
@@ -1427,6 +1438,9 @@
# ghosted initrd
touch $RPM_BUILD_ROOT/boot/initrd-%{kernel_release}.gz
+install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}
+rm -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
+touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
%clean
rm -rf $RPM_BUILD_ROOT
@@ -1450,7 +1464,7 @@
%depmod %{kernel_release}
-/sbin/geninitrd -f --initrdfs=rom %{initrd_dir}/initrd-%{kernel_release}.gz %{kernel_release}
+/sbin/geninitrd -f --initrdfs=initramfs %{initrd_dir}/initrd-%{kernel_release}.gz %{kernel_release}
mv -f %{initrd_dir}/initrd %{initrd_dir}/initrd.old 2> /dev/null > /dev/null
ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd
@@ -1461,7 +1475,7 @@
title='PLD Linux'
fi
- ext='%{?with_pax:pax}%{?with_grsec_full:grsecurity}%{?with_xen0:Xen0}%{?with_xenU:XenU}'
+ ext='%{__alt_kernel}'
if [ "$ext" ]; then
title="$title $ext"
fi
@@ -1503,17 +1517,26 @@
%depmod %{kernel_release}
%post headers
-ln -snf %{basename:%{_kernelsrcdir}} %{_prefix}/src/linux%{subname}
+ln -snf %{basename:%{_kernelsrcdir}} %{_prefix}/src/linux%{_alt_kernel}
%postun headers
if [ "$1" = "0" ]; then
- if [ -L %{_prefix}/src/linux%{subname} ]; then
- if [ "$(readlink %{_prefix}/src/linux%{subname})" = "linux%{subname}-%{version}" ]; then
- rm -f %{_prefix}/src/linux%{subname}
+ if [ -L %{_prefix}/src/linux%{_alt_kernel} ]; then
+ if [ "$(readlink %{_prefix}/src/linux%{_alt_kernel})" = "linux%{_alt_kernel}-%{version}" ]; then
+ rm -f %{_prefix}/src/linux%{_alt_kernel}
fi
fi
fi
+%triggerin module-build -- %{name} = %{epoch}:%{version}-%{release}
+ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/build
+ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/source
+
+%triggerun module-build -- %{name} = %{epoch}:%{version}-%{release}
+if [ "$1" = 0 ]; then
+ rm -f /lib/modules/%{kernel_release}/{build,source}
+fi
+
%files
%defattr(644,root,root,755)
%ifarch sparc sparc64
@@ -1569,6 +1592,9 @@
%exclude /lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko*
%endif
%ghost /lib/modules/%{kernel_release}/modules.*
+# symlinks pointing to kernelsrcdir
+%ghost /lib/modules/%{kernel_release}/build
+%ghost /lib/modules/%{kernel_release}/source
%dir %{_sysconfdir}/modprobe.d/%{kernel_release}
%ifarch alpha %{ix86} %{x8664} ppc ppc64 sparc sparc64
@@ -1716,6 +1742,10 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.441.2.1796.2.69 2008-03-31 21:44:28 glen
+- merge module-build symlinks, alt_kernel macro unify, kabi/vermagic macros from LINUX_2_6_16
+- switch to initramfs by default
+
Revision 1.441.2.1796.2.68 2008-03-17 22:12:57 zbyniu
- fbsplash bcond repaired
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/kernel.spec?r1=1.441.2.1796.2.68&r2=1.441.2.1796.2.69&f=u
More information about the pld-cvs-commit
mailing list