shared /boot support. bz 197065

Jarod Wilson jwilson at redhat.com
Tue Mar 25 16:54:07 UTC 2008


On Tuesday 25 March 2008 12:49:28 pm Jarod Wilson wrote:
> On Tuesday 25 March 2008 08:58:00 am Thorsten Leemhuis wrote:
> > On 25.03.2008 13:47, Jarod Wilson wrote:
> > > On Tuesday 25 March 2008 02:02:04 am Thorsten Leemhuis wrote:
> > >> On 24.03.2008 20:53, Jarod Wilson wrote:
> > >>> On Monday 24 March 2008 03:32:37 pm Dave Jones wrote:
> > >>>> I took a stab at bz 197065 and arrived at the patch below.
> > >>>> Would appreciate some eyeballs before I commit from people
> > >>>> familiar with the macro goo in the specfile. (Hi Roland!)
[...]
> Test build up and running:
>
> [root at xenon x86_64]# ls /boot/*.x86_64*
> /boot/config-2.6.25-0.152.rc6.git7.fc9.x86_64
> /boot/initrd-2.6.25-0.152.rc6.git7.fc9.x86_64.img
> /boot/System.map-2.6.25-0.152.rc6.git7.fc9.x86_64
> /boot/vmlinuz-2.6.25-0.152.rc6.git7.fc9.x86_64
>
> [root at xenon x86_64]# uname -r
> 2.6.25-0.152.rc6.git7.fc9.x86_64
>
> [root at xenon x86_64]# ls /lib/modules/
> 2.6.25-0.152.rc6.git7.fc9.x86_64
>
> [root at xenon x86_64]# ls /usr/src/kernels/
> 2.6.25-0.152.rc6.git7.fc9.x86_64

And here's the patch I came up with for the above:

Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.536
diff -u -p -r1.536 kernel.spec
--- kernel.spec	25 Mar 2008 03:19:46 -0000	1.536
+++ kernel.spec	25 Mar 2008 16:52:04 -0000
@@ -135,7 +135,7 @@ Summary: The Linux kernel (the core of t
 %define xen_target vmlinuz
 %define xen_image vmlinuz
 
-%define KVERREL %{PACKAGE_VERSION}-%{PACKAGE_RELEASE}
+%define KVERREL %{PACKAGE_VERSION}-%{PACKAGE_RELEASE}.%{_target_cpu}
 %define hdrarch %_target_cpu
 
 %if 0%{!?nopatches:1}
@@ -1243,11 +1243,11 @@ BuildKernel() {
     # Pick the right config file for the kernel we're building
     if [ -n "$Flavour" ] ; then
       Config=kernel-%{version}-%{_target_cpu}-$Flavour.config
-      DevelDir=/usr/src/kernels/%{KVERREL}-$Flavour-%{_target_cpu}
-      DevelLink=/usr/src/kernels/%{KVERREL}$Flavour-%{_target_cpu}
+      DevelDir=/usr/src/kernels/%{KVERREL}-$Flavour
+      DevelLink=/usr/src/kernels/%{KVERREL}$Flavour
     else
       Config=kernel-%{version}-%{_target_cpu}.config
-      DevelDir=/usr/src/kernels/%{KVERREL}-%{_target_cpu}
+      DevelDir=/usr/src/kernels/%{KVERREL}
       DevelLink=
     fi
 
@@ -1259,11 +1259,11 @@ BuildKernel() {
       CopyKernel=cp
     fi
 
-    KernelVer=%{version}-%{release}$Flavour
+    KernelVer=%{version}-%{release}$Flavour.%{_target_cpu}
     echo BUILDING A KERNEL FOR $Flavour %{_target_cpu}...
 
     # make sure EXTRAVERSION says what we want it to say
-    perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = %{?stablerev}-%{release}$Flavour/" Makefile
+    perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = %{?stablerev}-%{release}$Flavour.
%{_target_cpu}/" Makefile
 
     # if pre-rc1 devel kernel, must fix up SUBLEVEL for our versioning scheme
     %if !0%{?rcrev}
@@ -1585,7 +1585,7 @@ then\
 fi\
 if [ "$HARDLINK" != "no" -a -x /usr/sbin/hardlink ]\
 then\
-    (cd /usr/src/kernels/%{KVERREL}-%{?1:%{1}-}%{_target_cpu} &&\
+    (cd /usr/src/kernels/%{KVERREL}%{?1:-%{1}} &&\
      /usr/bin/find . -type f | while read f; do\
        hardlink -c /usr/src/kernels/*.fc*-*/$f $f\
      done)\
@@ -1719,8 +1719,8 @@ fi
 %{?-e:%{-e*}}\
 %{expand:%%files %{?2:%{2}-}devel}\
 %defattr(-,root,root)\
-%verify(not mtime) /usr/src/kernels/%{KVERREL}%{?2:-%{2}}-%{_target_cpu}\
-/usr/src/kernels/%{KVERREL}%{?2}-%{_target_cpu}\
+%verify(not mtime) /usr/src/kernels/%{KVERREL}%{?2:-%{2}}\
+/usr/src/kernels/%{KVERREL}%{?2}\
 %if %{with_debuginfo}\
 %ifnarch noarch\
 %if %{fancy_debuginfo}\
@@ -1734,7 +1734,7 @@ fi
 %{debuginfodir}/%{elf_image_install_path}/*-%{KVERREL}%{?2}.debug\
 %endif\
 %{debuginfodir}/lib/modules/%{KVERREL}%{?2}\
-%{debuginfodir}/usr/src/kernels/%{KVERREL}%{?2:-%{2}}-%{_target_cpu}\
+%{debuginfodir}/usr/src/kernels/%{KVERREL}%{?2:-%{2}}\
 %endif\
 %endif\
 %endif\


-- 
Jarod Wilson
jwilson at redhat.com




More information about the Fedora-kernel-list mailing list