Whamcloud - gitweb
- landing of b_hd_cleanup_merge to 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         -- --enable-modules \
359         --disable-doc --disable-tests \
360         --disable-utils --disable-liblustre \
361         --sysconfdir=%{_sysconfdir} \
362         --mandir=%{_mandir} \
363         @CONFIGURE_FLAGS@
364 }
365
366 BuildLustre()
367 {
368   target_config=${1:+--target-config $1}
369   sh -x ./scripts/lmake \
370         --build-lustre \
371         --install-lustre \
372         --target @LUSTRE_TARGET@ \
373         --target-arch %{_target_cpu} \
374         ${target_config} \
375         --extraversion %{kextraver} \
376         --kerneldir $RPM_SOURCE_DIR \
377         -j $RPM_BUILD_NCPUS \
378         --destdir $RPM_BUILD_ROOT \
379         -- --enable-utils \
380         --disable-doc --disable-tests \
381         --disable-modules --disable-liblustre \
382         --sysconfdir=%{_sysconfdir} \
383         --mandir=%{_mandir} \
384         @CONFIGURE_FLAGS@
385 }
386
387 SaveHeaders()
388 {
389   sh -x ./scripts/lmake \
390         --save-headers \
391         --target @LUSTRE_TARGET@ \
392         --extraversion %{kextraver} \
393         --destdir $RPM_BUILD_ROOT
394 }
395
396 pushd lustre >/dev/null
397
398 %if %{buildbigmem}
399 BuildKernel bigmem
400 %endif
401
402 %if %{buildBOOT}
403 BuildKernel BOOT
404 %endif
405
406 %if %{buildjensen}
407 BuildKernel jensen
408 %endif
409
410 %if %{buildsmp}
411 BuildKernel smp
412 %endif
413
414 %if %{buildup}
415 BuildKernel
416 %endif
417
418 %if %{buildbase}
419 BuildLustre
420 SaveHeaders
421 %endif
422
423 popd >/dev/null
424
425 %install
426 pushd lustre >/dev/null
427 # it's already installed, so just clean up some things that are rpm
428 # specific
429 for i in $RPM_BUILD_ROOT/lib/modules/* ; do
430   rm -f $i/modules.*
431   rm -f $i/build
432   ln -sf ../../../usr/src/linux-%{KVERREL} $i/build
433 %ifarch %{ntplarchs}
434   # remove legacy pcmcia symlink that's no longer useful
435   rm -rf $i/pcmcia
436 %endif
437 done
438
439 # mark the vmlinux* non-executable to fool strip-to-file
440 chmod a-x $RPM_BUILD_ROOT/boot/vmlinux*
441
442 ##
443 ## do -source package cleanup/install
444 ##
445 %if %{buildbase}
446 pushd linux >/dev/null
447 mkdir -p $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
448 rm -f drivers/net/hamradio/soundmodem/gentbl scripts/mkdep
449 tar cf - . | tar xf - -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
450 perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{kextraver}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
451 ln -sf linux-%{KVERREL} $RPM_BUILD_ROOT/usr/src/linux
452 # install -m 644 %{SOURCE10}  $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
453
454 #clean up the destination
455 make -s mrproper -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
456 rm -rf $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
457 mkdir -p $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
458 cp ../kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@*.config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
459 cp ../kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@-%{_target_cpu}%{dashtargetboard}.config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/.config
460 if grep -q oldconfig_nonint $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile ; then
461         OLDCONFIG='oldconfig_nonint'
462 else
463         OLDCONFIG='oldconfig'
464 fi
465 make -s $OLDCONFIG -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
466 %if %{linux26}
467 make -s include/asm -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
468 %else
469 make -s symlinks -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
470 %endif
471 make -s include/linux/version.h -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
472
473 #this generates modversions info which we want to include and we may as
474 #well include the depends stuff as well, after we fix the paths
475 make -s depend -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
476 find $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL} -name ".*depend" | \
477 while read file ; do
478     mv $file $file.old
479     sed -e "s|[^ ]*\(/usr/src/linux\)|\1|g" < $file.old > $file
480     rm -f $file.old
481 done
482
483 # Try to put some smarter autoconf.h and version.h files in place
484 pushd $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/include/linux ; {
485 rm -rf modules modversions.h autoconf.h version.h
486 cat > modversions.h <<EOF
487 #ifndef _LINUX_MODVERSIONS_H
488 #define _LINUX_MODVERSIONS_H
489 #include <linux/rhconfig.h>
490 #include <linux/modsetver.h>
491 EOF
492 echo '#include <linux/rhconfig.h>' > autoconf.h
493 list=`find ../../savedheaders/* -name '*.ver' -exec basename '{}' \; | sort`
494 mkdir modules
495 for l in $list; do
496     sed 's,$,modules/'$l, ../../savedheaders/list | awk -f %{SOURCE17} > modules/$l
497     touch -r modules/$l modules/`basename $l .ver`.stamp
498     echo '#include <linux/modules/'$l'>' >> modversions.h
499 done
500 echo '#endif' >> modversions.h
501 sed 's,$,autoconf.h,' ../../savedheaders/list | awk -f %{SOURCE16} >> autoconf.h
502 install -m 644 %{SOURCE15} rhconfig.h
503 echo "#include <linux/rhconfig.h>" >> version.h
504 keyword=if
505 for i in smp BOOT BOOTsmp bigmem  up ; do
506 # When we build in an i386, we don't have an bigmem header directory
507 # in savedheaders/i386/bigmem.  We also don't have a BOOT directory
508 # anywhere except in savedheaders/i386.  So, we need to use this method
509 # of determining if a kernel version string needs to be included in the
510 # version.h file
511     verh=`echo ../../savedheaders/*/$i/version.h | awk ' { print $1 } '`
512     if [ -n "$verh" -a -f "$verh" ]; then
513         if [ "$i" = up ]; then
514             if [ "$keyword" = if ]; then
515                 echo "#if 0" >> version.h
516             fi
517             echo "#else" >> version.h
518         else
519             echo "#$keyword defined(__module__$i)" >> version.h
520             keyword=elif
521         fi
522         grep UTS_RELEASE $verh >> version.h
523     fi
524 done
525 echo "#endif" >> version.h
526 if [ -f ../../savedheaders/%{_target_cpu}/up/version.h ] ; then
527     # keep to a standard normally
528     HEADER_FILE=../../savedheaders/%{_target_cpu}/up/version.h
529 else
530     # test build not including uniprocessor, must get info from somewhere
531     HEADER_FILE=$(ls ../../savedheaders/*/*/version.h | head -n 1)
532 fi
533 grep -v UTS_RELEASE $HEADER_FILE >> version.h
534 rm -rf ../../savedheaders
535 } ; popd
536 touch $RPM_BUILD_ROOT/boot/kernel.h-%{kversion}
537
538 #rm -f $RPM_BUILD_ROOT/usr/include/linux
539
540 rm -rf $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/savedheaders
541
542 %if %{rhbuild}
543 # fix up the tmp_include_depends file wrt the buildroot
544 perl -p -i -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/tmp_include_depends
545 %endif
546
547 popd >/dev/null
548 %endif
549
550 popd >/dev/null
551
552 %clean
553 rm -rf $RPM_BUILD_ROOT
554
555 ###
556 ### scripts
557 ###
558
559 # do this for upgrades...in case the old modules get removed we have
560 # loopback in the kernel so that mkinitrd will work.
561 %pre 
562 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
563 exit 0
564
565 %pre smp
566 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
567 exit 0
568
569 %pre bigmem
570 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
571 exit 0
572
573 %post 
574 cd /boot
575 %ifnarch ia64 
576 ln -sf vmlinuz-%{KVERREL} vmlinuz
577 %endif
578 ln -sf System.map-%{KVERREL} System.map
579 ln -sf module-info-%{KVERREL} module-info
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}
584 fi
585
586
587 %post smp
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}smp
592 fi
593
594 %post bigmem
595 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
596 [ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
597 if [ -x /sbin/new-kernel-pkg ] ; then
598         /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}bigmem
599 fi
600
601 %post jensen
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}jensen
606 fi
607
608 %ifnarch ia64
609 %post BOOT
610 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
611 [ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
612 if [ -x /sbin/new-kernel-pkg ] ; then
613         /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}BOOT
614 fi
615
616 %endif
617
618 %post -n lustre-lite-utils
619 if [ ! -e /dev/obd ]; then
620    mknod /dev/obd c 10 241
621 fi
622 if [ ! -e /dev/portals ]; then
623    mknod /dev/portals c 10 240
624 fi
625 /sbin/chkconfig --add lustre
626 /sbin/chkconfig --add lustrefs
627
628
629 # Allow clean removal of modules directory
630 %preun 
631 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
632 #rm -f /lib/modules/%{KVERREL}/modules.*
633 if [ -x /sbin/new-kernel-pkg ] ; then
634  /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}
635 fi
636
637
638 %preun smp
639 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
640 rm -f /lib/modules/%{KVERREL}smp/modules.*
641 if [ -x /sbin/new-kernel-pkg ] ; then
642  /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}smp
643 fi
644
645
646 %preun bigmem
647 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
648 rm -f /lib/modules/%{KVERREL}bigmem/modules.*
649 if [ -x /sbin/new-kernel-pkg ] ; then
650  /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}bigmem
651 fi
652
653
654 %preun BOOT
655 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
656 #rm -f /lib/modules/%{KVERREL}BOOT/modules.*
657 if [ -x /sbin/new-kernel-pkg ] ; then
658  /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}BOOT
659 fi
660
661
662 %preun jensen
663 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
664 #rm -f /lib/modules/%{KVERREL}jensen/modules.*
665
666
667 # We need this here because we don't prereq kudzu; it could be
668 # installed after the kernel
669 %triggerin -- kudzu
670 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
671
672 %triggerin smp -- kudzu
673 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
674
675 %triggerin bigmem -- kudzu
676 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
677
678 %triggerin BOOT -- kudzu
679 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
680
681 %triggerin jensen -- kudzu
682 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
683
684
685 # Old kernel-headers packages owned include symlinks; new
686 # ones just make them so that we can have multiple kernel-headers
687 # packages installed.
688
689 %triggerpostun source -- kernel-headers < 2.2.16
690 cd /usr/src
691 rm -f %{kslnk}
692 ln -snf linux-%{KVERREL} %{kslnk}
693 exit 0
694
695 %post source
696 cd /usr/src
697 rm -f %{kslnk}
698 ln -snf linux-%{KVERREL} %{kslnk}
699
700 %postun source
701 if [ -L /usr/src/%{kslnk} ]; then 
702     if [ -L /usr/src/%{kslnk} -a `ls -ld /usr/src/%{kslnk} 2>/dev/null| awk '{ print $11 }'` = "linux-%{KVERREL}" ]; then
703         [ $1 = 0 ] && rm -f /usr/src/%{kslnk}
704     fi
705 fi
706 exit 0
707
708 %preun -n lustre-lite-utils
709 if [ $1 = 0 ]; then
710   /sbin/chkconfig --del lustre
711   /sbin/chkconfig --del lustrefs
712 fi
713
714
715 ###
716 ### file lists
717 ###
718
719 %if %{buildup}
720 %files
721 %defattr(-, root, root)
722 /boot/%{kernel_glob}
723 %ifarch ia64
724 /boot/efi/redhat/%{kernel_glob}
725 %endif
726 /boot/System.map-%{KVERREL}
727 /boot/config-%{KVERREL}
728 %dir /lib/modules
729 %dir /dev/shm
730 /lib/modules/%{KVERREL}
731 %endif
732
733 %if %{buildsmp}
734 %files smp
735 %defattr(-, root, root)
736 /boot/%{kernel_glob}smp
737 %ifarch ia64
738 /boot/efi/redhat/%{kernel_glob}smp
739 %endif
740 /boot/System.map-%{KVERREL}smp
741 /boot/config-%{KVERREL}smp
742 %dir /lib/modules
743 %dir /dev/shm
744 /lib/modules/%{KVERREL}smp
745 %endif
746
747 %if %{buildbigmem}
748 %files bigmem
749 %defattr(-, root, root)
750 /boot/%{kernel_glob}bigmem
751 %ifarch ia64
752 /boot/efi/redhat/%{kernel_glob}bigmem
753 %endif
754 /boot/System.map-%{KVERREL}bigmem
755 /boot/config-%{KVERREL}bigmem
756 %dir /lib/modules
757 %dir /dev/shm
758 /lib/modules/%{KVERREL}bigmem
759 %endif
760
761 %if %{buildBOOT}
762 %files BOOT
763 %defattr(-, root, root)
764 /boot/%{kernel_glob}BOOT
765 %ifarch ia64
766 /boot/efi/redhat/%{kernel_glob}BOOT
767 %endif
768 /boot/System.map-%{KVERREL}BOOT
769 /boot/config-%{KVERREL}BOOT
770 %dir /lib/modules
771 %dir /dev/shm
772 /lib/modules/%{KVERREL}BOOT
773 %endif
774
775 %if %{buildbase}
776
777 %if 1
778 %files source
779 %defattr(-,root,root)
780 %dir /usr/src/linux-%{KVERREL}
781 /usr/src/linux-%{KVERREL}/*
782 %endif
783
784 %files doc
785 %defattr(-,root,root)
786 %doc lustre/linux/Documentation/*
787
788 %files -n lustre-lite-utils
789 %defattr(-, root, root)
790 %doc lustre/COPYING lustre/BUGS lustre/ChangeLog lustre/README lustre/doc/lustre.pdf
791 /sbin/*
792 /usr/sbin/*
793 /usr/bin/*
794 /usr/lib/lustre
795 /usr/share/lustre
796 /etc/init.d/lustre
797 /etc/init.d/lustrefs
798 /usr/include/lustre/*
799 /usr/include/portals/*
800 /usr/include/linux/*
801 /usr/lib/lib*.a
802 /usr/share/man/man?/*
803
804 #%files -n lustre-doc
805 #%defattr(-, root, root)
806 #/usr/share/doc/lustre/COPYING
807 #/usr/share/doc/lustre/lustre.pdf
808 #/usr/share/doc/lustre/COPYING
809
810 /usr/share/lustre/examples
811 %files -n lustre-ldap
812 %defattr(-, root, root)
813 /etc/openldap/slapd-lustre.conf
814 /etc/openldap/schema/lustre.schema
815 /usr/share/lustre/lustre2ldif.xsl
816 /usr/share/lustre/top.ldif
817
818
819 %endif # %{buildbase}