kernel spec changes for custom mm builds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Are the following changes totally insane, or could they be considered
for merging?

(partially build-tested, got to the point the -mm build didn't like me,
I need to tweak my config file)

Regards,

-- 
Nicolas Mailhot
--- kernel.spec	2007-09-02 16:52:24.000000000 +0200
+++ kernel.spec.new	2007-09-02 16:57:40.000000000 +0200
@@ -48,6 +48,8 @@
 %define rcrev 5
 # The git snapshot level
 %define gitrev 0
+# The mm snapshot level
+%define mmrev 0
 # Set rpm version accordingly
 %define rpmversion 2.6.%{upstream_sublevel}
 %endif
@@ -113,6 +115,9 @@
 # (well, almost none, we need nonintconfig for build purposes). Default to 0 (off).
 %define with_vanilla %{?_with_vanilla: 1} %{?!_with_vanilla: 0}
 
+# Want to build a kernel using a custom config?
+#% define custom_config somefile
+
 # pkg_release is what we'll fill in for the rpm Release: field
 %if 0%{?released_kernel}
 %define pkg_release %{fedora_build}%{?buildid}%{?dist}
@@ -122,11 +127,15 @@
 %endif
 %if 0%{?gitrev}
 %define gittag .git%gitrev
+%else
+%if 0%{?mmrev}
+%define mmtag .mm%mmrev
+%endif
 %if !0%{?rcrev}
 %define rctag .rc0
 %endif
 %endif
-%define pkg_release 0.%{fedora_build}%{?rctag}%{?gittag}%{?buildid}%{?dist}
+%define pkg_release 0.%{fedora_build}%{?rctag}%{?gittag}%{?mmtag}%{?buildid}%{?dist}
 %endif
 
 # The kernel tarball/base version
@@ -147,6 +156,11 @@
 %define nopatches 0
 %endif
 
+# Trying to apply Fedora patches on -mm is an exercise in futility
+%if 0%{?mmrev}
+%define with_vanilla 1
+%endif
+
 %if %{with_vanilla}
 %define nopatches 1
 %endif
@@ -484,6 +498,10 @@
 Source14: find-provides
 Source15: merge.pl
 
+%if "0%{?custom_config}" != "0"
+Source19: %{custom_config}
+
+%else
 Source20: Makefile.config
 Source21: config-debug
 Source22: config-nodebug
@@ -516,6 +534,7 @@
 Source90: config-sparc64-generic
 Source91: config-sparc64
 Source92: config-sparc64-smp
+%endif
 
 %if %{using_upstream_branch}
 ### BRANCH PATCH ###
@@ -542,17 +561,27 @@
 Patch00: patch-2.6.%{upstream_sublevel}-rc%{rcrev}.bz2
 %if 0%{?gitrev}
 Patch01: patch-2.6.%{upstream_sublevel}-rc%{rcrev}-git%{gitrev}.bz2
+%else
+%if 0%{?mmrev}
+Patch01: ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.%{upstream_sublevel}-rc%{rcrev}/2.6.%{upstream_sublevel}-rc%{rcrev}-mm%{mmrev}/2.6.%{upstream_sublevel}-rc%{rcrev}-mm%{mmrev}.bz2
+%endif
 %endif
 %else
 # pre-{base_sublevel+1}-rc1 case
 %if 0%{?gitrev}
 Patch00: patch-2.6.%{base_sublevel}-git%{gitrev}.bz2
+%else
+%if 0%{?mmrev}
+Patch00: ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.%{upstream_sublevel}/2.6.%{upstream_sublevel}-mm%{mmrev}/2.6.%{upstream_sublevel}-mm%{mmrev}.bz2
+%endif
 %endif
 %endif
 %endif
 
 %endif
 
+Patch150: linux-2.6-build-nonintconfig.patch
+
 %if !%{nopatches}
 
 Patch20: linux-2.6-highres-timers.patch
@@ -587,7 +616,6 @@
 Patch134: linux-2.6-powerpc-generic-suspend-4-kill-pmu-sleep-notifier.patch
 Patch135: linux-2.6-powerpc-generic-suspend-5-pmu-pm_ops.patch
 Patch140: linux-2.6-pmac-zilog.patch
-Patch150: linux-2.6-build-nonintconfig.patch
 Patch160: linux-2.6-execshield.patch
 Patch170: linux-2.6-modsign-mpilib.patch
 Patch180: linux-2.6-modsign-crypto.patch
@@ -879,6 +907,7 @@
 
 cd linux-%{kversion}.%{_target_cpu}
 
+%if "0%{?custom_config}" == "0"
 # Drop some necessary files from the source dir into the buildroot
 cp $RPM_SOURCE_DIR/config-* .
 cp %{SOURCE15} .
@@ -902,6 +931,7 @@
     rm $i.tmp
   done
 %endif
+%endif
 
 patch_command='patch -p1 -F1 -s'
 ApplyPatch()
@@ -939,11 +969,19 @@
 ApplyPatch patch-2.6.%{upstream_sublevel}-rc%{rcrev}.bz2
 %if 0%{?gitrev}
 ApplyPatch patch-2.6.%{upstream_sublevel}-rc%{rcrev}-git%{gitrev}.bz2
+%else
+%if 0%{?mmrev}
+ApplyPatch 2.6.%{upstream_sublevel}-rc%{rcrev}-mm%{mmrev}.bz2
+%endif
 %endif
 %else
 # pre-{base_sublevel+1}-rc1 case
 %if 0%{?gitrev}
 ApplyPatch patch-2.6.%{base_sublevel}-git%{gitrev}.bz2
+%else
+%if 0%{?mmrev}
+ApplyPatch 2.6.%{upstream_sublevel}-mm%{mmrev}.bz2
+%endif
 %endif
 %endif
 %endif
@@ -1210,6 +1248,15 @@
 
 mkdir configs
 
+%if "0%{?custom_config}" != "0"
+cp %{SOURCE19} .config
+Arch=`head -1 .config | cut -b 3-`
+[ "$Arch" == "" ] && Arch=%{_target_cpu}
+make ARCH=$Arch %{oldconfig_target} > /dev/null
+echo "# $Arch" > configs/custom-kernel.config
+cat .config >> configs/custom-kernel.config
+%else
+
 # Remove configs not for the buildarch
 for cfg in kernel-%{version}-*.config; do
   if [ `echo %{all_arch_configs} | grep -c $cfg` -eq 0 ]; then
@@ -1230,6 +1277,7 @@
   echo "# $Arch" > configs/$i
   cat .config >> configs/$i
 done
+%endif
 
 # get rid of unwanted files resulting from patch fuzz
 find . \( -name "*.orig" -o -name "*~" \) -exec rm -f {} \; >/dev/null
@@ -1296,6 +1344,10 @@
       DevelLink=
     fi
 
+    %if "0%{?custom_config}" != "0"
+    Config=custom-kernel.config
+    %endif
+
     KernelVer=%{version}-%{release}$Flavour
     echo BUILDING A KERNEL FOR $Flavour %{_target_cpu}...
 

Attachment: signature.asc
Description: Ceci est une partie de message =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=

_______________________________________________
Fedora-kernel-list mailing list
Fedora-kernel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-kernel-list

[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux