1 Summary: The Linux kernel (the core of the Linux operating system)
3 # Versions of various parts
6 # Polite request for people who spin their own kernel rpms:
7 # please modify the "release" field in a way that identifies
8 # that the kernel isn't the stock RHL kernel, for example by
9 # adding some text to the end of the version number.
11 %define kversion @KERNEL_VERSION@
12 %define kextraver @KERNEL_EXTRA_VERSION@
13 %define kextraverdelim @KERNEL_EXTRA_VERSION_DELIMITER@
14 %define release @KERNEL_RELEASE@
15 # /usr/src/%{kslnk} -> /usr/src/linux-%{KVERREL}
16 %define kslnk linux-2.4
18 # groups of related archs
19 %define all_x86 i386 i686 i586 athlon
20 #define all_x86 i686 i386 i586 athlon
22 %define nptlarchs %{all_x86}
23 #define nptlarchs noarch
24 %define rhbuild @RHBUILD@
25 %define susebuild @SUSEBUILD@
26 %define linux26 @LINUX26@
28 # disable build root strip policy
29 %define __spec_install_post /usr/lib/rpm/brp-compress || :
32 %define _missing_doc_files_terminate_build 0
33 %define _unpackaged_files_terminate_build 0
34 %define debug_package %{nil}
36 # Enable this to build a board-specific kernel configuration
37 # some architectures have LOTS of different setups and this
38 # is a way to deal with that cleanly.
40 #define targetboard assabet
41 %define dashtargetboard %{?targetboard:-%{targetboard}}
42 %define withtargetboard 0
43 %{?targetboard: %{expand: %%define withtargetboard 1}}
45 # Override generic defaults with per-arch defaults (which can
46 # themselves be overridden with --with/--without). These must
47 # ONLY be "0", never "1"
55 %define buildpseries64 0
63 %ifarch @BIGMEM_ARCHS@
71 %ifarch @JENSEN_ARCHS@
79 %ifarch @BIGSMP_ARCHS@
83 %ifarch @PSERIES64_ARCHS@
84 %define buildpseries64 1
91 # For board-specific kernels, build only the normal kernel (which may actually be smp, not up).
92 %if %{withtargetboard}
97 %define buildpseries64 0
102 Second, per-architecture exclusions (ifarch)
111 # we can't test values inline, only whether a macro exists
112 %{expand: %%define buildup_%{buildup} yadda}
113 %{expand: %%define buildsmp_%{buildsmp} yadda}
114 %{expand: %%define buildbigsmp_%{buildbigsmp} yadda}
115 %{expand: %%define buildpseries64_%{buildpseries64} yadda}
116 %{expand: %%define buildBOOT_%{buildBOOT} yadda}
117 %{expand: %%define buildbigmem_%{buildbigmem} yadda}
118 %{expand: %%define buildjensen_%{buildjensen} yadda}
119 %{expand: %%define ikd_%{ikd} yadda}
120 %{expand: %%define ibcs_%{ibcs} yadda}
121 %{expand: %%define debuglevel_%{debugging} yadda}
123 %{expand: %%define kernel_conflicts ppp <= 2.3.15, pcmcia-cs <= 3.1.20, isdn4k-utils <= 3.0, mount < 2.10r-5, nfs-utils < 0.3.1, cipe < 1.4.5, tux < 2.1.0, kudzu <= 0.92, e2fsprogs < 1.22, initscripts < 5.84, dev < 3.2-7, iptables < 1.2.5-3, bcm5820 < 1.81, nvidia-rh72 <= 1.0, oprofile < 0.4}
126 %define BOOT_kernel_prereq fileutils, modutils >= 2.4.18
127 %define kernel_prereq %{BOOT_kernel_prereq}, initscripts >= 5.83, mkinitrd >= 3.2.6
131 %define initrd_dir /boot/efi/redhat
133 %define initrd_dir /boot
136 %ifarch %{all_x86} x86_64
137 %define kernel_glob vmlinu?-%{KVERREL}
140 # <sigh>, no GLOB_BRACE for filelists, efi needs to be done separately
141 %define kernel_glob vmlinuz-%{KVERREL}
144 %define kernel_glob vmlinu?-%{KVERREL}
147 %define kernel_glob vmlinu?-%{KVERREL}
152 Release: %{release}%{?targetboard:%{targetboard}}%{?debuglevel_1:.dbg}
153 %define KVERREL %{PACKAGE_VERSION}%{kextraverdelim}%{kextraver}%{?targetboard:%{targetboard}}%{?debuglevel_1:.dbg}
155 Group: System Environment/Kernel
156 ExclusiveArch: %{all_x86} x86_64 ia64 ppc
158 Obsoletes: kernel-modules, kernel-sparc
159 Provides: kernel = %{version}
160 BuildConflicts: rhbuildsys(DiscFree) < 500Mb
161 %ifarch %{all_x86} ia64 x86_64
162 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
166 Prereq: %{kernel_prereq}
167 Conflicts: %{kernel_conflicts}
169 BuildPreReq: patch >= 2.5.4, bash >= 2.03, sh-utils, gnupg, tar
170 BuildPreReq: bzip2, findutils, dev, gzip, m4
173 Vendor: Cluster File Systems, Inc.
174 URL: http://www.kernel.org/
175 Buildroot: %{_tmppath}/%{name}-%{version}-root
177 Source0: @LUSTRE_SOURCE@
178 Source1: @KERNEL_SOURCE@
179 Source2: external-patches.tar.gz
181 Source15: linux-rhconfig.h
182 Source16: linux-merge-config.awk
183 Source17: linux-merge-modules.awk
185 Source25: suse-functions.sh
186 Source26: suse-post.sh
187 Source27: suse-postun.sh
188 Source28: suse-trigger-script.sh.in
189 Source29: sles8-post.sh
190 Source30: sles8-postun.sh
191 Source31: sles8-pre.sh
192 Source32: sles8-update_INITRD_MODULES.sh
193 Source33: sles8-update_rcfile_setting.sh
196 Summary: The source code for the Linux kernel.
197 Group: Development/System
200 Requires: gcc >= 2.96-98
204 Summary: Various documentation bits found in the kernel source.
208 The kernel package contains the Linux kernel (vmlinuz), the core of a
209 Linux operating system. The kernel handles the basic functions of the
210 operating system: memory allocation, process allocation, device input
214 The kernel-source package contains the source code files for the Linux
215 kernel. These source files are needed to build custom/third party device
216 drivers. The source files can also be used to build a custom kernel that is
217 better tuned to your particular hardware, if you are so inclined (and you
218 know what you're doing).
221 This package contains documentation files form the kernel
222 source. Various bits of information about the Linux kernel and the
223 device drivers shipped with it are documented in these files.
225 You'll want to install this package if you need a reference to the
226 options that can be passed to Linux kernel modules at load time.
229 Summary: The Linux kernel compiled for SMP machines.
230 Group: System Environment/Kernel
231 Provides: module-info, kernel = %{version}
232 %ifarch %{all_x86} ia64 x86_64
233 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
236 Prereq: %{kernel_prereq}
237 Conflicts: %{kernel_conflicts}
241 This package includes a SMP version of the Linux kernel. It is
242 required only on machines with two or more CPUs, although it should
243 work fine on single-CPU boxes.
245 Install the kernel-smp package if your machine uses two or more CPUs.
248 Summary: The Linux kernel compiled for SMP machines.
250 Provides: module-info, kernel = %{version}, k_smp4G
252 %ifarch %{all_x86} ia64 x86_64
253 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
256 Prereq: %{kernel_prereq}
257 Conflicts: %{kernel_conflicts}
261 This package includes a SMP version of the Linux kernel. It is
262 required only on machines with two or more CPUs, although it should
263 work fine on single-CPU boxes.
265 Install the kernel-bigsmp package if your machine uses two or more CPUs.
268 Summary: Standard Kernel for 64-bit Power based SMP and LPAR Machines
270 Provides: module-info, kernel = %{version}, k_smp4G
271 %ifarch %{all_x86} ia64 x86_64
272 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
275 Prereq: %{kernel_prereq}
276 Conflicts: %{kernel_conflicts}
279 %description pseries64
280 The standard kernel for Power3, Power4 and PowerPC 970 64-bit SMP
283 This kernel can be used for all 64bit RS/6000, pSeries and JS20
287 Summary: The Linux Kernel for machines with more than 4 Gigabyte of memory.
288 Group: System Environment/Kernel
289 Provides: module-info, kernel = %{version}
290 %ifarch %{all_x86} ia64 x86_64
291 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
294 Prereq: %{kernel_prereq}
295 Conflicts: %{kernel_conflicts}
296 Obsoletes: kernel-enterprise <= 2.4.10
300 This package includes a kernel that has appropriate configuration options
301 enabled for Pentium III machines with 4 Gigabyte of memory or more.
304 Summary: The version of the Linux kernel used on installation boot disks.
305 Group: System Environment/Kernel
306 Provides: kernel = %{version}
308 Prereq: %{BOOT_kernel_prereq}
309 Conflicts: %{kernel_conflicts}
313 This package includes a trimmed down version of the Linux kernel.
314 This kernel is used on the installation boot disks only and should not
315 be used for an installed system, as many features in this kernel are
316 turned off because of the size constraints.
319 Summary: The Linux kernel used on installation boot disks for SMP machines.
320 Group: System Environment/Kernel
321 Provides: kernel = %{version}
323 Prereq: %{BOOT_kernel_prereq}
324 Conflicts: %{kernel_conflicts}
328 This package includes a trimmed down version of the Linux kernel. This
329 kernel is used on the installation boot disks only and should not be used
330 for an installed system, as many features in this kernel are turned off
331 because of the size constraints. This kernel is used when booting SMP
332 machines that have trouble coming up to life with the uniprocessor kernel.
335 Summary: The Linux Kernel compiled for the Alpha Jensen platform.
336 Group: System Environment/Kernel
337 Provides: kernel = %{version}
339 Prereq: %{kernel_prereq}
340 Conflicts: %{kernel_conflicts}
344 This package includes a kernel that has appropriate configuration
345 options enabled for use on the Alpha Jensen platform. The Jensen
346 platform is not supported in the normal generic alpha kernel support.
348 %package -n lustre-lite-utils
349 Summary: Lustre utils for Linux
350 Group: Applications/System
352 %description -n lustre-lite-utils
353 The Lustre Lite file system utilities. This includes the tools needed
354 to configure, mount, and administer a Lustre filesystem. This package
355 is necessary if you want to access a Lustre filesystem.
357 # the lustre-doc files are just included as %doc with
360 #%package -n lustre-doc
361 #Summary: Sample Lustre configurations and documentation
362 #Group: Documentation
364 #%description -n lustre-doc
365 #The Lustre book, sample configurations, and other documentation for
368 # This is required in rpm >= 4.4.? and _should_ be set by the %setup macro
369 # but isn't, at least for 4.4.2. Yay RPM.
370 %define buildsubdir lustre-kernel-%{version}
371 %define _buildsubdir lustre-kernel-%{version}
374 %setup -n lustre-kernel-%{version} -q -c
375 if [ ! -d lustre ] ; then
376 ln -sf lustre* lustre
378 pushd lustre >/dev/null
379 if [ -s "%{SOURCE2}" ] ; then
380 tar zxf "%{SOURCE2}" -C lustre/kernel_patches
382 sh -x ./build/lmake \
384 --target @LUSTRE_TARGET@ \
385 --target-arch %{_target_cpu} \
386 --kerneldir $RPM_SOURCE_DIR
389 # handle both SuSE and Red Hat's new-kernel-pkg bits
390 for flavor in "" smp bigmem bigsmp pseries64 BOOT jensen ; do
391 for when in pre preun post postun ; do
392 script="${when}${flavor}.sh"
393 cat %{SOURCE25} %{SOURCE32} %{SOURCE33} > ${script}
394 echo "if [ -d /etc/susehelp.d ] ; then" >> ${script}
395 sed -e "s/@when@/$when/g" -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE28} >> ${script}
398 echo "if [ ! -f /etc/modprobe.conf ] ; then" >> ${script}
399 cat %{SOURCE31} >> ${script}
400 echo "fi" >> ${script}
403 # /sbin/update-modules.dep compares when the modules were built, rather
404 # than installed, so force modules.dep to be recreated
405 echo "rm -f /lib/modules/%{KVERREL}${flavor}/modules.dep" >> ${script}
406 echo "if [ -f /etc/modprobe.conf ] ; then" >> ${script}
407 sed -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE26} >> ${script}
409 echo "else" >> ${script}
410 sed -e "s^%ver_str^%{KVERREL}${flavor}^g" -e "s^%%{cfg_name}^${flavor}^g" %{SOURCE29} >> ${script}
411 echo "fi" >> ${script}
414 echo "if [ -f /etc/modprobe.conf ] ; then" >> ${script}
415 sed -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE27} >> ${script}
417 echo "else" >> ${script}
418 sed -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE30} >> ${script}
419 echo "fi" >> ${script}
422 echo "exit 0; fi" >> ${script}
425 if [ -z "${flavor}" ] ; then
426 cat >> ${script} <<EOF
429 ln -sf vmlinuz-%{KVERREL} vmlinuz
431 ln -sf System.map-%{KVERREL} System.map
432 ln -sf module-info-%{KVERREL} module-info
435 cat >> ${script} <<EOF
436 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
437 [ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
438 if [ -x /sbin/new-kernel-pkg ] ; then
439 if /sbin/new-kernel-pkg 2>&1 | grep package >/dev/null ; then
440 PACKAGE_ARG="--package kernel-${flavor}"
442 /sbin/new-kernel-pkg $PACKAGE_ARG --mkinitrd --depmod \
443 --install %{KVERREL}${flavor}
450 cat >> ${script} <<EOF
451 /sbin/modprobe loop 2>/dev/null >/dev/null || :
456 cat >> ${script} <<EOF
457 /sbin/modprobe loop 2> /dev/null > /dev/null || :
458 rm -f /lib/modules/%{KVERREL}${flavor}/modules.*
459 if [ -x /sbin/new-kernel-pkg ] ; then
460 /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}${flavor}
467 cat > "kernel$flavor.files" <<EOF
468 %%defattr(-, root, root)
469 /boot/%{kernel_glob}${flavor}
470 /boot/System.map-%{KVERREL}${flavor}
471 /boot/config-%{KVERREL}${flavor}
474 /lib/modules/%{KVERREL}${flavor}
476 /boot/efi/redhat/%{kernel_glob}${flavor}
480 /boot/Kerntypes-%{KVERREL}${flavor}
482 /boot/symvers-%{KVERREL}-%{_target_cpu}${flavor}.gz
488 cat > kernel-source.files <<EOF
489 %%defattr(-,root,root)
490 %%dir /usr/src/linux-%{KVERREL}
491 /usr/src/linux-%{KVERREL}/*
493 %%dir /usr/src/linux-%{KVERREL}-obj
494 /usr/src/linux-%{KVERREL}-obj/*
499 # if RPM_BUILD_NCPUS unset, set it
500 if [ -z "$RPM_BUILD_NCPUS" ] ; then
501 RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat || :)
502 if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
505 if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
510 rm -rf $RPM_BUILD_ROOT
511 mkdir -p $RPM_BUILD_ROOT
515 target_config=${1:+--target-config $1}
516 sh -x ./build/lmake \
518 --target @LUSTRE_TARGET@ \
519 --target-arch %{_target_cpu} \
521 --extraversion %{kextraver} \
527 target_config=${1:+--target-config $1}
528 sh -x ./build/lmake \
529 --build-kernel --build-lustre \
532 --target @LUSTRE_TARGET@ \
533 --target-arch %{_target_cpu} \
535 --extraversion %{kextraver} \
536 --kerneldir $RPM_SOURCE_DIR \
537 -j $RPM_BUILD_NCPUS \
538 --destdir $RPM_BUILD_ROOT \
545 target_config=${1:+--target-config $1}
546 sh -x ./build/lmake \
549 --target @LUSTRE_TARGET@ \
550 --target-arch %{_target_cpu} \
552 --extraversion %{kextraver} \
553 --kerneldir $RPM_SOURCE_DIR \
554 -j $RPM_BUILD_NCPUS \
555 --destdir $RPM_BUILD_ROOT \
557 --disable-doc --disable-tests \
558 --disable-modules --disable-liblustre \
559 --sysconfdir=%{_sysconfdir} \
560 --mandir=%{_mandir} \
566 sh -x ./build/lmake \
568 --target @LUSTRE_TARGET@ \
569 --target-arch %{_target_cpu} \
570 --extraversion %{kextraver} \
571 --destdir $RPM_BUILD_ROOT
574 pushd lustre >/dev/null
596 %if %{buildpseries64}
597 BuildKernel pseries64
611 pushd lustre >/dev/null
612 # it's already installed, so just clean up some things that are rpm
614 for i in $RPM_BUILD_ROOT/lib/modules/* ; do
617 # remove legacy pcmcia symlink that's no longer useful
622 # mark the vmlinux* non-executable to fool strip-to-file
623 chmod a-x $RPM_BUILD_ROOT/boot/vmlinux*
628 if [ $flavor = "up" ] ; then
635 perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = %{kextraverdelim}%{kextraver}${flavtgt}/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
636 c="$RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}"
637 o="${c}-obj/%{_target_cpu}/$flavor"
639 # use the one we just built
640 #cp ../lustre/kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@-%{_target_cpu}%{dashtargetboard}${flavext}.config \
641 cp .config $o/.config
642 for oc in oldconfig_nonint silentoldconfig oldconfig ; do
643 if grep -q "$oc" Makefile ; then
648 MAKE="make -s O=$o -C ${c}"
652 $MAKE "$MAKE_CC" $OLDCONFIG
654 rm -rf $o/.config.old $o/include/config
655 # Replace the Makefile in the object directory with a version
656 # that has relative path names. This is done by fixing the Makefile
657 # after the fact to work with 2.6.17 and newer mkmakefile.
658 read VERSION PATCHLEVEL SUBLEVEL <<-EOF
659 $(set -- 2.6.5 ; echo ${*//./ })
662 source scripts/mkmakefile \
663 ../../../linux-%{KVERREL} \
668 if [ -f $o/Makefile ] ; then
669 # will exist only for 2.6.17 and newer because mkmakefile
670 # now writes the makefile to $o instead of stdout
671 mv -f $o/Makefile $o/Makefile.in
673 sed -e "s^$o^../linux-%{KVERREL}-obj/%{_target_cpu}/$flavor^" \
674 $o/Makefile.in > $o/Makefile
675 zcat "$RPM_BUILD_ROOT/boot/symvers-%{KVERREL}-%{_target_cpu}${flavtgt}.gz" \
680 ## do -source package cleanup/install
682 if [ "%{buildbase}" -ne 0 ] ; then
683 pushd linux >/dev/null
684 mkdir -p $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
685 rm -f drivers/net/hamradio/soundmodem/gentbl scripts/mkdep
686 tar cf - . | tar xf - -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
687 ln -sf linux-%{KVERREL} $RPM_BUILD_ROOT/usr/src/linux
688 # install -m 644 %{SOURCE10} $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
690 #clean up the destination
691 make -s mrproper -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
692 rm -rf $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
693 mkdir -p $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
694 cp ../lustre/kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@*.config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
695 if [ "%{linux26}" -ne 0 ] ; then
696 # this only works because CFS only builds one kernel per target/arch per kernel-source rpm
697 objdir=$RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}-obj
699 if [ "%{buildbigmem}" -ne 0 ] ; then
702 if [ "%{buildBOOT}" -ne 0 ] ; then
705 if [ "%{buildjensen}" -ne 0 ] ; then
708 if [ "%{buildsmp}" -ne 0 ] ; then
711 if [ "%{buildbigsmp}" -ne 0 ] ; then
714 if [ "%{buildpseries64}" -ne 0 ] ; then
717 if [ "%{buildup}" -ne 0 ] ; then
720 perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = %{kextraverdelim}%{kextraver}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
721 # Remove $RPM_BUILD_ROOT prefix from symlinks.
722 for link in $(find $objdir -type l); do
723 target=$(readlink $link)
725 ln -s ${target/$RPM_BUILD_ROOT/} $link
728 perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = %{kextraverdelim}%{kextraver}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
729 # get the one from the build we just completed as it might have picked
731 #cp ../lustre/kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@-%{_target_cpu}%{dashtargetboard}.config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/.config
732 cp .config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/.config
733 for oc in oldconfig_nonint silentoldconfig oldconfig ; do
734 if grep -q "$oc" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile ; then
742 make "$MAKE_CC" -s $OLDCONFIG -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
743 make "$MAKE_CC" -s symlinks -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
744 make "$MAKE_CC" -s include/linux/version.h -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
746 #this generates modversions info which we want to include and we may as
747 #well include the depends stuff as well, after we fix the paths
748 make -s depend -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
749 find $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL} -name ".*depend" | \
752 sed -e "s|[^ ]*\(/usr/src/linux\)|\1|g" < $file.old > $file
756 # Try to put some smarter autoconf.h and version.h files in place
757 pushd $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/include/linux ; {
758 rm -rf modules modversions.h autoconf.h version.h
759 cat > modversions.h <<EOF
760 #ifndef _LINUX_MODVERSIONS_H
761 #define _LINUX_MODVERSIONS_H
762 #include <linux/rhconfig.h>
763 #include <linux/modsetver.h>
765 echo '#include <linux/rhconfig.h>' > autoconf.h
766 list=`find ../../savedheaders/* -name '*.ver' -exec basename '{}' \; | sort`
769 sed 's,$,modules/'$l, ../../savedheaders/list | awk -f %{SOURCE17} > modules/$l
770 touch -r modules/$l modules/`basename $l .ver`.stamp
771 echo '#include <linux/modules/'$l'>' >> modversions.h
773 echo '#endif' >> modversions.h
774 sed 's,$,autoconf.h,' ../../savedheaders/list | awk -f %{SOURCE16} >> autoconf.h
775 install -m 644 %{SOURCE15} rhconfig.h
776 echo "#include <linux/rhconfig.h>" >> version.h
778 for i in smp BOOT BOOTsmp bigmem bigsmp pseries64 up ; do
779 # When we build in an i386, we don't have an bigmem header directory
780 # in savedheaders/i386/bigmem. We also don't have a BOOT directory
781 # anywhere except in savedheaders/i386. So, we need to use this method
782 # of determining if a kernel version string needs to be included in the
784 verh=`echo ../../savedheaders/*/$i/version.h | awk ' { print $1 } '`
785 if [ -n "$verh" -a -f "$verh" ]; then
786 if [ "$i" = up ]; then
787 if [ "$keyword" = if ]; then
788 echo "#if 0" >> version.h
790 echo "#else" >> version.h
792 echo "#$keyword defined(__module__$i)" >> version.h
795 grep UTS_RELEASE $verh >> version.h
798 echo "#endif" >> version.h
799 if [ -f ../../savedheaders/%{_target_cpu}/up/version.h ] ; then
800 # keep to a standard normally
801 HEADER_FILE=../../savedheaders/%{_target_cpu}/up/version.h
803 # test build not including uniprocessor, must get info from somewhere
804 HEADER_FILE=$(ls ../../savedheaders/*/*/version.h | head -n 1)
806 grep -v UTS_RELEASE $HEADER_FILE >> version.h
807 rm -rf ../../savedheaders
809 touch $RPM_BUILD_ROOT/boot/kernel.h-%{kversion}
811 # rm -f $RPM_BUILD_ROOT/usr/include/linux
813 rm -rf $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/savedheaders
815 if [ "%{rhbuild}" -ne 0 ] ; then
816 # fix up the tmp_include_depends file wrt the buildroot
817 perl -p -i -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/tmp_include_depends
826 rm -rf $RPM_BUILD_ROOT
832 # do this for upgrades...in case the old modules get removed we have
833 # loopback in the kernel so that mkinitrd will work.
836 %pre smp -f presmp.sh
838 %pre bigsmp -f prebigsmp.sh
840 %pre pseries64 -f prepseries64.sh
842 %pre bigmem -f prebigmem.sh
846 %post pseries64 -f postpseries64.sh
848 %post smp -f postsmp.sh
850 %post bigsmp -f postbigsmp.sh
852 %post bigmem -f postbigmem.sh
854 %post jensen -f postjensen.sh
857 %post BOOT -f postBOOT.sh
861 %post -n lustre-lite-utils
862 if [ -f /etc/init.d/lustre ] ; then
863 /sbin/chkconfig --add lustre
864 /sbin/chkconfig --add lustrefs
867 # Allow clean removal of modules directory
870 %preun pseries64 -f preunpseries64.sh
872 %preun smp -f preunsmp.sh
874 %preun bigsmp -f preunbigsmp.sh
876 %preun bigmem -f preunbigmem.sh
878 %preun BOOT -f preunBOOT.sh
880 %preun jensen -f preunjensen.sh
882 # suse needs these i guess
885 %postun pseries64 -f postunpseries64.sh
887 %postun smp -f postunsmp.sh
889 %postun bigsmp -f postunbigsmp.sh
891 %postun bigmem -f postunbigmem.sh
893 %postun BOOT -f postunBOOT.sh
895 %postun jensen -f postunjensen.sh
897 # We need this here because we don't prereq kudzu; it could be
898 # installed after the kernel
900 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
902 %triggerin smp -- kudzu
903 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
905 %triggerin bigsmp -- kudzu
906 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
908 %triggerin pseries64 -- kudzu
909 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
911 %triggerin bigmem -- kudzu
912 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
914 %triggerin BOOT -- kudzu
915 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
917 %triggerin jensen -- kudzu
918 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
921 # Old kernel-headers packages owned include symlinks; new
922 # ones just make them so that we can have multiple kernel-headers
923 # packages installed.
925 %triggerpostun source -- kernel-headers < 2.2.16
928 ln -snf linux-%{KVERREL} %{kslnk}
934 ln -snf linux-%{KVERREL} %{kslnk}
937 if [ -L /usr/src/%{kslnk} ]; then
938 if [ -L /usr/src/%{kslnk} -a `ls -ld /usr/src/%{kslnk} 2>/dev/null| awk '{ print $11 }'` = "linux-%{KVERREL}" ]; then
939 [ $1 = 0 ] && rm -f /usr/src/%{kslnk}
944 %preun -n lustre-lite-utils
945 if [ $1 = 0 -a -f /etc/init.d/lustre ]; then
946 /sbin/chkconfig --del lustre
947 /sbin/chkconfig --del lustrefs
955 %files -f kernel.files
959 %files smp -f kernelsmp.files
963 %files bigsmp -f kernelbigsmp.files
966 %if %{buildpseries64}
967 %files pseries64 -f kernelpseries64.files
971 %files bigmem -f kernelbigmem.files
975 %files BOOT -f kernelBOOT.files
979 %files source -f kernel-source.files