rpms/kernel/F-13 kernel.spec,1.2049,1.2050

Jarod Wilson jwilson at fedoraproject.org
Tue Jun 1 15:35:55 UTC 2010


Author: jwilson

Update of /cvs/pkgs/rpms/kernel/F-13
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv16624

Modified Files:
	kernel.spec 
Log Message:
* Tue Jun 01 2010 Jarod Wilson <jarod at redhat.com>
- Wire up all s390{,x} bits to match RHEL6 kernel spec

Locally build-tested on x86_64 w/o any regressions, will get dan to try
an s390 build to make sure everything's good to go before adding to
other branches too.



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-13/kernel.spec,v
retrieving revision 1.2049
retrieving revision 1.2050
diff -u -p -r1.2049 -r1.2050
--- kernel.spec	27 May 2010 01:51:57 -0000	1.2049
+++ kernel.spec	1 Jun 2010 15:35:54 -0000	1.2050
@@ -271,12 +271,11 @@ Summary: The Linux kernel
 %define with_smp 0
 %endif
 
-# only build kernel-kdump on ppc64
-# (no relocatable kernel support upstream yet)
-#FIXME: Temporarily disabled to speed up builds.
-#ifnarch ppc64
+%ifarch s390x
+%define with_kdump 1
+%else
 %define with_kdump 0
-#endif
+%endif
 
 # don't do debug builds on anything but i686 and x86_64
 %ifnarch i686 x86_64
@@ -334,10 +333,17 @@ Summary: The Linux kernel
 %define kernel_image_elf 1
 %endif
 
+%ifarch s390
+%define all_arch_configs kernel-%{version}-s390*.config
+%define image_install_path boot
+%define make_target image
+%define kernel_image arch/s390/boot/image
+%endif
+
 %ifarch s390x
 %define asmarch s390
 %define hdrarch s390
-%define all_arch_configs kernel-%{version}-s390x.config
+%define all_arch_configs kernel-%{version}-s390x*.config
 %define image_install_path boot
 %define make_target image
 %define kernel_image arch/s390/boot/image
@@ -515,7 +521,7 @@ Version: %{rpmversion}
 Release: %{pkg_release}
 # DO NOT CHANGE THE 'ExclusiveArch' LINE TO TEMPORARILY EXCLUDE AN ARCHITECTURE BUILD.
 # SET %%nobuildarches (ABOVE) INSTEAD
-ExclusiveArch: noarch %{all_x86} x86_64 ppc ppc64 ia64 sparc sparc64 s390x alpha alphaev56 %{arm}
+ExclusiveArch: noarch %{all_x86} x86_64 ppc ppc64 ia64 sparc sparc64 s390 s390x alpha alphaev56 %{arm}
 ExclusiveOS: Linux
 
 %kernel_reqprovconf
@@ -539,6 +545,10 @@ BuildRequires: sparse >= 0.4.1
 BuildRequires: elfutils-libelf-devel zlib-devel binutils-devel libdwarf-devel
 %endif
 BuildConflicts: rhbuildsys(DiskFree) < 500Mb
+%ifarch s390x
+# Ensure glibc{,-devel} is installed so zfcpdump can be built
+BuildRequires: glibc-static
+%endif
 
 %define fancy_debuginfo 0
 %if %{with_debuginfo}
@@ -1648,9 +1658,16 @@ BuildKernel() {
     Arch=`head -1 .config | cut -b 3-`
     echo USING ARCH=$Arch
 
+    if [ "$Arch" == "s390" -a "$Flavour" == "kdump" ]; then
+        pushd arch/s390/boot
+        gcc -static -o zfcpdump zfcpdump.c
+        popd
+    fi
     make -s ARCH=$Arch %{oldconfig_target} > /dev/null
     make -s ARCH=$Arch V=1 %{?_smp_mflags} $MakeTarget %{?sparse_mflags}
-    make -s ARCH=$Arch V=1 %{?_smp_mflags} modules %{?sparse_mflags} || exit 1
+    if [ "$Arch" != "s390" -o "$Flavour" != "kdump" ]; then
+        make -s ARCH=$Arch V=1 %{?_smp_mflags} modules %{?sparse_mflags} || exit 1
+    fi
 
 %if %{with_perftool}
     pushd tools/perf
@@ -1687,7 +1704,11 @@ BuildKernel() {
     mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer
     # Override $(mod-fw) because we don't want it to install any firmware
     # We'll do that ourselves with 'make firmware_install'
-    make -s ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_install KERNELRELEASE=$KernelVer mod-fw=
+    if [ "$Arch" != "s390" -o "$Flavour" != "kdump" ]; then
+        make -s ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_install KERNELRELEASE=$KernelVer mod-fw=
+    else
+        mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/{kernel,extra}
+    fi
 %ifarch %{vdso_arches}
     make -s ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT vdso_install KERNELRELEASE=$KernelVer
     if grep '^CONFIG_XEN=y$' .config >/dev/null; then
@@ -1854,8 +1875,12 @@ BuildKernel %make_target %kernel_image s
 %endif
 
 %if %{with_kdump}
+%ifarch s390x
+BuildKernel %make_target %kernel_image kdump
+%else
 BuildKernel vmlinux vmlinux kdump vmlinux
 %endif
+%endif
 
 %if %{with_doc}
 # Make the HTML and man pages.
@@ -2071,6 +2096,25 @@ fi}\
 %kernel_variant_post -v PAEdebug -r (kernel|kernel-smp|kernel-xen)
 %kernel_variant_preun PAEdebug
 
+%ifarch s390x
+%postun kdump
+    # Create softlink to latest remaining kdump kernel.
+    # If no more kdump kernel is available, remove softlink.
+    if [ "$(readlink /boot/zfcpdump)" == "/boot/vmlinuz-%{KVERREL}.kdump" ]
+    then
+        vmlinuz_next=$(ls /boot/vmlinuz-*.kdump 2> /dev/null | sort | tail -n1)
+        if [ $vmlinuz_next ]
+        then
+            ln -sf $vmlinuz_next /boot/zfcpdump
+        else
+            rm -f /boot/zfcpdump
+        fi
+    fi
+
+%post kdump
+    ln -sf /boot/vmlinuz-%{KVERREL}.kdump /boot/zfcpdump
+%endif
+
 if [ -x /sbin/ldconfig ]
 then
     /sbin/ldconfig -X || exit $?
@@ -2185,12 +2229,19 @@ fi
 %kernel_variant_files %{with_debug} debug
 %kernel_variant_files %{with_pae} PAE
 %kernel_variant_files %{with_pae_debug} PAEdebug
+%ifarch s390x
+%kernel_variant_files %{with_kdump} kdump
+%else
 %kernel_variant_files -k vmlinux %{with_kdump} kdump
+%endif
 
 # plz don't put in a version string unless you're going to tag
 # and build.
 
 %changelog
+* Tue Jun 01 2010 Jarod Wilson <jarod at redhat.com>
+- Wire up all s390{,x} bits to match RHEL6 kernel spec
+
 * Wed May 27 2010 Chuck Ebbert <cebbert at redhat.com>  2.6.33.5-112
 - CVE-2010-1437: keyrings: find_keyring_by_name() can gain the freed keyring
 



More information about the scm-commits mailing list