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 release @KERNEL_RELEASE@
14 # /usr/src/%{kslnk} -> /usr/src/linux-%{KVERREL}
15 %define kslnk linux-2.4
17 # groups of related archs
18 %define all_x86 i386 i686 i586 athlon
19 #define all_x86 i686 i386 i586 athlon
21 %define nptlarchs %{all_x86}
22 #define nptlarchs noarch
23 %define rhbuild @RHBUILD@
24 %define susebuild @SUSEBUILD@
25 %define linux26 @LINUX26@
27 # disable build root strip policy
28 %define __spec_install_post /usr/lib/rpm/brp-compress || :
31 %define _missing_doc_files_terminate_build 0
32 %define _unpackaged_files_terminate_build 0
33 %define debug_package %{nil}
35 # Enable this to build a board-specific kernel configuration
36 # some architectures have LOTS of different setups and this
37 # is a way to deal with that cleanly.
39 #define targetboard assabet
40 %define dashtargetboard %{?targetboard:-%{targetboard}}
41 %define withtargetboard 0
42 %{?targetboard: %{expand: %%define withtargetboard 1}}
44 # Override generic defaults with per-arch defaults (which can
45 # themselves be overridden with --with/--without). These must
46 # ONLY be "0", never "1"
54 %define buildpseries64 0
62 %ifarch @BIGMEM_ARCHS@
70 %ifarch @JENSEN_ARCHS@
78 %ifarch @BIGSMP_ARCHS@
82 %ifarch @PSERIES64_ARCHS@
83 %define buildpseries64 1
90 # For board-specific kernels, build only the normal kernel (which may actually be smp, not up).
91 %if %{withtargetboard}
96 %define buildpseries64 0
101 Second, per-architecture exclusions (ifarch)
110 # we can't test values inline, only whether a macro exists
111 %{expand: %%define buildup_%{buildup} yadda}
112 %{expand: %%define buildsmp_%{buildsmp} yadda}
113 %{expand: %%define buildbigsmp_%{buildbigsmp} yadda}
114 %{expand: %%define buildpseries64_%{buildpseries64} yadda}
115 %{expand: %%define buildBOOT_%{buildBOOT} yadda}
116 %{expand: %%define buildbigmem_%{buildbigmem} yadda}
117 %{expand: %%define buildjensen_%{buildjensen} yadda}
118 %{expand: %%define ikd_%{ikd} yadda}
119 %{expand: %%define ibcs_%{ibcs} yadda}
120 %{expand: %%define debuglevel_%{debugging} yadda}
122 %{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}
125 %define BOOT_kernel_prereq fileutils, modutils >= 2.4.18
126 %define kernel_prereq %{BOOT_kernel_prereq}, initscripts >= 5.83, mkinitrd >= 3.2.6
130 %define initrd_dir /boot/efi/redhat
132 %define initrd_dir /boot
135 %ifarch %{all_x86} x86_64
136 %define kernel_glob vmlinu?-%{KVERREL}
139 # <sigh>, no GLOB_BRACE for filelists, efi needs to be done separately
140 %define kernel_glob vmlinuz-%{KVERREL}
143 %define kernel_glob vmlinu?-%{KVERREL}
146 %define kernel_glob vmlinu?-%{KVERREL}
151 Release: %{release}%{?targetboard:%{targetboard}}%{?debuglevel_1:.dbg}
152 %define KVERREL %{PACKAGE_VERSION}-%{kextraver}%{?targetboard:%{targetboard}}%{?debuglevel_1:.dbg}
154 Group: System Environment/Kernel
155 ExclusiveArch: %{all_x86} x86_64 ia64 ppc
157 Obsoletes: kernel-modules, kernel-sparc
158 Provides: kernel = %{version}
159 BuildConflicts: rhbuildsys(DiscFree) < 500Mb
160 %ifarch %{all_x86} ia64 x86_64
161 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
165 Prereq: %{kernel_prereq}
166 Conflicts: %{kernel_conflicts}
168 BuildPreReq: patch >= 2.5.4, bash >= 2.03, sh-utils, gnupg, tar
169 BuildPreReq: bzip2, findutils, dev, gzip, m4
172 Vendor: Cluster File Systems, Inc.
173 URL: http://www.kernel.org/
174 Buildroot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root
176 Source0: @LUSTRE_SOURCE@
177 Source1: @KERNEL_SOURCE@
178 Source2: external-patches.tar.gz
180 Source15: linux-rhconfig.h
181 Source16: linux-merge-config.awk
182 Source17: linux-merge-modules.awk
184 Source25: suse-functions.sh
185 Source26: suse-post.sh
186 Source27: suse-postun.sh
187 Source28: suse-trigger-script.sh.in
190 Summary: The source code for the Linux kernel.
191 Group: Development/System
194 Requires: gcc >= 2.96-98
198 Summary: Various documentation bits found in the kernel source.
202 The kernel package contains the Linux kernel (vmlinuz), the core of a
203 Linux operating system. The kernel handles the basic functions of the
204 operating system: memory allocation, process allocation, device input
208 The kernel-source package contains the source code files for the Linux
209 kernel. These source files are needed to build custom/third party device
210 drivers. The source files can also be used to build a custom kernel that is
211 better tuned to your particular hardware, if you are so inclined (and you
212 know what you're doing).
215 This package contains documentation files form the kernel
216 source. Various bits of information about the Linux kernel and the
217 device drivers shipped with it are documented in these files.
219 You'll want to install this package if you need a reference to the
220 options that can be passed to Linux kernel modules at load time.
223 Summary: The Linux kernel compiled for SMP machines.
224 Group: System Environment/Kernel
225 Provides: module-info, kernel = %{version}
226 %ifarch %{all_x86} ia64 x86_64
227 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
230 Prereq: %{kernel_prereq}
231 Conflicts: %{kernel_conflicts}
235 This package includes a SMP version of the Linux kernel. It is
236 required only on machines with two or more CPUs, although it should
237 work fine on single-CPU boxes.
239 Install the kernel-smp package if your machine uses two or more CPUs.
242 Summary: The Linux kernel compiled for SMP machines.
244 Provides: module-info, kernel = %{version}, k_smp4G
246 %ifarch %{all_x86} ia64 x86_64
247 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
250 Prereq: %{kernel_prereq}
251 Conflicts: %{kernel_conflicts}
255 This package includes a SMP version of the Linux kernel. It is
256 required only on machines with two or more CPUs, although it should
257 work fine on single-CPU boxes.
259 Install the kernel-bigsmp package if your machine uses two or more CPUs.
262 Summary: Standard Kernel for 64-bit Power based SMP and LPAR Machines
264 Provides: module-info, kernel = %{version}, k_smp4G
265 %ifarch %{all_x86} ia64 x86_64
266 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
269 Prereq: %{kernel_prereq}
270 Conflicts: %{kernel_conflicts}
273 %description pseries64
274 The standard kernel for Power3, Power4 and PowerPC 970 64-bit SMP
277 This kernel can be used for all 64bit RS/6000, pSeries and JS20
281 Summary: The Linux Kernel for machines with more than 4 Gigabyte of memory.
282 Group: System Environment/Kernel
283 Provides: module-info, kernel = %{version}
284 %ifarch %{all_x86} ia64 x86_64
285 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
288 Prereq: %{kernel_prereq}
289 Conflicts: %{kernel_conflicts}
290 Obsoletes: kernel-enterprise <= 2.4.10
294 This package includes a kernel that has appropriate configuration options
295 enabled for Pentium III machines with 4 Gigabyte of memory or more.
298 Summary: The version of the Linux kernel used on installation boot disks.
299 Group: System Environment/Kernel
300 Provides: kernel = %{version}
302 Prereq: %{BOOT_kernel_prereq}
303 Conflicts: %{kernel_conflicts}
307 This package includes a trimmed down version of the Linux kernel.
308 This kernel is used on the installation boot disks only and should not
309 be used for an installed system, as many features in this kernel are
310 turned off because of the size constraints.
313 Summary: The Linux kernel used on installation boot disks for SMP machines.
314 Group: System Environment/Kernel
315 Provides: kernel = %{version}
317 Prereq: %{BOOT_kernel_prereq}
318 Conflicts: %{kernel_conflicts}
322 This package includes a trimmed down version of the Linux kernel. This
323 kernel is used on the installation boot disks only and should not be used
324 for an installed system, as many features in this kernel are turned off
325 because of the size constraints. This kernel is used when booting SMP
326 machines that have trouble coming up to life with the uniprocessor kernel.
329 Summary: The Linux Kernel compiled for the Alpha Jensen platform.
330 Group: System Environment/Kernel
331 Provides: kernel = %{version}
333 Prereq: %{kernel_prereq}
334 Conflicts: %{kernel_conflicts}
338 This package includes a kernel that has appropriate configuration
339 options enabled for use on the Alpha Jensen platform. The Jensen
340 platform is not supported in the normal generic alpha kernel support.
342 %package -n lustre-lite-utils
343 Summary: Lustre utils for Linux
344 Group: Applications/System
346 %description -n lustre-lite-utils
347 The Lustre Lite file system utilities. This includes the tools needed
348 to configure, mount, and administer a Lustre filesystem. This package
349 is necessary if you want to access a Lustre filesystem.
351 # the lustre-doc files are just included as %doc wiht
354 #%package -n lustre-doc
355 #Summary: Sample Lustre configurations and documentation
356 #Group: Documentation
358 #%description -n lustre-doc
359 #The Lustre book, sample configurations, and other documentation for
362 %package -n lustre-ldap
363 Summary: LDAP schema files for Lustre
364 Group: System Environment/Daemons
366 %description -n lustre-ldap
367 LDAP schema files for Lustre. These are needed if you plan to store
368 your Lustre configuration in LDAP, rather than on disk.
371 %setup -n lustre-kernel-%{version} -q -c
372 if [ ! -d lustre ] ; then
373 ln -sf lustre* lustre
375 pushd lustre >/dev/null
376 if [ -s "%{SOURCE2}" ] ; then
377 tar zxf "%{SOURCE2}" -C lustre/kernel_patches
379 sh -x ./build/lmake \
381 --target @LUSTRE_TARGET@ \
382 --target-arch %{_target_cpu} \
383 --kerneldir $RPM_SOURCE_DIR
386 # handle both SuSE and Red Hat's new-kernel-pkg bits
387 for flavor in "" smp bigmem bigsmp pseries64 BOOT jensen ; do
388 for when in pre preun post postun ; do
389 script="${when}${flavor}.sh"
390 echo "if [ -f /etc/SuSE-release ] ; then" > ${script}
391 sed -e "s/@when@/$when/g" -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE28} >> ${script}
392 cat %{SOURCE25} >> ${script}
395 sed -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE26} >> ${script}
398 sed -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE27} >> ${script}
401 echo "exit 0; fi" >> ${script}
404 if [ -z "${flavor}" ] ; then
405 cat >> ${script} <<EOF
408 ln -sf vmlinuz-%{KVERREL} vmlinuz
410 ln -sf System.map-%{KVERREL} System.map
411 ln -sf module-info-%{KVERREL} module-info
414 cat >> ${script} <<EOF
415 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
416 [ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
417 if [ -x /sbin/new-kernel-pkg ] ; then
418 /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}${flavor}
425 cat >> ${script} <<EOF
426 /sbin/modprobe loop 2>/dev/null >/dev/null || :
431 cat >> ${script} <<EOF
432 /sbin/modprobe loop 2> /dev/null > /dev/null || :
433 rm -f /lib/modules/%{KVERREL}${flavor}/modules.*
434 if [ -x /sbin/new-kernel-pkg ] ; then
435 /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}${flavor}
442 cat > "kernel$flavor.files" <<EOF
443 %%defattr(-, root, root)
444 /boot/%{kernel_glob}${flavor}
445 /boot/System.map-%{KVERREL}${flavor}
446 /boot/config-%{KVERREL}${flavor}
449 /lib/modules/%{KVERREL}${flavor}
451 /boot/efi/redhat/%{kernel_glob}${flavor}
455 /boot/Kerntypes-%{KVERREL}${flavor}
456 /boot/symvers-%{KVERREL}-%{_target_cpu}${flavor}.gz
463 cat > kernel-source.files <<EOF
464 %%defattr(-,root,root)
465 %%dir /usr/src/linux-%{KVERREL}
466 /usr/src/linux-%{KVERREL}/*
468 %%dir /usr/src/linux-%{KVERREL}-obj
469 /usr/src/linux-%{KVERREL}-obj/*
474 # if RPM_BUILD_NCPUS unset, set it
475 if [ -z "$RPM_BUILD_NCPUS" ] ; then
476 RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat || :)
477 if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
480 if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
485 rm -rf $RPM_BUILD_ROOT
486 mkdir -p $RPM_BUILD_ROOT
490 target_config=${1:+--target-config $1}
491 sh -x ./build/lmake \
493 --target @LUSTRE_TARGET@ \
494 --target-arch %{_target_cpu} \
496 --extraversion %{kextraver} \
502 target_config=${1:+--target-config $1}
503 sh -x ./build/lmake \
504 --build-kernel --build-lustre \
507 --target @LUSTRE_TARGET@ \
508 --target-arch %{_target_cpu} \
510 --extraversion %{kextraver} \
511 --kerneldir $RPM_SOURCE_DIR \
512 -j $RPM_BUILD_NCPUS \
513 --destdir $RPM_BUILD_ROOT \
514 -- --enable-modules \
515 --disable-doc --disable-tests \
516 --disable-utils --disable-liblustre \
517 --sysconfdir=%{_sysconfdir} \
518 --mandir=%{_mandir} \
524 target_config=${1:+--target-config $1}
525 sh -x ./build/lmake \
528 --target @LUSTRE_TARGET@ \
529 --target-arch %{_target_cpu} \
531 --extraversion %{kextraver} \
532 --kerneldir $RPM_SOURCE_DIR \
533 -j $RPM_BUILD_NCPUS \
534 --destdir $RPM_BUILD_ROOT \
536 --disable-doc --disable-tests \
537 --disable-modules --disable-liblustre \
538 --sysconfdir=%{_sysconfdir} \
539 --mandir=%{_mandir} \
545 sh -x ./build/lmake \
547 --target @LUSTRE_TARGET@ \
548 --target-arch %{_target_cpu} \
549 --extraversion %{kextraver} \
550 --destdir $RPM_BUILD_ROOT
553 pushd lustre >/dev/null
575 %if %{buildpseries64}
576 BuildKernel pseries64
590 pushd lustre >/dev/null
591 # it's already installed, so just clean up some things that are rpm
593 for i in $RPM_BUILD_ROOT/lib/modules/* ; do
596 ln -sf ../../../usr/src/linux-%{KVERREL} $i/build
598 # remove legacy pcmcia symlink that's no longer useful
603 # mark the vmlinux* non-executable to fool strip-to-file
604 chmod a-x $RPM_BUILD_ROOT/boot/vmlinux*
609 if [ $flavor = "up" ] ; then
616 perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{kextraver}${flavtgt}/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
617 c="$RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}"
618 o="${c}-obj/%{_target_cpu}/$flavor"
620 cp ../lustre/kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@-%{_target_cpu}%{dashtargetboard}${flavext}.config \
622 for oc in oldconfig_nonint silentoldconfig oldconfig ; do
623 if grep -q "$oc" Makefile ; then
628 MAKE="make -s O=$o -C ${c}"
632 $MAKE "$MAKE_CC" $OLDCONFIG
633 $MAKE "$MAKE_CC" prepare-all
635 rm -rf $o/.config.old $o/include/config
636 # Replace the Makefile in the object directory with a version
637 # that has relative path names.
638 read VERSION PATCHLEVEL SUBLEVEL <<-EOF
639 $(set -- 2.6.5 ; echo ${*//./ })
641 source scripts/mkmakefile \
642 ../../../linux-%{KVERREL} \
643 ../linux-%{KVERREL}-obj/%{_target_cpu}/$flavor \
647 zcat "$RPM_BUILD_ROOT/boot/symvers-%{KVERREL}-%{_target_cpu}${flavor}.gz" \
652 ## do -source package cleanup/install
654 if [ "%{buildbase}" -ne 0 ] ; then
655 pushd linux >/dev/null
656 mkdir -p $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
657 rm -f drivers/net/hamradio/soundmodem/gentbl scripts/mkdep
658 tar cf - . | tar xf - -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
659 ln -sf linux-%{KVERREL} $RPM_BUILD_ROOT/usr/src/linux
660 # install -m 644 %{SOURCE10} $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
662 #clean up the destination
663 make -s mrproper -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
664 rm -rf $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
665 mkdir -p $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
666 cp ../lustre/kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@*.config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
667 if [ "%{linux26}" -ne 0 ] ; then
668 # this only works because CFS only builds one kernel per target/arch per kernel-source rpm
669 objdir=$RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}-obj
671 if [ "%{buildbigmem}" -ne 0 ] ; then
674 if [ "%{buildBOOT}" -ne 0 ] ; then
677 if [ "%{buildjensen}" -ne 0 ] ; then
680 if [ "%{buildsmp}" -ne 0 ] ; then
683 if [ "%{buildbigsmp}" -ne 0 ] ; then
686 if [ "%{buildpseries64}" -ne 0 ] ; then
689 if [ "%{buildup}" -ne 0 ] ; then
692 perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{kextraver}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
693 # Remove $RPM_BUILD_ROOT prefix from symlinks.
694 for link in $(find $objdir -type l); do
695 target=$(readlink $link)
697 ln -s ${target/$RPM_BUILD_ROOT/} $link
700 perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{kextraver}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
701 cp ../lustre/kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@-%{_target_cpu}%{dashtargetboard}.config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/.config
702 for oc in oldconfig_nonint silentoldconfig oldconfig ; do
703 if grep -q "$oc" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile ; then
711 make "$MAKE_CC" -s $OLDCONFIG -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
712 make "$MAKE_CC" -s symlinks -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
713 make "$MAKE_CC" -s include/linux/version.h -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
715 #this generates modversions info which we want to include and we may as
716 #well include the depends stuff as well, after we fix the paths
717 make -s depend -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
718 find $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL} -name ".*depend" | \
721 sed -e "s|[^ ]*\(/usr/src/linux\)|\1|g" < $file.old > $file
725 # Try to put some smarter autoconf.h and version.h files in place
726 pushd $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/include/linux ; {
727 rm -rf modules modversions.h autoconf.h version.h
728 cat > modversions.h <<EOF
729 #ifndef _LINUX_MODVERSIONS_H
730 #define _LINUX_MODVERSIONS_H
731 #include <linux/rhconfig.h>
732 #include <linux/modsetver.h>
734 echo '#include <linux/rhconfig.h>' > autoconf.h
735 list=`find ../../savedheaders/* -name '*.ver' -exec basename '{}' \; | sort`
738 sed 's,$,modules/'$l, ../../savedheaders/list | awk -f %{SOURCE17} > modules/$l
739 touch -r modules/$l modules/`basename $l .ver`.stamp
740 echo '#include <linux/modules/'$l'>' >> modversions.h
742 echo '#endif' >> modversions.h
743 sed 's,$,autoconf.h,' ../../savedheaders/list | awk -f %{SOURCE16} >> autoconf.h
744 install -m 644 %{SOURCE15} rhconfig.h
745 echo "#include <linux/rhconfig.h>" >> version.h
747 for i in smp BOOT BOOTsmp bigmem bigsmp pseries64 up ; do
748 # When we build in an i386, we don't have an bigmem header directory
749 # in savedheaders/i386/bigmem. We also don't have a BOOT directory
750 # anywhere except in savedheaders/i386. So, we need to use this method
751 # of determining if a kernel version string needs to be included in the
753 verh=`echo ../../savedheaders/*/$i/version.h | awk ' { print $1 } '`
754 if [ -n "$verh" -a -f "$verh" ]; then
755 if [ "$i" = up ]; then
756 if [ "$keyword" = if ]; then
757 echo "#if 0" >> version.h
759 echo "#else" >> version.h
761 echo "#$keyword defined(__module__$i)" >> version.h
764 grep UTS_RELEASE $verh >> version.h
767 echo "#endif" >> version.h
768 if [ -f ../../savedheaders/%{_target_cpu}/up/version.h ] ; then
769 # keep to a standard normally
770 HEADER_FILE=../../savedheaders/%{_target_cpu}/up/version.h
772 # test build not including uniprocessor, must get info from somewhere
773 HEADER_FILE=$(ls ../../savedheaders/*/*/version.h | head -n 1)
775 grep -v UTS_RELEASE $HEADER_FILE >> version.h
776 rm -rf ../../savedheaders
778 touch $RPM_BUILD_ROOT/boot/kernel.h-%{kversion}
780 # rm -f $RPM_BUILD_ROOT/usr/include/linux
782 rm -rf $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/savedheaders
784 if [ "%{rhbuild}" -ne 0 ] ; then
785 # fix up the tmp_include_depends file wrt the buildroot
786 perl -p -i -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/tmp_include_depends
795 rm -rf $RPM_BUILD_ROOT
801 # do this for upgrades...in case the old modules get removed we have
802 # loopback in the kernel so that mkinitrd will work.
805 %pre smp -f presmp.sh
807 %pre bigsmp -f prebigsmp.sh
809 %pre pseries64 -f prepseries64.sh
811 %pre bigmem -f prebigmem.sh
815 %post pseries64 -f postpseries64.sh
817 %post smp -f postsmp.sh
819 %post bigsmp -f postbigsmp.sh
821 %post bigmem -f postbigmem.sh
823 %post jensen -f postjensen.sh
826 %post BOOT -f postBOOT.sh
830 %post -n lustre-lite-utils
831 if [ ! -e /dev/obd ]; then
832 mknod /dev/obd c 10 241
834 if [ ! -e /dev/portals ]; then
835 mknod /dev/portals c 10 240
837 if [ -f /etc/init.d/lustre ] ; then
838 /sbin/chkconfig --add lustre
839 /sbin/chkconfig --add lustrefs
842 # Allow clean removal of modules directory
845 %preun pseries64 -f preunpseries64.sh
847 %preun smp -f preunsmp.sh
849 %preun bigsmp -f preunbigsmp.sh
851 %preun bigmem -f preunbigmem.sh
853 %preun BOOT -f preunBOOT.sh
855 %preun jensen -f preunjensen.sh
857 # suse needs these i guess
860 %postun pseries64 -f postunpseries64.sh
862 %postun smp -f postunsmp.sh
864 %postun bigsmp -f postunbigsmp.sh
866 %postun bigmem -f postunbigmem.sh
868 %postun BOOT -f postunBOOT.sh
870 %postun jensen -f postunjensen.sh
872 # We need this here because we don't prereq kudzu; it could be
873 # installed after the kernel
875 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
877 %triggerin smp -- kudzu
878 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
880 %triggerin bigsmp -- kudzu
881 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
883 %triggerin pseries64 -- kudzu
884 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
886 %triggerin bigmem -- kudzu
887 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
889 %triggerin BOOT -- kudzu
890 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
892 %triggerin jensen -- kudzu
893 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
896 # Old kernel-headers packages owned include symlinks; new
897 # ones just make them so that we can have multiple kernel-headers
898 # packages installed.
900 %triggerpostun source -- kernel-headers < 2.2.16
903 ln -snf linux-%{KVERREL} %{kslnk}
909 ln -snf linux-%{KVERREL} %{kslnk}
912 if [ -L /usr/src/%{kslnk} ]; then
913 if [ -L /usr/src/%{kslnk} -a `ls -ld /usr/src/%{kslnk} 2>/dev/null| awk '{ print $11 }'` = "linux-%{KVERREL}" ]; then
914 [ $1 = 0 ] && rm -f /usr/src/%{kslnk}
919 %preun -n lustre-lite-utils
920 if [ $1 = 0 -a -f /etc/init.d/lustre ]; then
921 /sbin/chkconfig --del lustre
922 /sbin/chkconfig --del lustrefs
930 %files -f kernel.files
934 %files smp -f kernelsmp.files
938 %files bigsmp -f kernelbigsmp.files
941 %if %{buildpseries64}
942 %files pseries64 -f kernelpseries64.files
946 %files bigmem -f kernelbigmem.files
950 %files BOOT -f kernelBOOT.files
955 %files source -f kernel-source.files
958 %defattr(-,root,root)
959 %doc lustre/linux/Documentation/*
961 %files -n lustre-lite-utils
962 %defattr(-, root, root)
963 %doc lustre/COPYING lustre/lustre/BUGS lustre/ChangeLog lustre/README lustre/lustre/doc/lustre.pdf
967 /usr/lib/lustre/python
968 @ENABLE_INIT_SCRIPTS@/etc/init.d/lustre
969 @ENABLE_INIT_SCRIPTS@/etc/init.d/lustrefs
970 /usr/include/lustre/*
973 /usr/share/man/man?/*
975 #%files -n lustre-doc
976 #%defattr(-, root, root)
977 #/usr/share/doc/lustre/COPYING
978 #/usr/share/doc/lustre/lustre.pdf
979 #/usr/share/doc/lustre/COPYING
981 /usr/share/lustre/examples
983 %files -n lustre-ldap
984 %defattr(-, root, root)
985 /etc/openldap/slapd-lustre.conf
986 /etc/openldap/schema/lustre.schema
987 /usr/share/lustre/lustre2ldif.xsl
988 /usr/share/lustre/top.ldif
990 %endif # %{buildbase}