SPECS: kernel-desktop.spec - %prep, %build from kernel-vanilla bui...

glen glen at pld-linux.org
Sat Mar 1 14:47:47 CET 2008


Author: glen                         Date: Sat Mar  1 13:47:47 2008 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- %prep, %build from kernel-vanilla build system

---- Files affected:
SPECS:
   kernel-desktop.spec (1.167 -> 1.168) 

---- Diffs:

================================================================
Index: SPECS/kernel-desktop.spec
diff -u SPECS/kernel-desktop.spec:1.167 SPECS/kernel-desktop.spec:1.168
--- SPECS/kernel-desktop.spec:1.167	Sat Mar  1 13:36:12 2008
+++ SPECS/kernel-desktop.spec	Sat Mar  1 14:47:41 2008
@@ -83,6 +83,11 @@
 # Source0-md5:	3f23ad4b69d0a552042d1ed0f4399857
 Source1:	http://www.kernel.org/pub/linux/kernel/v2.6/patch-%{version}.bz2
 # Source1-md5:	4c42be33a7d98f280588c9d28478cdfd
+Source19:	kernel-vanilla-module-build.pl
+Source20:	kernel-config.py
+Source21:	kernel-config-update.py
+Source22:	kernel-multiarch.make
+
 Source2:	http://www.tuxonice.net/downloads/all/suspend2-%{suspend_version}-for-%{suspend_kernel}.patch.bz2
 # Source2-md5:	f98f071b0f4e7897296d643854bb809f
 Source3:	%{pname}-autoconf.h
@@ -275,12 +280,22 @@
 %{expand:%%define	__cpp	%(echo '%__cpp' | sed -e 's,-gcc,-gcc4,')}
 %endif
 
+%ifarch %{ix86} %{x8664}
+%define		target_arch_dir	x86
+%else
+%define		target_arch_dir	%{_target_base_arch}
+%endif
+
 # No ELF objects there to strip (skips processing 27k files)
 %define		_noautostrip	.*%{_kernelsrcdir}/.*
 %define		_noautochrpath	.*%{_kernelsrcdir}/.*
 
 %define		initrd_dir	/boot
 
+%define		topdir	%{_builddir}/%{name}-%{version}
+%define		srcdir	%{topdir}/linux-%{_basever}
+%define		objdir	%{topdir}/o
+
 # 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"
@@ -522,12 +537,22 @@
 Documentation.
 
 %prep
-%setup -q -n linux-%{_basever}%{_rc}
+%setup -qc
+install -d o/scripts
+ln -s %{SOURCE19} o/scripts/kernel-module-build.pl
+ln -s %{SOURCE20} o/scripts/kernel-config.py
+ln -s %{SOURCE21} o/scripts/kernel-config-update.py
+ln -s %{SOURCE22} Makefile
 
+cd linux-%{_basever}
 %if "%{_postver}" != "%{nil}"
 %{__bzip2} -dc %{SOURCE1} | %{__patch} -p1 -s
 %endif
 
+# Fix EXTRAVERSION in main Makefile
+sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{_postver}_%{alt_kernel}#g' Makefile
+
+%if 0
 # suspend 2
 %{__bzip2} -dc %{SOURCE2} | %{__patch} -p1 -s
 
@@ -663,116 +688,138 @@
 %endif
 %patch105 -p1
 %patch106 -p1
+%endif
 
-# Fix EXTRAVERSION in main Makefile
-sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{_postver}_%{alt_kernel}#g' Makefile
+%build
+cat > multiarch.make <<'EOF'
+# generated by %{name}.spec
+KERNELSRC		:= %{_builddir}/%{name}-%{version}/linux-%{_basever}
+KERNELOUTPUT	:= %{objdir}
+
+SRCARCH		:= %{target_arch_dir}
+ARCH		:= %{_target_base_arch}
+Q			:= %{!?with_verbose:@}
+MAKE_OPTS	:= %{MakeOpts}
 
-sed -i -e '/select INPUT/d' net/bluetooth/hidp/Kconfig
+CONFIGS += %{_sourcedir}/%{pname}-common.config
+CONFIGS += %{_sourcedir}/%{pname}-%{_target_base_arch}.config
 
-%build
-KERNEL_BUILD_DIR=$(pwd)
+# preempt
+%if %{with preemptrt}
+CONFIGS += %{_sourcedir}/%{pname}-preempt-rt.config
+%else
+CONFIGS += %{_sourcedir}/%{pname}-preempt-nort.config
+%endif
 
