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