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}
454 /boot/Kerntypes-%{KVERREL}${flavor}
455 /boot/symvers-%{KVERREL}-%{_target_cpu}${flavor}.gz
461 cat > kernel-source.files <<EOF
462 %%defattr(-,root,root)
463 %%dir /usr/src/linux-%{KVERREL}
464 /usr/src/linux-%{KVERREL}/*
466 %%dir /usr/src/linux-%{KVERREL}-obj
467 /usr/src/linux-%{KVERREL}-obj/*
472 # if RPM_BUILD_NCPUS unset, set it
473 if [ -z "$RPM_BUILD_NCPUS" ] ; then
474 RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat || :)
475 if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
478 if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
483 rm -rf $RPM_BUILD_ROOT
484 mkdir -p $RPM_BUILD_ROOT
488 target_config=${1:+--target-config $1}
489 sh -x ./build/lmake \
491 --target @LUSTRE_TARGET@ \
492 --target-arch %{_target_cpu} \
494 --extraversion %{kextraver} \
500 target_config=${1:+--target-config $1}
501 sh -x ./build/lmake \
502 --build-kernel --build-lustre \
505 --target @LUSTRE_TARGET@ \
506 --target-arch %{_target_cpu} \
508 --extraversion %{kextraver} \
509 --kerneldir $RPM_SOURCE_DIR \
510 -j $RPM_BUILD_NCPUS \
511 --destdir $RPM_BUILD_ROOT \
512 -- --enable-modules \
513 --disable-doc --disable-tests \
514 --disable-utils --disable-liblustre \
515 --sysconfdir=%{_sysconfdir} \
516 --mandir=%{_mandir} \
522 target_config=${1:+--target-config $1}
523 sh -x ./build/lmake \
526 --target @LUSTRE_TARGET@ \
527 --target-arch %{_target_cpu} \
529 --extraversion %{kextraver} \
530 --kerneldir $RPM_SOURCE_DIR \
531 -j $RPM_BUILD_NCPUS \
532 --destdir $RPM_BUILD_ROOT \
534 --disable-doc --disable-tests \
535 --disable-modules --disable-liblustre \
536 --sysconfdir=%{_sysconfdir} \
537 --mandir=%{_mandir} \
543 sh -x ./build/lmake \
545 --target @LUSTRE_TARGET@ \
546 --target-arch %{_target_cpu} \
547 --extraversion %{kextraver} \
548 --destdir $RPM_BUILD_ROOT
551 pushd lustre >/dev/null
573 %if %{buildpseries64}
574 BuildKernel pseries64
588 pushd lustre >/dev/null
589 # it's already installed, so just clean up some things that are rpm
591 for i in $RPM_BUILD_ROOT/lib/modules/* ; do
594 ln -sf ../../../usr/src/linux-%{KVERREL} $i/build
596 # remove legacy pcmcia symlink that's no longer useful
601 # mark the vmlinux* non-executable to fool strip-to-file
602 chmod a-x $RPM_BUILD_ROOT/boot/vmlinux*
607 if [ $flavor = "up" ] ; then
614 perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{kextraver}${flavtgt}/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
615 c="$RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}"
616 o="${c}-obj/%{_target_cpu}/$flavor"
618 cp ../lustre/kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@-%{_target_cpu}%{dashtargetboard}${flavext}.config \
620 for oc in oldconfig_nonint silentoldconfig oldconfig ; do
621 if grep -q "$oc" Makefile ; then
626 MAKE="make -s O=$o -C ${c}"
630 $MAKE "$MAKE_CC" $OLDCONFIG
631 $MAKE "$MAKE_CC" prepare-all
633 rm -rf $o/.config.old $o/include/config
634 # Replace the Makefile in the object directory with a version
635 # that has relative path names.
636 read VERSION PATCHLEVEL SUBLEVEL <<-EOF
637 $(set -- 2.6.5 ; echo ${*//./ })
639 source scripts/mkmakefile \
640 ../../../linux-%{KVERREL} \
641 ../linux-%{KVERREL}-obj/%{_target_cpu}/$flavor \
645 zcat "$RPM_BUILD_ROOT/boot/symvers-%{KVERREL}-%{_target_cpu}${flavor}.gz" \
650 ## do -source package cleanup/install
652 if [ "%{buildbase}" -ne 0 ] ; then
653 pushd linux >/dev/null
654 mkdir -p $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
655 rm -f drivers/net/hamradio/soundmodem/gentbl scripts/mkdep
656 tar cf - . | tar xf - -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
657 ln -sf linux-%{KVERREL} $RPM_BUILD_ROOT/usr/src/linux
658 # install -m 644 %{SOURCE10} $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
660 #clean up the destination
661 make -s mrproper -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
662 rm -rf $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
663 mkdir -p $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
664 cp ../lustre/kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@*.config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
665 if [ "%{linux26}" -ne 0 ] ; then
666 # this only works because CFS only builds one kernel per target/arch per kernel-source rpm
667 objdir=$RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}-obj
669 if [ "%{buildbigmem}" -ne 0 ] ; then
672 if [ "%{buildBOOT}" -ne 0 ] ; then
675 if [ "%{buildjensen}" -ne 0 ] ; then
678 if [ "%{buildsmp}" -ne 0 ] ; then
681 if [ "%{buildbigsmp}" -ne 0 ] ; then
684 if [ "%{buildpseries64}" -ne 0 ] ; then
687 if [ "%{buildup}" -ne 0 ] ; then
690 perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{kextraver}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
691 # Remove $RPM_BUILD_ROOT prefix from symlinks.
692 for link in $(find $objdir -type l); do
693 target=$(readlink $link)
695 ln -s ${target/$RPM_BUILD_ROOT/} $link
698 perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{kextraver}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
699 cp ../lustre/kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@-%{_target_cpu}%{dashtargetboard}.config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/.config
700 for oc in oldconfig_nonint silentoldconfig oldconfig ; do
701 if grep -q "$oc" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile ; then
709 make "$MAKE_CC" -s $OLDCONFIG -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
710 make "$MAKE_CC" -s symlinks -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
711 make "$MAKE_CC" -s include/linux/version.h -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
713 #this generates modversions info which we want to include and we may as
714 #well include the depends stuff as well, after we fix the paths
715 make -s depend -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
716 find $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL} -name ".*depend" | \
719 sed -e "s|[^ ]*\(/usr/src/linux\)|\1|g" < $file.old > $file
723 # Try to put some smarter autoconf.h and version.h files in place
724 pushd $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/include/linux ; {
725 rm -rf modules modversions.h autoconf.h version.h
726 cat > modversions.h <<EOF
727 #ifndef _LINUX_MODVERSIONS_H
728 #define _LINUX_MODVERSIONS_H
729 #include <linux/rhconfig.h>
730 #include <linux/modsetver.h>
732 echo '#include <linux/rhconfig.h>' > autoconf.h
733 list=`find ../../savedheaders/* -name '*.ver' -exec basename '{}' \; | sort`
736 sed 's,$,modules/'$l, ../../savedheaders/list | awk -f %{SOURCE17} > modules/$l
737 touch -r modules/$l modules/`basename $l .ver`.stamp
738 echo '#include <linux/modules/'$l'>' >> modversions.h
740 echo '#endif' >> modversions.h
741 sed 's,$,autoconf.h,' ../../savedheaders/list | awk -f %{SOURCE16} >> autoconf.h
742 install -m 644 %{SOURCE15} rhconfig.h
743 echo "#include <linux/rhconfig.h>" >> version.h
745 for i in smp BOOT BOOTsmp bigmem bigsmp pseries64 up ; do
746 # When we build in an i386, we don't have an bigmem header directory
747 # in savedheaders/i386/bigmem. We also don't have a BOOT directory
748 # anywhere except in savedheaders/i386. So, we need to use this method
749 # of determining if a kernel version string needs to be included in the
751 verh=`echo ../../savedheaders/*/$i/version.h | awk ' { print $1 } '`
752 if [ -n "$verh" -a -f "$verh" ]; then
753 if [ "$i" = up ]; then
754 if [ "$keyword" = if ]; then
755 echo "#if 0" >> version.h
757 echo "#else" >> version.h
759 echo "#$keyword defined(__module__$i)" >> version.h
762 grep UTS_RELEASE $verh >> version.h
765 echo "#endif" >> version.h
766 if [ -f ../../savedheaders/%{_target_cpu}/up/version.h ] ; then
767 # keep to a standard normally
768 HEADER_FILE=../../savedheaders/%{_target_cpu}/up/version.h
770 # test build not including uniprocessor, must get info from somewhere
771 HEADER_FILE=$(ls ../../savedheaders/*/*/version.h | head -n 1)
773 grep -v UTS_RELEASE $HEADER_FILE >> version.h
774 rm -rf ../../savedheaders
776 touch $RPM_BUILD_ROOT/boot/kernel.h-%{kversion}
778 # rm -f $RPM_BUILD_ROOT/usr/include/linux
780 rm -rf $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/savedheaders
782 if [ "%{rhbuild}" -ne 0 ] ; then
783 # fix up the tmp_include_depends file wrt the buildroot
784 perl -p -i -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/tmp_include_depends
793 rm -rf $RPM_BUILD_ROOT
799 # do this for upgrades...in case the old modules get removed we have
800 # loopback in the kernel so that mkinitrd will work.
803 %pre smp -f presmp.sh
805 %pre bigsmp -f prebigsmp.sh
807 %pre pseries64 -f prepseries64.sh
809 %pre bigmem -f prebigmem.sh
813 %post pseries64 -f postpseries64.sh
815 %post smp -f postsmp.sh
817 %post bigsmp -f postbigsmp.sh
819 %post bigmem -f postbigmem.sh
821 %post jensen -f postjensen.sh
824 %post BOOT -f postBOOT.sh
828 %post -n lustre-lite-utils
829 if [ ! -e /dev/obd ]; then
830 mknod /dev/obd c 10 241
832 if [ ! -e /dev/portals ]; then
833 mknod /dev/portals c 10 240
835 if [ -f /etc/init.d/lustre ] ; then
836 /sbin/chkconfig --add lustre
837 /sbin/chkconfig --add lustrefs
840 # Allow clean removal of modules directory
843 %preun pseries64 -f preunpseries64.sh
845 %preun smp -f preunsmp.sh
847 %preun bigsmp -f preunbigsmp.sh
849 %preun bigmem -f preunbigmem.sh
851 %preun BOOT -f preunBOOT.sh
853 %preun jensen -f preunjensen.sh
855 # suse needs these i guess
858 %postun pseries64 -f postunpseries64.sh
860 %postun smp -f postunsmp.sh
862 %postun bigsmp -f postunbigsmp.sh
864 %postun bigmem -f postunbigmem.sh
866 %postun BOOT -f postunBOOT.sh
868 %postun jensen -f postunjensen.sh
870 # We need this here because we don't prereq kudzu; it could be
871 # installed after the kernel
873 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
875 %triggerin smp -- kudzu
876 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
878 %triggerin bigsmp -- kudzu
879 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
881 %triggerin pseries64 -- kudzu
882 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
884 %triggerin bigmem -- kudzu
885 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
887 %triggerin BOOT -- kudzu
888 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
890 %triggerin jensen -- kudzu
891 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
894 # Old kernel-headers packages owned include symlinks; new
895 # ones just make them so that we can have multiple kernel-headers
896 # packages installed.
898 %triggerpostun source -- kernel-headers < 2.2.16
901 ln -snf linux-%{KVERREL} %{kslnk}
907 ln -snf linux-%{KVERREL} %{kslnk}
910 if [ -L /usr/src/%{kslnk} ]; then
911 if [ -L /usr/src/%{kslnk} -a `ls -ld /usr/src/%{kslnk} 2>/dev/null| awk '{ print $11 }'` = "linux-%{KVERREL}" ]; then
912 [ $1 = 0 ] && rm -f /usr/src/%{kslnk}
917 %preun -n lustre-lite-utils
918 if [ $1 = 0 -a -f /etc/init.d/lustre ]; then
919 /sbin/chkconfig --del lustre
920 /sbin/chkconfig --del lustrefs
928 %files -f kernel.files
932 %files smp -f kernelsmp.files
936 %files bigsmp -f kernelbigsmp.files
939 %if %{buildpseries64}
940 %files pseries64 -f kernelpseries64.files
944 %files bigmem -f kernelbigmem.files
948 %files BOOT -f kernelBOOT.files
953 %files source -f kernel-source.files
956 %defattr(-,root,root)
957 %doc lustre/linux/Documentation/*
959 %files -n lustre-lite-utils
960 %defattr(-, root, root)
961 %doc lustre/COPYING lustre/lustre/BUGS lustre/ChangeLog lustre/README lustre/lustre/doc/lustre.pdf
965 /usr/lib/lustre/python
966 @ENABLE_INIT_SCRIPTS@/etc/init.d/lustre
967 @ENABLE_INIT_SCRIPTS@/etc/init.d/lustrefs
968 /usr/include/lustre/*
971 /usr/share/man/man?/*
973 #%files -n lustre-doc
974 #%defattr(-, root, root)
975 #/usr/share/doc/lustre/COPYING
976 #/usr/share/doc/lustre/lustre.pdf
977 #/usr/share/doc/lustre/COPYING
979 /usr/share/lustre/examples
981 %files -n lustre-ldap
982 %defattr(-, root, root)
983 /etc/openldap/slapd-lustre.conf
984 /etc/openldap/schema/lustre.schema
985 /usr/share/lustre/lustre2ldif.xsl
986 /usr/share/lustre/top.ldif
988 %endif # %{buildbase}