-Config="%{_target_base_arch}"
+# suspend 2
+CONFIGS += %{_sourcedir}/%{pname}-suspend2.config
+
+# fbsplash, vesafb-tng, squashfs, imq, tahoe, atm, reiser4
+CONFIGS += %{_sourcedir}/%{pname}-patches.config
 
-cat %{_sourcedir}/%{pname}-common.config > .config
-cat %{_sourcedir}/%{pname}-$Config.config >> .config
-echo "CONFIG_LOCALVERSION=\"-%{_localversion}\"" >> .config
+# netfilter
+CONFIGS += %{_sourcedir}/%{pname}-netfilter.config
+
+%if %{with grsec_minimal}
+CONFIGS += %{_sourcedir}/%{pname}-grsec.config
+%endif
+
+# wrr
+CONFIGS += %{_sourcedir}/%{pname}-wrr.config
+
+%if %{with bootsplash}
+	CONFIGS += %{_sourcedir}/%{pname}-bootsplash.config
+%else
+	CONFIGS += %{_sourcedir}/%{pname}-fbsplash.config
+%endif
+
+# config where we ignore timestamps
+CONFIG_NODEP += %{objdir}/.kernel-autogen.conf
+EOF
+
+# update config at spec time
+# if you have config file, add it to above Makefile
+pykconfig() {
+	set -x
+	echo '# %{name}.spec overrides'
+	echo 'LOCALVERSION="-%{_localversion}"'
+
+	%{?debug:echo '# debug options'}
+	%{?debug:echo 'DEBUG_SLAB=y'}
+	%{?debug:echo 'DEBUG_PREEMPT=y'}
+	%{?debug:echo 'RT_DEADLOCK_DETECT=y'}
 
 %ifarch %{ix86}
-	%ifnarch i386
-	sed -i 's:CONFIG_M386=y:# CONFIG_M386 is not set:' .config
+	echo '# x86 tuneup'
+	%ifarch i386
+	echo 'M386=y'
+	echo 'X86_F00F_BUG=y'
 	%endif
 	%ifarch i486
-	sed -i 's:# CONFIG_M486 is not set:CONFIG_M486=y:' .config
+	echo 'M486=y'
+	echo 'X86_F00F_BUG=y'
 	%endif
 	%ifarch i586
-	sed -i 's:# CONFIG_M586 is not set:CONFIG_M586=y:' .config
+	echo 'M586=y'
+	echo 'X86_F00F_BUG=y'
 	%endif
 	%ifarch i686
-	sed -i 's:# CONFIG_M686 is not set:CONFIG_M686=y:' .config
+	echo 'M686=y'
 	%endif
 	%ifarch pentium3
-	sed -i 's:# CONFIG_MPENTIUMIII is not set:CONFIG_MPENTIUMIII=y:' .config
+	echo 'MPENTIUMIII=y'
 	%endif
 	%ifarch pentium4
-	sed -i 's:# CONFIG_MPENTIUM4 is not set:CONFIG_MPENTIUM4=y:' .config
+	echo 'MPENTIUM4=y'
 	%endif
 	%ifarch athlon
-	sed -i 's:# CONFIG_MK7 is not set:CONFIG_MK7=y:' .config
+	echo 'MK7=y'
+	echo 'X86_PPRO_FENCE='
+	echo 'X86_USE_3DNOW=y'
 	%endif
 	%ifarch i686 athlon pentium3 pentium4
-# This issues 'CPU too old' error on Centrino processors
-# http://lkml.org/lkml/2007/9/18/301
-#	sed -i "s:CONFIG_HIGHMEM4G=y:# CONFIG_HIGHMEM4G is not set:" .config
-#	sed -i "s:# CONFIG_HIGHMEM64G is not set:CONFIG_HIGHMEM64G=y\nCONFIG_X86_PAE=y:" .config
-	sed -i 's:CONFIG_MATH_EMULATION=y:# CONFIG_MATH_EMULATION is not set:' .config
+	%if %{with pae}
+		echo 'HIGHMEM4G=n'
+		echo 'HIGHMEM64G=y'
+		echo 'X86_PAE=y'
+	%endif
+	%endif
+	%ifarch i686 athlon pentium3 pentium4
+	# This issues 'CPU too old' error on Centrino processors
+	# http://lkml.org/lkml/2007/9/18/301
+#	echo 'HIGHMEM4G=n'
+#	echo 'HIGHMEM64G=y'
+#	echo 'X86_PAE=y:'
+	echo 'MATH_EMULATION=n'
 	%endif
 %endif
 
-# preempt
-%if %{with preemptrt}
-cat %{_sourcedir}/%{pname}-preempt-rt.config >> .config
-%else
-cat %{_sourcedir}/%{pname}-preempt-nort.config >> .config
-%endif
-
-# suspend 2
-cat %{_sourcedir}/%{pname}-suspend2.config >> .config
-
-# fbsplash, vesafb-tng, squashfs, imq, tahoe, atm, reiser4
-cat %{_sourcedir}/%{pname}-patches.config >> .config
-
-# netfilter
-cat %{_sourcedir}/%{pname}-netfilter.config >> .config
-
-%if %{with grsec_minimal}
-cat %{_sourcedir}/%{pname}-grsec.config >> .config
-%endif
-
-# wrr
-cat %{_sourcedir}/%{pname}-wrr.config >> .config
-
-%ifarch %{ix86}
-%ifnarch i386
-sed -e "s:CONFIG_NO_HZ=y:# CONFIG_NO_HZ is not set:" \
-	-e "s:# CONFIG_HZ_1000 is not set:CONFIG_HZ_1000=y:" \
-	-e "s:# CONFIG_HZ is not set:CONFIG_HZ=1000:"			\
-	-i .config
-%endif
-%endif
-
-%if %{with laptop}
-sed -e "s:CONFIG_HZ_1000=y:# CONFIG_HZ_1000 is not set:"	\
-	-e "s:# CONFIG_HZ_100 is not set:CONFIG_HZ_100=y:"	\
-	-e "s:CONFIG_HZ=1000:CONFIG_HZ=100:"			\
-	-i .config
-%endif
+	%ifnarch i386
+		echo 'NO_HZ=n'
+		echo 'HZ_1000=y'
+		echo 'HZ=1000'
+	%endif
 
-%if %{with bootsplash}
-	cat %{_sourcedir}/%{pname}-bootsplash.config >> .config
-%else
-	cat %{_sourcedir}/%{pname}-fbsplash.config >> .config
-%endif
+	%if %{with laptop}
+		echo 'HZ_1000=n'
+		echo 'HZ_100=y'
+		echo 'HZ=100'
+	%endif
 
-%{?debug:sed -i "s:# CONFIG_DEBUG_SLAB is not set:CONFIG_DEBUG_SLAB=y:" .config}
-%{?debug:sed -i "s:# CONFIG_DEBUG_PREEMPT is not set:CONFIG_DEBUG_PREEMPT=y:" .config}
-%{?debug:sed -i "s:# CONFIG_RT_DEADLOCK_DETECT is not set:CONFIG_RT_DEADLOCK_DETECT=y:" .config}
+	# disable e1000 on ppc (ICEs)
+	%ifarch ppc ppc64
+		echo 'E1000=n'
+		echo 'E1000_NAPI=n'
+		echo 'E1000_DISABLE_PACKET_SPLIT=n'
+	%endif
+}
 
-# disable e1000 on ppc (ICEs)
-%ifarch ppc ppc64
-sed -e "s:CONFIG_E1000=m:# CONFIG_E1000 is not set:" \
-	-e "s:CONFIG_E1000_NAPI=y:# CONFIG_E1000_NAPI is not set:" \
-	-e "s:CONFIG_E1000_DISABLE_PACKET_SPLIT=y:# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set:" \
-	-i .config
-%endif
+# generate .config and kernel.conf
+pykconfig > %{objdir}/.kernel-autogen.conf
+%{__make} pykconfig
 
-rm -f include/linux/autoconf.h
-%{__make} %{MakeOpts} silentoldconfig
-install .config arch/%{_target_base_arch}/defconfig
-
-# Build kernel
-%{__make} %{MakeOpts} \
-	%{?with_verbose:V=1}
+# build kernel
+%{__make} all
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -1074,6 +1121,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.168  2008-03-01 13:47:41  glen
+- %prep, %build from kernel-vanilla build system
+
 Revision 1.167  2008-03-01 12:36:12  glen
 - 2.6.24.3 source
 
================================================================

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



More information about the pld-cvs-commit mailing list