Whamcloud - gitweb
- merge 2 weeks of b1_4 fixes onto HEAD
[fs/lustre-release.git] / lustre / scripts / lustre-kernel-2.4.spec.in
1 Summary: The Linux kernel (the core of the Linux operating system)
2
3 # Versions of various parts
4
5 #
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.
10 #
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
16
17 # groups of related archs
18 %define all_x86 i386 i686 i586 athlon
19 #define all_x86 i686 i386 i586 athlon
20
21 %define nptlarchs %{all_x86}
22 #define nptlarchs noarch
23 %define rhbuild @RHBUILD@
24 %define linux26 @LINUX26@
25
26 # disable build root strip policy
27 %define __spec_install_post /usr/lib/rpm/brp-compress || :
28 #
29 # RPM foo magic
30 %define _missing_doc_files_terminate_build    0
31 %define _unpackaged_files_terminate_build 0
32 %define debug_package %{nil}
33
34 # Enable this to build a board-specific kernel configuration 
35 # some architectures have LOTS of different setups and this 
36 # is a way to deal with that cleanly.
37 #
38 #define targetboard assabet
39 %define dashtargetboard %{?targetboard:-%{targetboard}}
40 %define withtargetboard 0
41 %{?targetboard: %{expand: %%define withtargetboard 1}}
42         
43 # Override generic defaults with per-arch defaults (which can
44 # themselves be overridden with --with/--without).  These must
45 # ONLY be "0", never "1"
46
47 %define buildbase 0
48 %define buildbigmem 0
49 %define buildBOOT 0
50 %define buildjensen 0
51 %define buildsmp 0
52 %define buildup 0
53 %define buildsrc 0
54
55 %ifarch @BASE_ARCHS@
56 %define buildbase 1
57 %endif
58
59 %ifarch @BIGMEM_ARCHS@
60 %define buildbigmem 1
61 %endif
62
63 %ifarch @BOOT_ARCHS@
64 %define buildBOOT 1
65 %endif
66
67 %ifarch @JENSEN_ARCHS@
68 %define buildjensen 1
69 %endif
70
71 %ifarch @SMP_ARCHS@
72 %define buildsmp 1
73 %endif
74
75 %ifarch @UP_ARCHS@
76 %define buildup 1
77 %endif
78
79 # For board-specific kernels, build only the normal kernel (which may actually be smp, not up).
80 %if %{withtargetboard}
81 %define buildsmp 0
82 %define buildBOOT 0
83 %define buildbigmem 0
84 %define buildjensen 0
85 %endif
86
87 %if 0
88 Second, per-architecture exclusions (ifarch)
89 %ifarch i386
90 %define buildsmp 0
91 %endif
92 %ifarch ia64
93 %define buildBOOT 0
94 %endif
95 %endif
96
97 # we can't test values inline, only whether a macro exists
98 %{expand: %%define buildup_%{buildup} yadda}
99 %{expand: %%define buildsmp_%{buildsmp} yadda}
100 %{expand: %%define buildBOOT_%{buildBOOT} yadda}
101 %{expand: %%define buildbigmem_%{buildbigmem} yadda}
102 %{expand: %%define buildjensen_%{buildjensen} yadda}
103 %{expand: %%define ikd_%{ikd} yadda}
104 %{expand: %%define ibcs_%{ibcs} yadda}
105 %{expand: %%define debuglevel_%{debugging} yadda}
106
107 %{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}
108
109 %if %{rhbuild}
110 %define BOOT_kernel_prereq fileutils, modutils >=  2.4.18
111 %define kernel_prereq %{BOOT_kernel_prereq}, initscripts >= 5.83, mkinitrd >= 3.2.6
112 %endif
113
114 %ifarch ia64
115 %define initrd_dir /boot/efi/redhat
116 %else
117 %define initrd_dir /boot
118 %endif
119
120 %ifarch %{all_x86} x86_64
121 %define kernel_glob vmlinu?-%{KVERREL}
122 %endif
123 %ifarch ia64
124 # <sigh>, no GLOB_BRACE for filelists, efi needs to be done separately
125 %define kernel_glob vmlinuz-%{KVERREL}
126 %endif
127 %ifarch alpha
128 %define kernel_glob vmlinu?-%{KVERREL}
129 %endif
130
131 Name: kernel
132 Version: %{kversion}
133 Release: %{release}%{?targetboard:%{targetboard}}%{?debuglevel_1:.dbg}
134 %define KVERREL %{PACKAGE_VERSION}-%{kextraver}%{?targetboard:%{targetboard}}%{?debuglevel_1:.dbg}
135 License: GPL
136 Group: System Environment/Kernel
137 ExclusiveArch: %{all_x86} x86_64 ia64
138 ExclusiveOS: Linux
139 Obsoletes: kernel-modules, kernel-sparc
140 Provides: kernel = %{version}
141 BuildConflicts: rhbuildsys(DiscFree) < 500Mb
142 %ifarch %{all_x86} ia64 x86_64
143 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
144 %endif
145 Autoreqprov: no
146 %if %{rhbuild}
147 Prereq: %{kernel_prereq}
148 Conflicts: %{kernel_conflicts}
149
150 BuildPreReq: patch >= 2.5.4, bash >= 2.03, sh-utils, gnupg, tar
151 BuildPreReq: bzip2, findutils, dev, gzip, m4
152 %endif
153
154 Vendor: Cluster File Systems, Inc.
155 URL: http://www.kernel.org/
156 Buildroot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root
157
158 Source0: @LUSTRE_SOURCE@
159 Source1: @KERNEL_SOURCE@
160
161 Source15: linux-rhconfig.h
162 Source16: linux-merge-config.awk
163 Source17: linux-merge-modules.awk
164
165 %package source
166 Summary: The source code for the Linux kernel.
167 Group: Development/System
168 Prereq: fileutils
169 Requires: gawk
170 Requires: gcc >= 2.96-98
171
172 %package doc
173 Summary: Various documentation bits found in the kernel source.
174 Group: Documentation
175
176 %description
177 The kernel package contains the Linux kernel (vmlinuz), the core of a
178 Linux operating system.  The kernel handles the basic functions of the
179 operating system: memory allocation, process allocation, device input
180 and output, etc.
181
182 %description source
183 The kernel-source package contains the source code files for the Linux
184 kernel. These source files are needed to build custom/third party device
185 drivers. The source files can also be used to build a custom kernel that is
186 better tuned to your particular hardware, if you are so inclined (and you
187 know what you're doing).
188
189 %description doc
190 This package contains documentation files form the kernel
191 source. Various bits of information about the Linux kernel and the
192 device drivers shipped with it are documented in these files. 
193
194 You'll want to install this package if you need a reference to the
195 options that can be passed to Linux kernel modules at load time.
196
197 %package smp
198 Summary: The Linux kernel compiled for SMP machines.
199 Group: System Environment/Kernel
200 Provides: module-info, kernel = %{version}
201 %ifarch %{all_x86} ia64 x86_64
202 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
203 %endif
204 %if %{rhbuild}
205 Prereq: %{kernel_prereq}
206 Conflicts: %{kernel_conflicts}
207 %endif
208
209 %description smp
210 This package includes a SMP version of the Linux kernel. It is
211 required only on machines with two or more CPUs, although it should
212 work fine on single-CPU boxes.
213
214 Install the kernel-smp package if your machine uses two or more CPUs.
215
216 %package bigmem
217 Summary: The Linux Kernel for machines with more than 4 Gigabyte of memory.
218 Group: System Environment/Kernel
219 Provides: module-info, kernel = %{version}
220 %ifarch %{all_x86} ia64 x86_64
221 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
222 %endif
223 %if %{rhbuild}
224 Prereq: %{kernel_prereq}
225 Conflicts: %{kernel_conflicts}
226 Obsoletes: kernel-enterprise <= 2.4.10
227 %endif
228
229 %description bigmem
230 This package includes a kernel that has appropriate configuration options
231 enabled for Pentium III machines with 4 Gigabyte of memory or more.
232
233 %package BOOT
234 Summary: The version of the Linux kernel used on installation boot disks.
235 Group: System Environment/Kernel
236 Provides: kernel = %{version}
237 %if %{rhbuild}
238 Prereq: %{BOOT_kernel_prereq}
239 Conflicts: %{kernel_conflicts}
240 %endif
241
242 %description BOOT
243 This package includes a trimmed down version of the Linux kernel.
244 This kernel is used on the installation boot disks only and should not
245 be used for an installed system, as many features in this kernel are
246 turned off because of the size constraints.
247
248 %package BOOTsmp
249 Summary: The Linux kernel used on installation boot disks for SMP machines.
250 Group: System Environment/Kernel
251 Provides: kernel = %{version}
252 %if %{rhbuild}
253 Prereq: %{BOOT_kernel_prereq}
254 Conflicts: %{kernel_conflicts}
255 %endif
256
257 %description BOOTsmp
258 This package includes a trimmed down version of the Linux kernel. This
259 kernel is used on the installation boot disks only and should not be used
260 for an installed system, as many features in this kernel are turned off
261 because of the size constraints. This kernel is used when booting SMP
262 machines that have trouble coming up to life with the uniprocessor kernel.
263
264 %package jensen
265 Summary: The Linux Kernel compiled for the Alpha Jensen platform.
266 Group: System Environment/Kernel
267 Provides: kernel = %{version}
268 %if %{rhbuild}
269 Prereq: %{kernel_prereq}
270 Conflicts: %{kernel_conflicts}
271 %endif
272
273 %description jensen
274 This package includes a kernel that has appropriate configuration
275 options enabled for use on the Alpha Jensen platform.  The Jensen
276 platform is not supported in the normal generic alpha kernel support.
277
278 %package -n lustre-lite-utils
279 Summary: Lustre utils for Linux
280 Group: Applications/System
281
282 %description -n lustre-lite-utils
283 The Lustre Lite file system utilities.  This includes the tools needed
284 to configure, mount, and administer a Lustre filesystem.  This package
285 is necessary if you want to access a Lustre filesystem.
286
287 # the lustre-doc files are just included as %doc wiht
288 # lustre-lite-utils
289
290 #%package -n lustre-doc
291 #Summary: Sample Lustre configurations and documentation
292 #Group: Documentation
293
294 #%description -n lustre-doc
295 #The Lustre book, sample configurations, and other documentation for
296 #Lustre.
297
298 %package -n lustre-ldap
299 Summary: LDAP schema files for Lustre
300 Group: System Environment/Daemons
301
302 %description -n lustre-ldap
303 LDAP schema files for Lustre.  These are needed if you plan to store
304 your Lustre configuration in LDAP, rather than on disk.
305
306 %prep
307 %setup -n lustre-kernel-%{version} -q -c
308 if [ ! -d lustre ] ; then
309     ln -sf lustre* lustre
310 fi
311 pushd lustre >/dev/null
312 sh -x ./scripts/lmake \
313         --unpack-kernel \
314         --target @LUSTRE_TARGET@ \
315         --kerneldir $RPM_SOURCE_DIR
316 popd >/dev/null
317
318 %build
319 # if RPM_BUILD_NCPUS unset, set it
320 if [ -z "$RPM_BUILD_NCPUS" ] ; then
321     RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat || :)
322     if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
323         RPM_BUILD_NCPUS=1
324     fi
325     if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
326         RPM_BUILD_NCPUS=8
327     fi
328 fi
329
330 rm -rf $RPM_BUILD_ROOT
331 mkdir -p $RPM_BUILD_ROOT
332
333 DependKernel()
334 {
335   target_config=${1:+--target-config $1}
336   sh -x ./scripts/lmake \
337         --depend-kernel \
338         --target @LUSTRE_TARGET@ \
339         --target-arch %{_target_cpu} \
340         ${target_config} \
341         --extraversion %{kextraver} \
342         -j $RPM_BUILD_NCPUS
343 }
344
345 BuildKernel()
346 {
347   target_config=${1:+--target-config $1}
348   sh -x ./scripts/lmake \
349         --build-kernel --build-lustre \
350         --install \
351         --target @LUSTRE_TARGET@ \
352         --target-arch %{_target_cpu} \
353         ${target_config} \
354         --extraversion %{kextraver} \
355         --kerneldir $RPM_SOURCE_DIR \
356         -j $RPM_BUILD_NCPUS \
357         --destdir $RPM_BUILD_ROOT \
358         -- @CONFIGURE_FLAGS@
359 }
360
361 BuildLustre()
362 {
363   target_config=${1:+--target-config $1}
364   sh -x ./scripts/lmake \
365         --build-lustre \
366         --install-lustre \
367         --target @LUSTRE_TARGET@ \
368         --target-arch %{_target_cpu} \
369         ${target_config} \
370         --extraversion %{kextraver} \
371         --kerneldir $RPM_SOURCE_DIR \
372         -j $RPM_BUILD_NCPUS \
373         --destdir $RPM_BUILD_ROOT \
374         -- @CONFIGURE_FLAGS@
375 }
376
377 SaveHeaders()
378 {
379   sh -x ./scripts/lmake \
380         --save-headers \
381         --target @LUSTRE_TARGET@ \
382         --extraversion %{kextraver} \
383         --destdir $RPM_BUILD_ROOT
384 }
385
386 pushd lustre >/dev/null
387
388 %if %{buildbigmem}
389 BuildKernel bigmem
390 %endif
391
392 %if %{buildBOOT}
393 BuildKernel BOOT
394 %endif
395
396 %if %{buildjensen}
397 BuildKernel jensen
398 %endif
399
400 %if %{buildsmp}
401 BuildKernel smp
402 %endif
403
404 # we want this one last, so that it is the one populating /usr/bin
405 %if %{buildup} && %{buildbase}
406 BuildKernel
407 %elseif %{buildbase}
408 BuildLustre
409 %endif
410
411 %if %{buildbase}
412 SaveHeaders
413 %endif
414
415 popd >/dev/null
416
417 %install
418 pushd lustre >/dev/null
419 # it's already installed, so just clean up some things that are rpm
420 # specific
421 for i in $RPM_BUILD_ROOT/lib/modules/* ; do
422   rm -f $i/modules.*
423   rm -f $i/build
424   ln -sf ../../../usr/src/linux-%{KVERREL} $i/build
425 %ifarch %{ntplarchs}
426   # remove legacy pcmcia symlink that's no longer useful
427   rm -rf $i/pcmcia
428 %endif
429 done
430
431 # mark the vmlinux* non-executable to fool strip-to-file
432 chmod a-x $RPM_BUILD_ROOT/boot/vmlinux*
433
434 ##
435 ## do -source package cleanup/install
436 ##
437 %if %{buildbase}
438 pushd linux >/dev/null
439 mkdir -p $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
440 rm -f drivers/net/hamradio/soundmodem/gentbl scripts/mkdep
441 tar cf - . | tar xf - -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
442 perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{kextraver}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
443 ln -sf linux-%{KVERREL} $RPM_BUILD_ROOT/usr/src/linux
444 # install -m 644 %{SOURCE10}  $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
445
446 #clean up the destination
447 make -s mrproper -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
448 rm -rf $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
449 mkdir -p $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
450 cp ../kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@*.config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
451 cp ../kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@-%{_target_cpu}%{dashtargetboard}.config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/.config
452 if grep -q oldconfig_nonint $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile ; then
453         OLDCONFIG='oldconfig_nonint'
454 else
455         OLDCONFIG='oldconfig'
456 fi
457 make -s $OLDCONFIG -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
458 %if %{linux26}
459 make -s include/asm -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
460 %else
461 make -s symlinks -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
462 %endif
463 make -s include/linux/version.h -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
464
465 #this generates modversions info which we want to include and we may as
466 #well include the depends stuff as well, after we fix the paths
467 make -s depend -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
468 find $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL} -name ".*depend" | \
469 while read file ; do
470     mv $file $file.old
471     sed -e "s|[^ ]*\(/usr/src/linux\)|\1|g" < $file.old > $file
472     rm -f $file.old
473 done
474
475 # Try to put some smarter autoconf.h and version.h files in place
476 pushd $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/include/linux ; {
477 rm -rf modules modversions.h autoconf.h version.h
478 cat > modversions.h <<EOF
479 #ifndef _LINUX_MODVERSIONS_H
480 #define _LINUX_MODVERSIONS_H
481 #include <linux/rhconfig.h>
482 #include <linux/modsetver.h>
483 EOF
484 echo '#include <linux/rhconfig.h>' > autoconf.h
485 list=`find ../../savedheaders/* -name '*.ver' -exec basename '{}' \; | sort`
486 mkdir modules
487 for l in $list; do
488     sed 's,$,modules/'$l, ../../savedheaders/list | awk -f %{SOURCE17} > modules/$l
489     touch -r modules/$l modules/`basename $l .ver`.stamp
490     echo '#include <linux/modules/'$l'>' >> modversions.h
491 done
492 echo '#endif' >> modversions.h
493 sed 's,$,autoconf.h,' ../../savedheaders/list | awk -f %{SOURCE16} >> autoconf.h
494 install -m 644 %{SOURCE15} rhconfig.h
495 echo "#include <linux/rhconfig.h>" >> version.h
496 keyword=if
497 for i in smp BOOT BOOTsmp bigmem  up ; do
498 # When we build in an i386, we don't have an bigmem header directory
499 # in savedheaders/i386/bigmem.  We also don't have a BOOT directory
500 # anywhere except in savedheaders/i386.  So, we need to use this method
501 # of determining if a kernel version string needs to be included in the
502 # version.h file
503     verh=`echo ../../savedheaders/*/$i/version.h | awk ' { print $1 } '`
504     if [ -n "$verh" -a -f "$verh" ]; then
505         if [ "$i" = up ]; then
506             if [ "$keyword" = if ]; then
507                 echo "#if 0" >> version.h
508             fi
509             echo "#else" >> version.h
510         else
511             echo "#$keyword defined(__module__$i)" >> version.h
512             keyword=elif
513         fi
514         grep UTS_RELEASE $verh >> version.h
515     fi
516 done
517 echo "#endif" >> version.h
518 if [ -f ../../savedheaders/%{_target_cpu}/up/version.h ] ; then
519     # keep to a standard normally
520     HEADER_FILE=../../savedheaders/%{_target_cpu}/up/version.h
521 else
522     # test build not including uniprocessor, must get info from somewhere
523     HEADER_FILE=$(ls ../../savedheaders/*/*/version.h | head -1)
524 fi
525 grep -v UTS_RELEASE $HEADER_FILE >> version.h
526 rm -rf ../../savedheaders
527 } ; popd
528 touch $RPM_BUILD_ROOT/boot/kernel.h-%{kversion}
529
530 rm -f $RPM_BUILD_ROOT/usr/include/linux
531
532 rm -rf $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/savedheaders
533
534 %if %{rhbuild}
535 # fix up the tmp_include_depends file wrt the buildroot
536 perl -p -i -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/tmp_include_depends
537 %endif
538
539 popd >/dev/null
540 %endif
541
542 popd >/dev/null
543
544 %clean
545 rm -rf $RPM_BUILD_ROOT
546
547 ###
548 ### scripts
549 ###
550
551 # do this for upgrades...in case the old modules get removed we have
552 # loopback in the kernel so that mkinitrd will work.
553 %pre 
554 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
555 exit 0
556
557 %pre smp
558 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
559 exit 0
560
561 %pre bigmem
562 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
563 exit 0
564
565 %post 
566 cd /boot
567 %ifnarch ia64 
568 ln -sf vmlinuz-%{KVERREL} vmlinuz
569 %endif
570 ln -sf System.map-%{KVERREL} System.map
571 ln -sf module-info-%{KVERREL} module-info
572 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
573 [ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
574 if [ -x /sbin/new-kernel-pkg ] ; then
575         /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}
576 fi
577
578
579 %post smp
580 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
581 [ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
582 if [ -x /sbin/new-kernel-pkg ] ; then
583         /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}smp
584 fi
585
586 %post bigmem
587 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
588 [ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
589 if [ -x /sbin/new-kernel-pkg ] ; then
590         /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}bigmem
591 fi
592
593 %post jensen
594 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
595 [ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
596 if [ -x /sbin/new-kernel-pkg ] ; then
597         /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}jensen
598 fi
599
600 %ifnarch ia64
601 %post BOOT
602 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
603 [ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
604 if [ -x /sbin/new-kernel-pkg ] ; then
605         /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}BOOT
606 fi
607
608 %endif
609
610 # Allow clean removal of modules directory
611 %preun 
612 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
613 #rm -f /lib/modules/%{KVERREL}/modules.*
614 if [ -x /sbin/new-kernel-pkg ] ; then
615  /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}
616 fi
617
618
619 %preun smp
620 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
621 rm -f /lib/modules/%{KVERREL}smp/modules.*
622 if [ -x /sbin/new-kernel-pkg ] ; then
623  /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}smp
624 fi
625
626
627 %preun bigmem
628 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
629 rm -f /lib/modules/%{KVERREL}bigmem/modules.*
630 if [ -x /sbin/new-kernel-pkg ] ; then
631  /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}bigmem
632 fi
633
634
635 %preun BOOT
636 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
637 #rm -f /lib/modules/%{KVERREL}BOOT/modules.*
638 if [ -x /sbin/new-kernel-pkg ] ; then
639  /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}BOOT
640 fi
641
642
643 %preun jensen
644 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
645 #rm -f /lib/modules/%{KVERREL}jensen/modules.*
646
647
648 # We need this here because we don't prereq kudzu; it could be
649 # installed after the kernel
650 %triggerin -- kudzu
651 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
652
653 %triggerin smp -- kudzu
654 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
655
656 %triggerin bigmem -- kudzu
657 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
658
659 %triggerin BOOT -- kudzu
660 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
661
662 %triggerin jensen -- kudzu
663 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
664
665
666 # Old kernel-headers packages owned include symlinks; new
667 # ones just make them so that we can have multiple kernel-headers
668 # packages installed.
669
670 %triggerpostun source -- kernel-headers < 2.2.16
671 cd /usr/src
672 rm -f %{kslnk}
673 ln -snf linux-%{KVERREL} %{kslnk}
674 exit 0
675
676 %post source
677 cd /usr/src
678 rm -f %{kslnk}
679 ln -snf linux-%{KVERREL} %{kslnk}
680
681 %postun source
682 if [ -L /usr/src/%{kslnk} ]; then 
683     if [ -L /usr/src/%{kslnk} -a `ls -ld /usr/src/%{kslnk} 2>/dev/null| awk '{ print $11 }'` = "linux-%{KVERREL}" ]; then
684         [ $1 = 0 ] && rm -f /usr/src/%{kslnk}
685     fi
686 fi
687 exit 0
688
689 ###
690 ### file lists
691 ###
692
693 %if %{buildup}
694 %files
695 %defattr(-, root, root)
696 /boot/%{kernel_glob}
697 %ifarch ia64
698 /boot/efi/redhat/%{kernel_glob}
699 %endif
700 /boot/System.map-%{KVERREL}
701 /boot/config-%{KVERREL}
702 %dir /lib/modules
703 %dir /dev/shm
704 /lib/modules/%{KVERREL}
705 %endif
706
707 %if %{buildsmp}
708 %files smp
709 %defattr(-, root, root)
710 /boot/%{kernel_glob}smp
711 %ifarch ia64
712 /boot/efi/redhat/%{kernel_glob}smp
713 %endif
714 /boot/System.map-%{KVERREL}smp
715 /boot/config-%{KVERREL}smp
716 %dir /lib/modules
717 %dir /dev/shm
718 /lib/modules/%{KVERREL}smp
719 %endif
720
721 %if %{buildbigmem}
722 %files bigmem
723 %defattr(-, root, root)
724 /boot/%{kernel_glob}bigmem
725 %ifarch ia64
726 /boot/efi/redhat/%{kernel_glob}bigmem
727 %endif
728 /boot/System.map-%{KVERREL}bigmem
729 /boot/config-%{KVERREL}bigmem
730 %dir /lib/modules
731 %dir /dev/shm
732 /lib/modules/%{KVERREL}bigmem
733 %endif
734
735 %if %{buildBOOT}
736 %files BOOT
737 %defattr(-, root, root)
738 /boot/%{kernel_glob}BOOT
739 %ifarch ia64
740 /boot/efi/redhat/%{kernel_glob}BOOT
741 %endif
742 /boot/System.map-%{KVERREL}BOOT
743 /boot/config-%{KVERREL}BOOT
744 %dir /lib/modules
745 %dir /dev/shm
746 /lib/modules/%{KVERREL}BOOT
747 %endif
748
749 %if %{buildbase}
750
751 %if 1
752 %files source
753 %defattr(-,root,root)
754 %dir /usr/src/linux-%{KVERREL}
755 /usr/src/linux-%{KVERREL}/COPYING*
756 /usr/src/linux-%{KVERREL}/CREDITS
757 /usr/src/linux-%{KVERREL}/Documentation
758 /usr/src/linux-%{KVERREL}/MAINTAINERS
759 /usr/src/linux-%{KVERREL}/Makefile
760 /usr/src/linux-%{KVERREL}/README
761 /usr/src/linux-%{KVERREL}/REPORTING-BUGS
762 /usr/src/linux-%{KVERREL}/arch
763 %ifarch sparc
764 /usr/src/linux-%{KVERREL}/arch/sparc64
765 %endif
766 /usr/src/linux-%{KVERREL}/drivers
767 %if %{rhbuild}
768 /usr/src/linux-%{KVERREL}/crypto
769 %endif
770 /usr/src/linux-%{KVERREL}/fs
771 /usr/src/linux-%{KVERREL}/init
772 /usr/src/linux-%{KVERREL}/ipc
773 /usr/src/linux-%{KVERREL}/kernel
774 /usr/src/linux-%{KVERREL}/lib
775 /usr/src/linux-%{KVERREL}/mm
776 /usr/src/linux-%{KVERREL}/net
777 /usr/src/linux-%{KVERREL}/scripts
778 %ifarch %{all_x86}
779 %{?ibcs_1:/usr/src/linux-%{KVERREL}/abi}
780 %endif
781 /usr/src/linux-%{KVERREL}/configs
782 /usr/src/linux-%{KVERREL}/include
783 /usr/src/linux-%{KVERREL}/include/asm
784 %ifarch %{all_x86}
785 %{?ibcs_1:/usr/src/linux-%{KVERREL}/include/abi}
786 %endif
787 /usr/src/linux-%{KVERREL}/include/linux
788 %if %{rhbuild}
789 /usr/src/linux-%{KVERREL}/include/rxrpc
790 %endif
791 /usr/src/linux-%{KVERREL}/include/net
792 /usr/src/linux-%{KVERREL}/include/pcmcia
793 /usr/src/linux-%{KVERREL}/include/scsi
794 /usr/src/linux-%{KVERREL}/include/video
795 %if %{rhbuild}
796 /usr/src/linux-%{KVERREL}/tmp_include_depends
797 %endif
798 %dir /usr/src/linux-%{KVERREL}/include
799 %dir /usr/src/linux-%{KVERREL}/arch
800 %ifarch alpha sparc
801 /usr/src/linux-%{KVERREL}/include/math-emu
802 %endif
803 %if %{linux26}
804 %dir /usr/src/linux-%{KVERREL}/crypto
805 %dir /usr/src/linux-%{KVERREL}/kdb
806 %dir /usr/src/linux-%{KVERREL}/rpmify
807 %dir /usr/src/linux-%{KVERREL}/security
808 %else
809 /usr/src/linux-%{KVERREL}/Rules.make
810 %endif
811 %endif
812
813 %files doc
814 %defattr(-,root,root)
815 %doc lustre/linux/Documentation/*
816
817 %files -n lustre-lite-utils
818 %defattr(-, root, root)
819 %doc lustre/COPYING lustre/BUGS lustre/ChangeLog lustre/README lustre/doc/lustre.pdf
820 /sbin/*
821 /usr/sbin/*
822 /usr/bin/*
823 /usr/lib/lustre/python
824 /etc/init.d/lustre
825 /usr/include/lustre
826 /lib/lib*.a
827
828 #%files -n lustre-doc
829 #%defattr(-, root, root)
830 #/usr/share/doc/lustre/COPYING
831 #/usr/share/doc/lustre/lustre.pdf
832 #/usr/share/doc/lustre/COPYING
833
834 /usr/lib/lustre/examples
835
836 %files -n lustre-ldap
837 %defattr(-, root, root)
838 /etc/openldap/slapd-lustre.conf
839 /etc/openldap/schema/lustre.schema
840 /usr/lib/lustre/lustre2ldif.xsl
841 /usr/lib/lustre/top.ldif
842
843 %endif # %{buildbase}