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 flavordelim "@KERNEL_TARGET_DELIMITER@"
15 %define release @KERNEL_RELEASE@
16 # /usr/src/%{kslnk} -> /usr/src/linux-%{KVERREL}
17 %define kslnk linux-2.4
19 # groups of related archs
20 %define all_x86 i386 i686 i586 athlon
21 #define all_x86 i686 i386 i586 athlon
23 %define nptlarchs %{all_x86}
24 #define nptlarchs noarch
25 %define rhbuild @RHBUILD@
26 %define susebuild @SUSEBUILD@
27 %define linux26 @LINUX26@
29 # disable build root strip policy
30 %define __spec_install_post /usr/lib/rpm/brp-compress || :
33 %define _missing_doc_files_terminate_build 0
34 %define _unpackaged_files_terminate_build 0
35 %define debug_package %{nil}
37 # Enable this to build a board-specific kernel configuration
38 # some architectures have LOTS of different setups and this
39 # is a way to deal with that cleanly.
41 #define targetboard assabet
42 %define dashtargetboard %{?targetboard:-%{targetboard}}
43 %define withtargetboard 0
44 %{?targetboard: %{expand: %%define withtargetboard 1}}
46 # Override generic defaults with per-arch defaults (which can
47 # themselves be overridden with --with/--without). These must
48 # ONLY be "0", never "1"
56 %define buildpseries64 0
64 %ifarch @BIGMEM_ARCHS@
72 %ifarch @JENSEN_ARCHS@
80 %ifarch @BIGSMP_ARCHS@
84 %ifarch @PSERIES64_ARCHS@
85 %define buildpseries64 1
92 # For board-specific kernels, build only the normal kernel (which may actually be smp, not up).
93 %if %{withtargetboard}
98 %define buildpseries64 0
103 Second, per-architecture exclusions (ifarch)
112 # we can't test values inline, only whether a macro exists
113 %{expand: %%define buildup_%{buildup} yadda}
114 %{expand: %%define buildsmp_%{buildsmp} yadda}
115 %{expand: %%define buildbigsmp_%{buildbigsmp} yadda}
116 %{expand: %%define buildpseries64_%{buildpseries64} yadda}
117 %{expand: %%define buildBOOT_%{buildBOOT} yadda}
118 %{expand: %%define buildbigmem_%{buildbigmem} yadda}
119 %{expand: %%define buildjensen_%{buildjensen} yadda}
120 %{expand: %%define ikd_%{ikd} yadda}
121 %{expand: %%define ibcs_%{ibcs} yadda}
122 %{expand: %%define debuglevel_%{debugging} yadda}
124 %{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}
127 %define BOOT_kernel_prereq fileutils, modutils >= 2.4.18
128 %define kernel_prereq %{BOOT_kernel_prereq}, initscripts >= 5.83, mkinitrd >= 3.2.6
132 %define initrd_dir /boot/efi/redhat
134 %define initrd_dir /boot
137 %ifarch %{all_x86} x86_64
138 %define kernel_glob vmlinu?-%{KVERREL}
141 # <sigh>, no GLOB_BRACE for filelists, efi needs to be done separately
142 %define kernel_glob vmlinuz-%{KVERREL}
145 %define kernel_glob vmlinu?-%{KVERREL}
148 %define kernel_glob vmlinu?-%{KVERREL}
153 Release: %{release}%{?targetboard:%{targetboard}}%{?debuglevel_1:.dbg}
154 %define KVERREL %{PACKAGE_VERSION}%{kextraverdelim}%{kextraver}%{?targetboard:%{targetboard}}%{?debuglevel_1:.dbg}
156 Group: System Environment/Kernel
157 ExclusiveArch: %{all_x86} x86_64 ia64 ppc
159 Obsoletes: kernel-modules, kernel-sparc
160 Provides: kernel = %{version}
161 BuildConflicts: rhbuildsys(DiscFree) < 500Mb
162 %ifarch %{all_x86} ia64 x86_64
163 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
167 Prereq: %{kernel_prereq}
168 Conflicts: %{kernel_conflicts}
170 BuildPreReq: patch >= 2.5.4, bash >= 2.03, sh-utils, gnupg, tar
171 BuildPreReq: bzip2, findutils, dev, gzip, m4
174 Vendor: Cluster File Systems, Inc.
175 URL: http://www.kernel.org/
176 Buildroot: %{_tmppath}/%{name}-%{version}-root
178 Source0: @LUSTRE_SOURCE@
179 Source1: @KERNEL_SOURCE@
180 Source2: external-patches.tar.gz
182 Source15: linux-rhconfig.h
183 Source16: linux-merge-config.awk
184 Source17: linux-merge-modules.awk
186 Source25: suse-functions.sh
187 Source26: suse-post.sh
188 Source27: suse-postun.sh
189 Source28: suse-trigger-script.sh.in
190 Source29: sles8-post.sh
191 Source30: sles8-postun.sh
192 Source31: sles8-pre.sh
193 Source32: sles8-update_INITRD_MODULES.sh
194 Source33: sles8-update_rcfile_setting.sh
197 Summary: The source code for the Linux kernel.
198 Group: Development/System
201 Requires: gcc >= 2.96-98
205 Summary: Various documentation bits found in the kernel source.
209 The kernel package contains the Linux kernel (vmlinuz), the core of a
210 Linux operating system. The kernel handles the basic functions of the
211 operating system: memory allocation, process allocation, device input
215 The kernel-source package contains the source code files for the Linux
216 kernel. These source files are needed to build custom/third party device
217 drivers. The source files can also be used to build a custom kernel that is
218 better tuned to your particular hardware, if you are so inclined (and you
219 know what you're doing).
222 This package contains documentation files form the kernel
223 source. Various bits of information about the Linux kernel and the
224 device drivers shipped with it are documented in these files.
226 You'll want to install this package if you need a reference to the
227 options that can be passed to Linux kernel modules at load time.
230 Summary: The Linux kernel compiled for SMP machines.
231 Group: System Environment/Kernel
232 Provides: module-info, kernel = %{version}
233 %ifarch %{all_x86} ia64 x86_64
234 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
237 Prereq: %{kernel_prereq}
238 Conflicts: %{kernel_conflicts}
242 This package includes a SMP version of the Linux kernel. It is
243 required only on machines with two or more CPUs, although it should
244 work fine on single-CPU boxes.
246 Install the kernel-smp package if your machine uses two or more CPUs.
249 Summary: The Linux kernel compiled for SMP machines.
251 Provides: module-info, kernel = %{version}, k_smp4G
253 %ifarch %{all_x86} ia64 x86_64
254 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
257 Prereq: %{kernel_prereq}
258 Conflicts: %{kernel_conflicts}
262 This package includes a SMP version of the Linux kernel. It is
263 required only on machines with two or more CPUs, although it should
264 work fine on single-CPU boxes.
266 Install the kernel-bigsmp package if your machine uses two or more CPUs.
269 Summary: Standard Kernel for 64-bit Power based SMP and LPAR Machines
271 Provides: module-info, kernel = %{version}, k_smp4G
272 %ifarch %{all_x86} ia64 x86_64
273 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
276 Prereq: %{kernel_prereq}
277 Conflicts: %{kernel_conflicts}
280 %description pseries64
281 The standard kernel for Power3, Power4 and PowerPC 970 64-bit SMP
284 This kernel can be used for all 64bit RS/6000, pSeries and JS20
288 Summary: The Linux Kernel for machines with more than 4 Gigabyte of memory.
289 Group: System Environment/Kernel
290 Provides: module-info, kernel = %{version}
291 %ifarch %{all_x86} ia64 x86_64
292 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
295 Prereq: %{kernel_prereq}
296 Conflicts: %{kernel_conflicts}
297 Obsoletes: kernel-enterprise <= 2.4.10
301 This package includes a kernel that has appropriate configuration options
302 enabled for Pentium III machines with 4 Gigabyte of memory or more.
305 Summary: The version of the Linux kernel used on installation boot disks.
306 Group: System Environment/Kernel
307 Provides: kernel = %{version}
309 Prereq: %{BOOT_kernel_prereq}
310 Conflicts: %{kernel_conflicts}
314 This package includes a trimmed down version of the Linux kernel.
315 This kernel is used on the installation boot disks only and should not
316 be used for an installed system, as many features in this kernel are
317 turned off because of the size constraints.
320 Summary: The Linux kernel used on installation boot disks for SMP machines.
321 Group: System Environment/Kernel
322 Provides: kernel = %{version}
324 Prereq: %{BOOT_kernel_prereq}
325 Conflicts: %{kernel_conflicts}
329 This package includes a trimmed down version of the Linux kernel. This
330 kernel is used on the installation boot disks only and should not be used
331 for an installed system, as many features in this kernel are turned off
332 because of the size constraints. This kernel is used when booting SMP
333 machines that have trouble coming up to life with the uniprocessor kernel.
336 Summary: The Linux Kernel compiled for the Alpha Jensen platform.
337 Group: System Environment/Kernel
338 Provides: kernel = %{version}
340 Prereq: %{kernel_prereq}
341 Conflicts: %{kernel_conflicts}
345 This package includes a kernel that has appropriate configuration
346 options enabled for use on the Alpha Jensen platform. The Jensen
347 platform is not supported in the normal generic alpha kernel support.
349 %package -n lustre-lite-utils
350 Summary: Lustre utils for Linux
351 Group: Applications/System
353 %description -n lustre-lite-utils
354 The Lustre Lite file system utilities. This includes the tools needed
355 to configure, mount, and administer a Lustre filesystem. This package
356 is necessary if you want to access a Lustre filesystem.
358 # the lustre-doc files are just included as %doc with
361 #%package -n lustre-doc
362 #Summary: Sample Lustre configurations and documentation
363 #Group: Documentation
365 #%description -n lustre-doc
366 #The Lustre book, sample configurations, and other documentation for
369 # This is required in rpm >= 4.4.? and _should_ be set by the %setup macro
370 # but isn't, at least for 4.4.2. Yay RPM.
371 %define buildsubdir lustre-kernel-%{version}
372 %define _buildsubdir lustre-kernel-%{version}
375 %setup -n lustre-kernel-%{version} -q -c
376 if [ ! -d lustre ] ; then
377 ln -sf lustre* lustre
379 pushd lustre >/dev/null
380 if [ -s "%{SOURCE2}" ] ; then
381 tar zxf "%{SOURCE2}" -C lustre/kernel_patches
383 sh -x ./build/lmake \
385 --target @LUSTRE_TARGET@ \
386 --target-arch %{_target_cpu} \
387 --kerneldir $RPM_SOURCE_DIR
390 # handle both SuSE and Red Hat's new-kernel-pkg bits
391 for flavor in "" smp bigmem bigsmp pseries64 BOOT jensen ; do
392 [ -n "$flavor" ] && delim_flavor="%{flavordelim}$flavor"
393 for when in pre preun post postun ; do
394 script="${when}${flavor}.sh"
395 cat %{SOURCE25} %{SOURCE32} %{SOURCE33} > ${script}
396 echo "if [ -d /etc/susehelp.d ] ; then" >> ${script}
397 sed -e "s/@when@/$when/g" -e "s^%ver_str^%{KVERREL}${delim_flavor}^g" %{SOURCE28} >> ${script}
400 echo "if [ ! -f /etc/modprobe.conf ] ; then" >> ${script}
401 cat %{SOURCE31} >> ${script}
402 echo "fi" >> ${script}
405 # /sbin/update-modules.dep compares when the modules were built, rather
406 # than installed, so force modules.dep to be recreated
407 echo "rm -f /lib/modules/%{KVERREL}${delim_flavor}/modules.dep" >> ${script}
408 echo "if [ -f /etc/modprobe.conf ] ; then" >> ${script}
409 sed -e "s^%ver_str^%{KVERREL}${delim_flavor}^g" %{SOURCE26} >> ${script}
411 echo "else" >> ${script}
412 sed -e "s^%ver_str^%{KVERREL}${delim_flavor}^g" -e "s^%%{cfg_name}^${delim_flavor}^g" %{SOURCE29} >> ${script}
413 echo "fi" >> ${script}
416 echo "if [ -f /etc/modprobe.conf ] ; then" >> ${script}
417 sed -e "s^%ver_str^%{KVERREL}${delim_flavor}^g" %{SOURCE27} >> ${script}
419 echo "else" >> ${script}
420 sed -e "s^%ver_str^%{KVERREL}${delim_flavor}^g" %{SOURCE30} >> ${script}
421 echo "fi" >> ${script}
424 echo "exit 0; fi" >> ${script}
427 if [ -z "${flavor}" ] ; then
428 cat >> ${script} <<EOF
431 ln -sf vmlinuz-%{KVERREL} vmlinuz
433 ln -sf System.map-%{KVERREL} System.map
434 ln -sf module-info-%{KVERREL} module-info
437 cat >> ${script} <<EOF
438 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
439 [ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
440 if [ -x /sbin/new-kernel-pkg ] ; then
441 if /sbin/new-kernel-pkg 2>&1 | grep package >/dev/null ; then
442 PACKAGE_ARG="--package kernel-${flavor}"
444 /sbin/new-kernel-pkg $PACKAGE_ARG --mkinitrd --depmod \
445 --install %{KVERREL}${delim_flavor}
452 cat >> ${script} <<EOF
453 /sbin/modprobe loop 2>/dev/null >/dev/null || :
458 cat >> ${script} <<EOF
459 /sbin/modprobe loop 2> /dev/null > /dev/null || :
460 rm -f /lib/modules/%{KVERREL}${delim_flavor}/modules.*
461 if [ -x /sbin/new-kernel-pkg ] ; then
462 /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}${delim_flavor}
469 cat > "kernel$flavor.files" <<EOF
470 %%defattr(-, root, root)
471 /boot/%{kernel_glob}${delim_flavor}
472 /boot/System.map-%{KVERREL}${delim_flavor}
473 /boot/config-%{KVERREL}${delim_flavor}
476 /lib/modules/%{KVERREL}${delim_flavor}
478 /boot/efi/redhat/%{kernel_glob}${delim_flavor}
482 /boot/Kerntypes-%{KVERREL}${delim_flavor}
484 /boot/symvers-%{KVERREL}-%{_target_cpu}${delim_flavor}.gz
490 cat > kernel-source.files <<EOF
491 %%defattr(-,root,root)
492 %%dir /usr/src/linux-%{KVERREL}
493 /usr/src/linux-%{KVERREL}/*
495 %%dir /usr/src/linux-%{KVERREL}-obj
496 /usr/src/linux-%{KVERREL}-obj/*
501 # if RPM_BUILD_NCPUS unset, set it
502 if [ -z "$RPM_BUILD_NCPUS" ] ; then
503 RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat || :)
504 if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
507 if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
512 rm -rf $RPM_BUILD_ROOT
513 mkdir -p $RPM_BUILD_ROOT
517 target_config=${1:+--target-config $1}
518 sh -x ./build/lmake \
520 --target @LUSTRE_TARGET@ \
521 --target-arch %{_target_cpu} \
523 --extraversion %{kextraver} \
529 target_config=${1:+--target-config $1}
530 sh -x ./build/lmake \
531 --build-kernel --build-lustre \
534 --target @LUSTRE_TARGET@ \
535 --target-arch %{_target_cpu} \
537 --extraversion %{kextraver} \
538 --kerneldir $RPM_SOURCE_DIR \
539 -j $RPM_BUILD_NCPUS \
540 --destdir $RPM_BUILD_ROOT \
547 target_config=${1:+--target-config $1}
548 sh -x ./build/lmake \
551 --target @LUSTRE_TARGET@ \
552 --target-arch %{_target_cpu} \
554 --extraversion %{kextraver} \
555 --kerneldir $RPM_SOURCE_DIR \
556 -j $RPM_BUILD_NCPUS \
557 --destdir $RPM_BUILD_ROOT \
559 --disable-doc --disable-tests \
560 --disable-modules --disable-liblustre \
561 --sysconfdir=%{_sysconfdir} \
562 --mandir=%{_mandir} \
568 sh -x ./build/lmake \
570 --target @LUSTRE_TARGET@ \
571 --target-arch %{_target_cpu} \
572 --extraversion %{kextraver} \
573 --destdir $RPM_BUILD_ROOT
576 pushd lustre >/dev/null
598 %if %{buildpseries64}
599 BuildKernel pseries64
613 pushd lustre >/dev/null
614 # it's already installed, so just clean up some things that are rpm
616 for i in $RPM_BUILD_ROOT/lib/modules/* ; do
619 # remove legacy pcmcia symlink that's no longer useful
624 # mark the vmlinux* non-executable to fool strip-to-file
625 chmod a-x $RPM_BUILD_ROOT/boot/vmlinux*
630 if [ $flavor = "up" ] ; then
634 flavext="%{flavordelim}$flavor"
637 perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = %{kextraverdelim}%{kextraver}${flavext}/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
638 c="$RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}"
639 o="${c}-obj/%{_target_cpu}/$flavor"
641 # use the one we just built
642 #cp ../lustre/kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@-%{_target_cpu}%{dashtargetboard}${flavext}.config \
643 cp .config $o/.config
644 for oc in oldconfig_nonint silentoldconfig oldconfig ; do
645 if grep -q "$oc" Makefile ; then
650 MAKE="make -s O=$o -C ${c}"
654 $MAKE "$MAKE_CC" $OLDCONFIG
656 rm -rf $o/.config.old $o/include/config
657 # Replace the Makefile in the object directory with a version
658 # that has relative path names. This is done by fixing the Makefile
659 # after the fact to work with 2.6.17 and newer mkmakefile.
660 read VERSION PATCHLEVEL SUBLEVEL <<-EOF
661 $(set -- 2.6.5 ; echo ${*//./ })
664 ARCH=%{_target_cpu} /bin/sh scripts/mkmakefile ../../../linux-%{KVERREL} $o \
665 $VERSION $PATCHLEVEL > $o/Makefile.in
666 if [ -f $o/Makefile ] ; then
667 # will exist only for 2.6.17 and newer because mkmakefile
668 # now writes the makefile to $o instead of stdout
669 mv -f $o/Makefile $o/Makefile.in
671 sed -e "s^$o^../linux-%{KVERREL}-obj/%{_target_cpu}/$flavor^" \
672 $o/Makefile.in > $o/Makefile
673 zcat "$RPM_BUILD_ROOT/boot/symvers-%{KVERREL}-%{_target_cpu}${flavext}.gz" \
678 ## do -source package cleanup/install
680 if [ "%{buildbase}" -ne 0 ] ; then
681 pushd linux >/dev/null
682 mkdir -p $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
683 rm -f drivers/net/hamradio/soundmodem/gentbl scripts/mkdep
684 tar cf - . | tar xf - -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
685 ln -sf linux-%{KVERREL} $RPM_BUILD_ROOT/usr/src/linux
686 # install -m 644 %{SOURCE10} $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
688 #clean up the destination
689 make -s mrproper -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
690 rm -rf $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
691 mkdir -p $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
692 cp ../lustre/kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@*.config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
693 if [ "%{linux26}" -ne 0 ] ; then
694 # this only works because CFS only builds one kernel per target/arch per kernel-source rpm
695 objdir=$RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}-obj
697 if [ "%{buildbigmem}" -ne 0 ] ; then
700 if [ "%{buildBOOT}" -ne 0 ] ; then
703 if [ "%{buildjensen}" -ne 0 ] ; then
706 if [ "%{buildsmp}" -ne 0 ] ; then
709 if [ "%{buildbigsmp}" -ne 0 ] ; then
712 if [ "%{buildpseries64}" -ne 0 ] ; then
715 if [ "%{buildup}" -ne 0 ] ; then
718 perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = %{kextraverdelim}%{kextraver}%{flavordelim}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
719 # Remove $RPM_BUILD_ROOT prefix from symlinks.
720 for link in $(find $objdir -type l); do
721 target=$(readlink $link)
723 ln -s ${target/$RPM_BUILD_ROOT/} $link
726 perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = %{kextraverdelim}%{kextraver}%{flavordelim}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
727 # get the one from the build we just completed as it might have picked
729 #cp ../lustre/kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@-%{_target_cpu}%{dashtargetboard}.config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/.config
730 cp .config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/.config
731 for oc in oldconfig_nonint silentoldconfig oldconfig ; do
732 if grep -q "$oc" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile ; then
740 make "$MAKE_CC" -s $OLDCONFIG -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
741 make "$MAKE_CC" -s symlinks -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
742 make "$MAKE_CC" -s include/linux/version.h -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
744 #this generates modversions info which we want to include and we may as
745 #well include the depends stuff as well, after we fix the paths
746 make -s depend -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
747 find $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL} -name ".*depend" | \
750 sed -e "s|[^ ]*\(/usr/src/linux\)|\1|g" < $file.old > $file
754 # Try to put some smarter autoconf.h and version.h files in place
755 pushd $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/include/linux ; {
756 rm -rf modules modversions.h autoconf.h version.h
757 cat > modversions.h <<EOF
758 #ifndef _LINUX_MODVERSIONS_H
759 #define _LINUX_MODVERSIONS_H
760 #include <linux/rhconfig.h>
761 #include <linux/modsetver.h>
763 echo '#include <linux/rhconfig.h>' > autoconf.h
764 list=`find ../../savedheaders/* -name '*.ver' -exec basename '{}' \; | sort`
767 sed 's,$,modules/'$l, ../../savedheaders/list | awk -f %{SOURCE17} > modules/$l
768 touch -r modules/$l modules/`basename $l .ver`.stamp
769 echo '#include <linux/modules/'$l'>' >> modversions.h
771 echo '#endif' >> modversions.h
772 sed 's,$,autoconf.h,' ../../savedheaders/list | awk -f %{SOURCE16} >> autoconf.h
773 install -m 644 %{SOURCE15} rhconfig.h
774 echo "#include <linux/rhconfig.h>" >> version.h
776 for i in smp BOOT BOOTsmp bigmem bigsmp pseries64 up ; do
777 # When we build in an i386, we don't have an bigmem header directory
778 # in savedheaders/i386/bigmem. We also don't have a BOOT directory
779 # anywhere except in savedheaders/i386. So, we need to use this method
780 # of determining if a kernel version string needs to be included in the
782 verh=`echo ../../savedheaders/*/$i/version.h | awk ' { print $1 } '`
783 if [ -n "$verh" -a -f "$verh" ]; then
784 if [ "$i" = up ]; then
785 if [ "$keyword" = if ]; then
786 echo "#if 0" >> version.h
788 echo "#else" >> version.h
790 echo "#$keyword defined(__module__$i)" >> version.h
793 grep UTS_RELEASE $verh >> version.h
796 echo "#endif" >> version.h
797 if [ -f ../../savedheaders/%{_target_cpu}/up/version.h ] ; then
798 # keep to a standard normally
799 HEADER_FILE=../../savedheaders/%{_target_cpu}/up/version.h
801 # test build not including uniprocessor, must get info from somewhere
802 HEADER_FILE=$(ls ../../savedheaders/*/*/version.h | head -n 1)
804 grep -v UTS_RELEASE $HEADER_FILE >> version.h
805 rm -rf ../../savedheaders
807 touch $RPM_BUILD_ROOT/boot/kernel.h-%{kversion}
809 # rm -f $RPM_BUILD_ROOT/usr/include/linux
811 rm -rf $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/savedheaders
813 if [ "%{rhbuild}" -ne 0 ] ; then
814 # fix up the tmp_include_depends file wrt the buildroot
815 perl -p -i -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/tmp_include_depends
824 rm -rf $RPM_BUILD_ROOT
830 # do this for upgrades...in case the old modules get removed we have
831 # loopback in the kernel so that mkinitrd will work.
834 %pre smp -f presmp.sh
836 %pre bigsmp -f prebigsmp.sh
838 %pre pseries64 -f prepseries64.sh
840 %pre bigmem -f prebigmem.sh
844 %post pseries64 -f postpseries64.sh
846 %post smp -f postsmp.sh
848 %post bigsmp -f postbigsmp.sh
850 %post bigmem -f postbigmem.sh
852 %post jensen -f postjensen.sh
855 %post BOOT -f postBOOT.sh
859 %post -n lustre-lite-utils
860 if [ -f /etc/init.d/lustre ] ; then
861 /sbin/chkconfig --add lustre
862 /sbin/chkconfig --add lustrefs
865 # Allow clean removal of modules directory
868 %preun pseries64 -f preunpseries64.sh
870 %preun smp -f preunsmp.sh
872 %preun bigsmp -f preunbigsmp.sh
874 %preun bigmem -f preunbigmem.sh
876 %preun BOOT -f preunBOOT.sh
878 %preun jensen -f preunjensen.sh
880 # suse needs these i guess
883 %postun pseries64 -f postunpseries64.sh
885 %postun smp -f postunsmp.sh
887 %postun bigsmp -f postunbigsmp.sh
889 %postun bigmem -f postunbigmem.sh
891 %postun BOOT -f postunBOOT.sh
893 %postun jensen -f postunjensen.sh
895 # We need this here because we don't prereq kudzu; it could be
896 # installed after the kernel
898 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
900 %triggerin smp -- kudzu
901 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
903 %triggerin bigsmp -- kudzu
904 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
906 %triggerin pseries64 -- kudzu
907 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
909 %triggerin bigmem -- kudzu
910 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
912 %triggerin BOOT -- kudzu
913 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
915 %triggerin jensen -- kudzu
916 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
919 # Old kernel-headers packages owned include symlinks; new
920 # ones just make them so that we can have multiple kernel-headers
921 # packages installed.
923 %triggerpostun source -- kernel-headers < 2.2.16
926 ln -snf linux-%{KVERREL} %{kslnk}
932 ln -snf linux-%{KVERREL} %{kslnk}
935 if [ -L /usr/src/%{kslnk} ]; then
936 if [ -L /usr/src/%{kslnk} -a `ls -ld /usr/src/%{kslnk} 2>/dev/null| awk '{ print $11 }'` = "linux-%{KVERREL}" ]; then
937 [ $1 = 0 ] && rm -f /usr/src/%{kslnk}
942 %preun -n lustre-lite-utils
943 if [ $1 = 0 -a -f /etc/init.d/lustre ]; then
944 /sbin/chkconfig --del lustre
945 /sbin/chkconfig --del lustrefs
953 %files -f kernel.files
957 %files smp -f kernelsmp.files
961 %files bigsmp -f kernelbigsmp.files
964 %if %{buildpseries64}
965 %files pseries64 -f kernelpseries64.files
969 %files bigmem -f kernelbigmem.files
973 %files BOOT -f kernelBOOT.files
977 %files source -f kernel-source.files