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

Re: Vanilla kernel RPM?



Le mercredi 02 janvier 2008 à 18:51 -0500, Chuck Ebbert a écrit :
> On 12/22/2007 03:43 PM, Nicolas Mailhot wrote:

> > IIRC the spec logic relies on a special make oldconfig target which is
> > only available if the non-interactive oldconfig patch is applied on the
> > kernel. Which means this particular patch can not be skipped even in the
> > vanilla case.
> > 
> 
> That is what is does when you build a vanilla kernel from the fedora
> spec file 

Nope. That's what it does if you rebuild from a non-vanilla srpm. Since
this patch is in the %if !%{nopatches} like the others, it won't be
included in a vanilla srpm and won't build in mock (at least it was when
I posted the original message but I see someone just fixed it in cvs
without tracing the change in the log)

Anyway for people interested a can-build-mm patch for the latest cvs
spec is attached. Probably works for everything but the few mm kernels
released for a vanilla .0 version

-- 
Nicolas Mailhot
--- /tmp/fe/kernel/devel/kernel.spec	2008-01-02 23:34:28.000000000 +0100
+++ /tmp/kernel-nim.spec.clean	2008-01-03 11:11:51.000000000 +0100
@@ -28,6 +28,13 @@
 # which yields a base_sublevel of 21.
 %define base_sublevel 23
 
+# The mm snapshot level
+%define mmrev 0
+
+%if 0%{?mmrev}
+%define mmtag .mm%mmrev
+%endif
+
 ## If this is a released kernel ##
 %if 0%{?released_kernel}
 # Do we have a 2.6.21.y update to apply?
@@ -109,20 +116,26 @@
 # (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 myown.config
+
 # pkg_release is what we'll fill in for the rpm Release: field
 %if 0%{?released_kernel}
-%define pkg_release %{fedora_build}%{?buildid}%{?dist}
+%define pkg_release %{fedora_build}%{?mmtag}%{?buildid}%{?dist}
 %else
 %if 0%{?rcrev}
 %define rctag .rc%rcrev
 %endif
 %if 0%{?gitrev}
 %define gittag .git%gitrev
+%endif
 %if !0%{?rcrev}
 %define rctag .rc0
 %endif
+%if !0%{?mmrev}
+define mmtag .mm%mmrev
 %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
@@ -142,6 +155,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
@@ -488,6 +506,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
@@ -520,6 +542,7 @@
 Source90: config-sparc64-generic
 Source91: config-sparc64
 Source92: config-sparc64-smp
+%endif
 
 # Here should be only the patches up to the upstream canonical Linus tree.
 
@@ -535,11 +558,19 @@
 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
@@ -582,6 +613,7 @@
 Patch124: linux-2.6-gelic-fixups.patch
 Patch125: linux-2.6-gelic-wireless-v2.patch
 Patch126: linux-2.6-gelic-wireless-fix.patch
+Patch127: linux-2.6-oprofile-cell.patch
 Patch130: linux-2.6-powerpc-generic-suspend-001-pmu-no-lock-kernel.patch
 Patch131: linux-2.6-powerpc-generic-suspend-002-pmu-remove-dead-code.patch
 Patch132: linux-2.6-powerpc-generic-suspend-003-remove-adb-sleep-notifier.patch
@@ -653,6 +685,13 @@
 
 %endif
 
+# -mm hotfixes
+%if 0%{?mmrev}
+
+#Patch3000: bz9537-14267.patch
+
+%endif
+
 BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root-%{_target_cpu}
 
 %description
@@ -910,10 +949,13 @@
 # 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
-
  cd ..
 
 else
@@ -936,6 +978,7 @@
 ### BRANCH APPLY ###
 %endif
 
+%if "0%{?custom_config}" == "0"
 # Drop some necessary files from the source dir into the buildroot
 cp $RPM_SOURCE_DIR/config-* .
 cp %{SOURCE15} .
@@ -959,6 +1002,7 @@
     rm $i.tmp
   done
 %endif
+%endif
 
 # This patch adds a "make nonint_oldconfig" which is non-interactive and
 # also gives a list of missing options at the end. Useful for automated
@@ -1173,10 +1217,17 @@
 
 # ---------- below all scheduled for 2.6.24 -----------------
 
-# END OF PATCH APPLICATIONS
+%endif
+
+# -mm hotfixes
+%if 0%{?mmrev}
+
+ApplyPatch bz9537-14267.patch
 
 %endif
 
+# END OF PATCH APPLICATIONS
+
 # Any further pre-build tree manipulations happen here.
 
 chmod +x scripts/checkpatch.pl
@@ -1184,6 +1235,16 @@
 cp %{SOURCE10} Documentation/
 
 mkdir configs
+make -s mrproper
+
+%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
@@ -1205,6 +1266,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
@@ -1261,6 +1323,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 numériquement signée


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