dbaa6029193c838c1e97af25a6fd407904990f0e
[linux-2.6.git] / scripts / kernel-2.6-planetlab.spec
1 Summary: The Linux kernel (the core of the Linux operating system)
2
3 # What parts do we want to build?  We must build at least one kernel.
4 # These are the kernels that are built IF the architecture allows it.
5
6 %define buildup 0
7 %define buildsmp 0
8 %define builduml 0
9 %define buildxen 1
10 %define builddoc 0
11
12 # Versions of various parts
13
14 #
15 # Polite request for people who spin their own kernel rpms:
16 # please modify the "release" field in a way that identifies
17 # that the kernel isn't the stock distribution kernel, for example by
18 # adding some text to the end of the version number.
19 #
20 %define sublevel 17
21 %define kversion 2.6.%{sublevel}
22 %define rpmversion 2.6.%{sublevel}
23 %define release 1.2187_FC5.0%{?pldistro:.%{pldistro}}%{?date:.%{date}}
24 %define signmodules 0
25 %define make_target bzImage
26 %define kernel_arch i386
27
28 %define KVERREL %{PACKAGE_VERSION}-%{PACKAGE_RELEASE}
29
30 # Override generic defaults with per-arch defaults
31
32 %define image_install_path boot
33
34 #
35 # Three sets of minimum package version requirements in the form of Conflicts:
36 # to versions below the minimum
37 #
38
39 #
40 # First the general kernel 2.6 required versions as per
41 # Documentation/Changes
42 #
43 %define kernel_dot_org_conflicts  ppp <= 2.3.15, pcmcia-cs <= 3.1.20, isdn4k-utils <= 3.0, mount < 2.10r-5, nfs-utils < 1.0.3, e2fsprogs < 1.29, util-linux < 2.10, jfsutils < 1.0.14, reiserfsprogs < 3.6.3, xfsprogs < 2.1.0, procps < 2.0.9, oprofile < 0.5.3
44
45
46 # Then a series of requirements that are distribution specific, either 
47 # because we add patches for something, or the older versions have 
48 # problems with the newer kernel or lack certain things that make 
49 # integration in the distro harder than needed.
50 #
51 %define package_conflicts  cipe < 1.4.5, kudzu <= 0.92, initscripts < 7.23, dev < 3.2-7, iptables < 1.2.5-3, bcm5820 < 1.81, nvidia-rh72 <= 1.0 selinux-policy-targeted < 1.23.16-1
52
53 #
54 # Several packages had bugs in them that became obvious when the NPTL
55 # threading code got integrated.
56 #
57 %define nptl_conflicts SysVinit < 2.84-13, pam < 0.75-48, vixie-cron < 3.0.1-73, privoxy < 3.0.0-8, spamassassin < 2.44-4.8.x,  cups < 1.1.17-13
58
59 #
60 # The ld.so.conf.d file we install uses syntax older ldconfig's don't grok.
61 #
62
63 # MEF commented out
64 # %define xen_conflicts glibc < 2.3.5-1
65
66 #
67 # Packages that need to be installed before the kernel is, because the %post
68 # scripts use them.
69 #
70 %define kernel_prereq  fileutils, module-init-tools, initscripts >= 5.83, mkinitrd >= 3.5.5
71
72 Vendor: PlanetLab
73 Packager: PlanetLab Central <support@planet-lab.org>
74 Distribution: PlanetLab 3.0
75 URL: http://cvs.planet-lab.org/cvs/linux-2.6
76
77 Name: kernel
78 Group: System Environment/Kernel
79 License: GPLv2
80 Version: %{rpmversion}
81 Release: %{release}
82 ExclusiveOS: Linux
83 Provides: kernel = %{version}
84 Provides: kernel-drm = 4.3.0
85 Provides: kernel-%{_target_cpu} = %{rpmversion}-%{release}
86 Prereq: %{kernel_prereq}
87 Conflicts: %{kernel_dot_org_conflicts}
88 Conflicts: %{package_conflicts}
89 Conflicts: %{nptl_conflicts}
90 # We can't let RPM do the dependencies automatic because it'll then pick up
91 # a correct but undesirable perl dependency from the module headers which
92 # isn't required for the kernel proper to function
93 AutoReqProv: no
94
95 #
96 # List the packages used during the kernel build
97 #
98 BuildPreReq: module-init-tools, patch >= 2.5.4, bash >= 2.03, sh-utils, tar
99 BuildPreReq: bzip2, findutils, gzip, m4, perl, make >= 3.78, gnupg, diffutils
100 BuildRequires: gcc >= 3.3.3, binutils >= 2.12, redhat-rpm-config
101 BuildConflicts: rhbuildsys(DiskFree) < 500Mb
102 BuildArchitectures: i686
103
104
105 Source0: ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-%{kversion}.tar.bz2
106
107 BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
108
109 %description
110 The kernel package contains the Linux kernel (vmlinuz), the core of any
111 Linux operating system.  The kernel handles the basic functions
112 of the operating system:  memory allocation, process allocation, device
113 input and output, etc.
114
115 %package devel
116 Summary: Development package for building kernel modules to match the kernel.
117 Group: System Environment/Kernel
118 AutoReqProv: no
119 Provides: kernel-devel-%{_target_cpu} = %{rpmversion}-%{release}
120 Prereq: /usr/bin/find
121
122 %description devel
123 This package provides kernel headers and makefiles sufficient to build modules
124 against the kernel package.
125
126
127 %package doc
128 Summary: Various documentation bits found in the kernel source.
129 Group: Documentation
130
131 %description doc
132 This package contains documentation files from the kernel
133 source. Various bits of information about the Linux kernel and the
134 device drivers shipped with it are documented in these files.
135
136 You'll want to install this package if you need a reference to the
137 options that can be passed to Linux kernel modules at load time.
138
139 %package smp
140 Summary: The Linux kernel compiled for SMP machines.
141
142 Group: System Environment/Kernel
143 Provides: kernel = %{version}
144 Provides: kernel-drm = 4.3.0
145 Provides: kernel-%{_target_cpu} = %{rpmversion}-%{release}smp
146 Prereq: %{kernel_prereq}
147 Conflicts: %{kernel_dot_org_conflicts}
148 Conflicts: %{package_conflicts}
149 Conflicts: %{nptl_conflicts}
150 # upto and including kernel 2.4.9 rpms, the 4Gb+ kernel was called kernel-enterprise
151 # now that the smp kernel offers this capability, obsolete the old kernel
152 Obsoletes: kernel-enterprise < 2.4.10
153 # We can't let RPM do the dependencies automatic because it'll then pick up
154 # a correct but undesirable perl dependency from the module headers which
155 # isn't required for the kernel proper to function
156 AutoReqProv: no
157
158 %description smp
159 This package includes a SMP version of the Linux kernel. It is
160 required only on machines with two or more CPUs as well as machines with
161 hyperthreading technology.
162
163 Install the kernel-smp package if your machine uses two or more CPUs.
164
165 %package smp-devel
166 Summary: Development package for building kernel modules to match the SMP kernel.
167 Group: System Environment/Kernel
168 Provides: kernel-smp-devel-%{_target_cpu} = %{rpmversion}-%{release}
169 Provides: kernel-devel-%{_target_cpu} = %{rpmversion}-%{release}smp
170 Provides: kernel-devel = %{rpmversion}-%{release}smp
171 AutoReqProv: no
172 Prereq: /usr/bin/find
173
174 %description smp-devel
175 This package provides kernel headers and makefiles sufficient to build modules
176 against the SMP kernel package.
177
178 %package xenU
179 Summary: The Linux kernel compiled for unprivileged Xen guest VMs
180
181 Group: System Environment/Kernel
182 Provides: kernel = %{version}
183 Provides: kernel-%{_target_cpu} = %{rpmversion}-%{release}xenU
184 Prereq: %{kernel_prereq}
185 Conflicts: %{kernel_dot_org_conflicts}
186 Conflicts: %{package_conflicts}
187 Conflicts: %{nptl_conflicts}
188
189 # MEF commented out 
190 # Conflicts: %{xen_conflicts}
191
192 # We can't let RPM do the dependencies automatic because it'll then pick up
193 # a correct but undesirable perl dependency from the module headers which
194 # isn't required for the kernel proper to function
195 AutoReqProv: no
196
197 %description xenU
198 This package includes a version of the Linux kernel which
199 runs in Xen unprivileged guest VMs.  This should be installed
200 both inside the unprivileged guest (for the modules) and in
201 the guest0 domain.
202
203 %package xenU-devel
204 Summary: Development package for building kernel modules to match the kernel.
205 Group: System Environment/Kernel
206 AutoReqProv: no
207 Provides: kernel-xenU-devel-%{_target_cpu} = %{rpmversion}-%{release}
208 Provides: kernel-devel-%{_target_cpu} = %{rpmversion}-%{release}xenU
209 Provides: kernel-devel = %{rpmversion}-%{release}xenU
210 Prereq: /usr/sbin/hardlink, /usr/bin/find
211
212 %description xenU-devel
213 This package provides kernel headers and makefiles sufficient to build modules
214 against the kernel package.
215
216 %package uml
217 Summary: The Linux kernel compiled for use in user mode (User Mode Linux).
218
219 Group: System Environment/Kernel
220
221 %description uml
222 This package includes a user mode version of the Linux kernel.
223
224 %package uml-devel
225 Summary: Development package for building kernel modules to match the UML kernel.
226 Group: System Environment/Kernel
227 Provides: kernel-uml-devel-%{_target_cpu} = %{rpmversion}-%{release}
228 Provides: kernel-devel-%{_target_cpu} = %{rpmversion}-%{release}smp
229 Provides: kernel-devel = %{rpmversion}-%{release}smp
230 AutoReqProv: no
231 Prereq: /usr/sbin/hardlink, /usr/bin/find
232
233 %description uml-devel
234 This package provides kernel headers and makefiles sufficient to build modules
235 against the User Mode Linux kernel package.
236
237 %package uml-modules
238 Summary: The Linux kernel modules compiled for use in user mode (User Mode Linux).
239
240 Group: System Environment/Kernel
241
242 %description uml-modules
243 This package includes a user mode version of the Linux kernel modules.
244
245 %package vserver
246 Summary: A placeholder RPM that provides kernel and kernel-drm
247
248 Group: System Environment/Kernel
249 Provides: kernel = %{version}
250 Provides: kernel-drm = 4.3.0
251 Provides: kernel-%{_target_cpu} = %{rpmversion}-%{release}
252
253 %description vserver
254 VServers do not require and cannot use kernels, but some RPMs have
255 implicit or explicit dependencies on the "kernel" package
256 (e.g. tcpdump). This package installs no files but provides the
257 necessary dependencies to make rpm and yum happy.
258
259
260 %prep
261 # First we unpack the kernel tarball.
262 # If this isn't the first make prep, we use links to the existing clean tarball
263 # which speeds things up quite a bit.
264 if [ ! -d kernel-%{kversion}/vanilla ]; then
265   # Ok, first time we do a make prep.
266   rm -f pax_global_header
267 %setup -q -n %{name}-%{version} -c
268   mv linux-%{kversion} vanilla
269 else
270   # We already have a vanilla dir.
271   cd kernel-%{kversion}
272 fi
273
274 cd vanilla
275
276 # make sure the kernel has the sublevel we know it has. This looks weird
277 # but for -pre and -rc versions we need it since we only want to use
278 # the higher version when the final kernel is released.
279 perl -p -i -e "s/^SUBLEVEL.*/SUBLEVEL = %{sublevel}/" Makefile
280 perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -prep/" Makefile
281
282 # get rid of unwanted files resulting from patch fuzz
283 find . \( -name "*.orig" -o -name "*~" \) -exec rm -f {} \; >/dev/null
284
285
286 ###
287 ### build
288 ###
289 %build
290
291 BuildKernel() {
292     MakeTarget=$1
293     Arch=$2
294     Flavour=$3
295
296     # create a clean copy in BUILD/ (for backward compatibility with
297     # other RPMs that bootstrap off of the kernel build)
298     cd $RPM_BUILD_DIR
299     rm -rf linux-%{kversion}$Flavour
300     cp -rl kernel-%{kversion}/vanilla linux-%{kversion}$Flavour
301     cd linux-%{kversion}$Flavour
302
303     # Pick the right config file for the kernel we're building
304     if [ -n "$Flavour" ] ; then
305       Config=kernel-%{kversion}-%{_target_cpu}-$Flavour-planetlab.config
306       DevelDir=/usr/src/kernels/%{KVERREL}-$Flavour-%{_target_cpu}
307       DevelLink=/usr/src/kernels/%{KVERREL}$Flavour-%{_target_cpu}
308     else
309       Config=kernel-%{kversion}-%{_target_cpu}-planetlab.config
310       DevelDir=/usr/src/kernels/%{KVERREL}-%{_target_cpu}
311       DevelLink=
312     fi
313
314     KernelVer=%{version}-%{release}$Flavour
315     echo BUILDING A KERNEL FOR $Flavour %{_target_cpu}...
316
317     # make sure EXTRAVERSION says what we want it to say
318     perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}$Flavour/" Makefile
319
320     # and now to start the build process
321
322     make -s mrproper
323     cp configs/$Config .config
324
325     #Arch=`head -1 .config | cut -b 3-`
326     echo USING ARCH=$Arch
327
328     make -s ARCH=$Arch nonint_oldconfig > /dev/null
329     make -s ARCH=$Arch %{?_smp_mflags} $MakeTarget
330     make -s ARCH=$Arch %{?_smp_mflags} modules || exit 1
331
332     # Start installing the results
333
334 %if "%{_enable_debug_packages}" == "1"
335     mkdir -p $RPM_BUILD_ROOT/usr/lib/debug/boot
336 %endif
337     mkdir -p $RPM_BUILD_ROOT/%{image_install_path}
338     install -m 644 .config $RPM_BUILD_ROOT/boot/config-$KernelVer
339     install -m 644 System.map $RPM_BUILD_ROOT/boot/System.map-$KernelVer
340     if [ -f arch/$Arch/boot/bzImage ]; then
341       cp arch/$Arch/boot/bzImage $RPM_BUILD_ROOT/%{image_install_path}/vmlinuz-$KernelVer
342     fi
343     if [ -f arch/$Arch/boot/zImage.stub ]; then
344       cp arch/$Arch/boot/zImage.stub $RPM_BUILD_ROOT/%{image_install_path}/zImage.stub-$KernelVer || :
345     fi
346     if [ "$Flavour" = "uml" ] ; then
347         install -D -m 755 linux $RPM_BUILD_ROOT/%{_bindir}/linux
348     fi
349
350     mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer
351     make -s ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_install KERNELRELEASE=$KernelVer
352
353     # And save the headers/makefiles etc for building modules against
354     #
355     # This all looks scary, but the end result is supposed to be:
356     # * all arch relevant include/ files
357     # * all Makefile/Kconfig files
358     # * all script/ files
359
360     rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/build
361     rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/source
362     mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/build
363     (cd $RPM_BUILD_ROOT/lib/modules/$KernelVer ; ln -s build source)
364     # dirs for additional modules per module-init-tools, kbuild/modules.txt
365     mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/extra
366     mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/updates
367     # first copy everything
368     cp --parents `find  -type f -name "Makefile*" -o -name "Kconfig*"` $RPM_BUILD_ROOT/lib/modules/$KernelVer/build 
369         cp Module.symvers $RPM_BUILD_ROOT/lib/modules/$KernelVer/build
370     if [ "$Flavour" = "uml" ] ; then
371       cp --parents -a `find arch/um -name include` $RPM_BUILD_ROOT/lib/modules/$KernelVer/build
372     fi
373     # then drop all but the needed Makefiles/Kconfig files
374     rm -rf $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/Documentation
375     rm -rf $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts
376     rm -rf $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include
377     cp arch/%{_arch}/kernel/asm-offsets.s $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/arch/%{_arch}/kernel || :
378     cp .config $RPM_BUILD_ROOT/lib/modules/$KernelVer/build
379     cp .kernelrelease $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/
380     cp -a scripts $RPM_BUILD_ROOT/lib/modules/$KernelVer/build
381     if [ -d arch/%{_arch}/scripts ]; then
382       cp -a arch/%{_arch}/scripts $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/arch/%{_arch} || :
383     fi
384     if [ -f arch/%{_arch}/*lds ]; then
385       cp -a arch/%{_arch}/*lds $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/arch/%{_arch}/ || :
386     fi
387     rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/*.o
388     rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/*/*.o
389     mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include
390     cd include
391     cp -a acpi config keys linux math-emu media mtd net pcmcia rdma rxrpc scsi sound video asm asm-generic $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include
392     cp -a `readlink asm` $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include
393     if [ "$Arch" = "x86_64" ]; then
394       cp -a asm-i386 $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include
395     fi
396 %if %{buildxen}
397     if [ "$Flavour" = "xenU" ]; then
398       cp -a xen $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include
399       cp -a asm-i386 $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include
400     fi
401 %endif
402 %if %{builduml}
403     if [ "$Flavour" = "uml" ] ; then
404       cp -a `readlink -f asm/arch` $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include
405     fi
406 %endif
407     # While arch/powerpc/include/asm is still a symlink to the old
408     # include/asm-ppc{64,} directory, include that in kernel-devel too.
409     if [ "$Arch" = "powerpc" -a -r ../arch/powerpc/include/asm ]; then
410       cp -a `readlink ../arch/powerpc/include/asm` $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include
411       mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/arch/$Arch/include
412       pushd $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/arch/$Arch/include
413       ln -sf ../../../include/asm-ppc* asm
414       popd
415     fi
416
417     # Make sure the Makefile and version.h have a matching timestamp so that
418     # external modules can be built
419     touch -r $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/Makefile $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/linux/version.h
420     touch -r $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/.config $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/linux/autoconf.h
421     cd ..
422
423     #
424     # save the vmlinux file for kernel debugging into the kernel-debuginfo rpm
425     #
426 %if "%{_enable_debug_packages}" == "1"
427     mkdir -p $RPM_BUILD_ROOT/usr/lib/debug/lib/modules/$KernelVer
428     cp vmlinux $RPM_BUILD_ROOT/usr/lib/debug/lib/modules/$KernelVer
429 %endif
430 %if %{buildxen}
431     if [ -f vmlinuz ]; then
432       cp vmlinuz $RPM_BUILD_ROOT/%{image_install_path}/vmlinuz-$KernelVer
433     fi
434 %endif
435
436     find $RPM_BUILD_ROOT/lib/modules/$KernelVer -name "*.ko" -type f >modnames
437
438     # mark modules executable so that strip-to-file can strip them
439     cat modnames | xargs chmod u+x
440
441     # remove files that will be auto generated by depmod at rpm -i time
442     rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.*
443
444     # Move the devel headers out of the root file system
445     mkdir -p $RPM_BUILD_ROOT/usr/src/kernels
446     mv $RPM_BUILD_ROOT/lib/modules/$KernelVer/build $RPM_BUILD_ROOT/$DevelDir
447     ln -sf ../../..$DevelDir $RPM_BUILD_ROOT/lib/modules/$KernelVer/build
448     [ -z "$DevelLink" ] || ln -sf `basename $DevelDir` $RPM_BUILD_ROOT/$DevelLink
449 }
450
451 ###
452 # DO it...
453 ###
454
455 # prepare directories
456 rm -rf $RPM_BUILD_ROOT
457 mkdir -p $RPM_BUILD_ROOT/boot
458
459 %if %{buildup}
460 BuildKernel %make_target %kernel_arch
461 %endif
462
463 %if %{buildsmp}
464 BuildKernel %make_target %kernel_arch smp
465 %endif
466
467 %if %{builduml}
468 BuildKernel linux um uml
469 %endif
470
471 %if %{buildxen}
472 BuildKernel vmlinuz %kernel_arch xenU
473 %endif
474
475 ###
476 ### install
477 ###
478
479 %install
480
481 cd vanilla
482
483 %if %{buildxen}
484 mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
485 rm -f $RPM_BUILD_ROOT/etc/ld.so.conf.d/kernelcap-%{KVERREL}.conf
486 cat > $RPM_BUILD_ROOT/etc/ld.so.conf.d/kernelcap-%{KVERREL}.conf <<\EOF
487 # This directive teaches ldconfig to search in nosegneg subdirectories
488 # and cache the DSOs there with extra bit 0 set in their hwcap match
489 # fields.  In Xen guest kernels, the vDSO tells the dynamic linker to
490 # search in nosegneg subdirectories and to match this extra hwcap bit
491 # in the ld.so.cache file.
492 hwcap 0 nosegneg
493 EOF
494 chmod 444 $RPM_BUILD_ROOT/etc/ld.so.conf.d/kernelcap-%{KVERREL}.conf
495 %endif
496
497 %if %{builddoc}
498 mkdir -p $RPM_BUILD_ROOT/usr/share/doc/kernel-doc-%{kversion}/Documentation
499
500 # sometimes non-world-readable files sneak into the kernel source tree
501 chmod -R a+r *
502 # copy the source over
503 tar cf - Documentation | tar xf - -C $RPM_BUILD_ROOT/usr/share/doc/kernel-doc-%{kversion}
504 %endif
505
506 ###
507 ### clean
508 ###
509
510 %clean
511 rm -rf $RPM_BUILD_ROOT
512
513 ###
514 ### scripts
515 ###
516
517 # load the loop module for upgrades...in case the old modules get removed we have
518 # loopback in the kernel so that mkinitrd will work.
519 %pre
520 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
521 exit 0
522
523 %pre smp
524 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
525 exit 0
526
527 %post
528 if [ `uname -i` == "x86_64" ]; then
529   if [ -f /etc/sysconfig/kernel ]; then
530     /bin/sed -i -e 's/^DEFAULTKERNEL=kernel-smp$/DEFAULTKERNEL=kernel/' /etc/sysconfig/kernel
531   fi
532 fi
533
534 # trick mkinitrd in case the current environment does not have device mapper
535 rootdev=$(awk '/^[ \t]*[^#]/ { if ($2 == "/") { print $1; }}' /etc/fstab)
536 if echo $rootdev |grep -q /dev/mapper 2>/dev/null ; then
537     if [ ! -f $rootdev ]; then
538         fake_root_lvm=1
539         mkdir -p $(dirname $rootdev)
540         touch $rootdev
541     fi
542 fi
543
544 [ ! -x /usr/sbin/module_upgrade ] || /usr/sbin/module_upgrade %{rpmversion}-%{release}
545 #/sbin/new-kernel-pkg --package kernel --mkinitrd --depmod --install %{KVERREL}
546 # Older modutils do not support --package option
547 /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}
548
549 # remove fake handle
550 if [ -n "$fake_root_lvm" ]; then
551     rm -f $rootdev
552 fi
553
554 # make some useful links
555 pushd /boot > /dev/null ; {
556         ln -sf config-%{KVERREL} config
557         ln -sf initrd-%{KVERREL}.img initrd-boot
558         ln -sf vmlinuz-%{KVERREL} kernel-boot
559 }
560 popd > /dev/null
561
562 # ask for a reboot
563 mkdir -p /etc/planetlab
564 touch /etc/planetlab/update-reboot
565
566 %post devel
567 [ -f /etc/sysconfig/kernel ] && . /etc/sysconfig/kernel
568 if [ "$HARDLINK" != "no" -a -x /usr/sbin/hardlink ] ; then
569   pushd /usr/src/kernels/%{KVERREL}-%{_target_cpu} > /dev/null
570   /usr/bin/find . -type f | while read f; do hardlink -c /usr/src/kernels/*FC*/$f $f ; done
571   popd > /dev/null
572 fi
573
574 %post smp
575 # trick mkinitrd in case the current environment does not have device mapper
576 rootdev=$(awk '/^[ \t]*[^#]/ { if ($2 == "/") { print $1; }}' /etc/fstab)
577 if echo $rootdev |grep -q /dev/mapper 2>/dev/null ; then
578     if [ ! -f $rootdev ]; then
579         fake_root_lvm=1
580         mkdir -p $(dirname $rootdev)
581         touch $rootdev
582     fi
583 fi
584
585 [ ! -x /usr/sbin/module_upgrade ] || /usr/sbin/module_upgrade %{rpmversion}-%{release}smp
586 #/sbin/new-kernel-pkg --package kernel-smp --mkinitrd --depmod --install %{KVERREL}smp
587 # Older modutils do not support --package option
588 /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}smp
589
590 # remove fake handle
591 if [ -n "$fake_root_lvm" ]; then
592     rm -f $rootdev
593 fi
594
595 # make some useful links
596 pushd /boot > /dev/null ; {
597         ln -sf config-%{KVERREL}smp configsmp
598         ln -sf initrd-%{KVERREL}smp.img initrd-bootsmp
599         ln -sf vmlinuz-%{KVERREL}smp kernel-bootsmp
600 }
601 popd > /dev/null
602
603 # ask for a reboot
604 mkdir -p /etc/planetlab
605 touch /etc/planetlab/update-reboot
606
607 %post smp-devel
608 [ -f /etc/sysconfig/kernel ] && . /etc/sysconfig/kernel
609 if [ "$HARDLINK" != "no" -a -x /usr/sbin/hardlink ] ; then
610   pushd /usr/src/kernels/%{KVERREL}-smp-%{_target_cpu} > /dev/null
611   /usr/bin/find . -type f | while read f; do hardlink -c /usr/src/kernels/*FC*/$f $f ; done
612   popd > /dev/null
613 fi
614
615 %post xenU
616 [ ! -x /usr/sbin/module_upgrade ] || /usr/sbin/module_upgrade
617 [ ! -x /sbin/ldconfig ] || /sbin/ldconfig -X
618
619 %post xenU-devel
620 [ -f /etc/sysconfig/kernel ] && . /etc/sysconfig/kernel
621 if [ "$HARDLINK" != "no" -a -x /usr/sbin/hardlink ] ; then
622   pushd /usr/src/kernels/%{KVERREL}-xenU-%{_target_cpu} > /dev/null
623   /usr/bin/find . -type f | while read f; do hardlink -c /usr/src/kernels/*FC*/$f $f ; done
624   popd > /dev/null
625 fi
626
627 %post uml-modules
628 depmod -ae %{KVERREL}uml
629
630 %preun
631 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
632 /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}
633
634 %preun smp
635 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
636 /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}smp
637
638 %preun xenU
639 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
640 /sbin/new-kernel-pkg --rmmoddep --remove %{KVERREL}xenU
641
642 %preun uml-modules
643 rm -f /lib/modules/%{KVERREL}uml/modules.*
644
645
646 ###
647 ### file lists
648 ###
649
650 %if %{buildup}
651 %files 
652 %defattr(-,root,root)
653 /%{image_install_path}/vmlinuz-%{KVERREL}
654 /boot/System.map-%{KVERREL}
655 /boot/config-%{KVERREL}
656 %dir /lib/modules/%{KVERREL}
657 /lib/modules/%{KVERREL}/kernel
658 /lib/modules/%{KVERREL}/build
659 /lib/modules/%{KVERREL}/source
660 /lib/modules/%{KVERREL}/extra
661 /lib/modules/%{KVERREL}/updates
662
663 %files devel
664 %defattr(-,root,root)
665 %verify(not mtime) /usr/src/kernels/%{KVERREL}-%{_target_cpu}
666 %endif
667
668 %if %{buildsmp}
669 %files smp
670 %defattr(-,root,root)
671 /%{image_install_path}/vmlinuz-%{KVERREL}smp
672 /boot/System.map-%{KVERREL}smp
673 /boot/config-%{KVERREL}smp
674 %dir /lib/modules/%{KVERREL}smp
675 /lib/modules/%{KVERREL}smp/kernel
676 /lib/modules/%{KVERREL}smp/build
677 /lib/modules/%{KVERREL}smp/source
678 /lib/modules/%{KVERREL}smp/extra
679 /lib/modules/%{KVERREL}smp/updates
680
681 %files smp-devel
682 %defattr(-,root,root)
683 %verify(not mtime) /usr/src/kernels/%{KVERREL}-smp-%{_target_cpu}
684 /usr/src/kernels/%{KVERREL}smp-%{_target_cpu}
685 %endif
686
687 %if %{builduml}
688 %files uml
689 %defattr(-,root,root)
690 %{_bindir}/linux
691
692 %files uml-devel
693 %defattr(-,root,root)
694 %verify(not mtime) /usr/src/kernels/%{KVERREL}-uml-%{_target_cpu}
695 /usr/src/kernels/%{KVERREL}uml-%{_target_cpu}
696
697 %files uml-modules
698 %defattr(-,root,root)
699 /boot/System.map-%{KVERREL}uml
700 /boot/config-%{KVERREL}uml
701 %dir /lib/modules/%{KVERREL}uml
702 /lib/modules/%{KVERREL}uml/kernel
703 /lib/modules/%{KVERREL}uml/build
704 /lib/modules/%{KVERREL}uml/source
705 /lib/modules/%{KVERREL}uml/extra
706 /lib/modules/%{KVERREL}uml/updates
707 %endif
708
709 %if %{buildxen}
710 %files xenU
711 %defattr(-,root,root)
712 /%{image_install_path}/vmlinuz-%{KVERREL}xenU
713 /boot/System.map-%{KVERREL}xenU
714 /boot/config-%{KVERREL}xenU
715 %dir /lib/modules/%{KVERREL}xenU
716 /lib/modules/%{KVERREL}xenU/kernel
717 /lib/modules/%{KVERREL}xenU/build
718 /lib/modules/%{KVERREL}xenU/source
719 /lib/modules/%{KVERREL}xenU/extra
720 /lib/modules/%{KVERREL}xenU/updates
721 /etc/ld.so.conf.d/kernelcap-%{KVERREL}.conf
722
723 %files xenU-devel
724 %defattr(-,root,root)
725 %verify(not mtime) /usr/src/kernels/%{KVERREL}-xenU-%{_target_cpu}
726 /usr/src/kernels/%{KVERREL}xenU-%{_target_cpu}
727 %endif
728
729 %files vserver
730 %defattr(-,root,root)
731 # no files
732
733 # only some architecture builds need kernel-doc
734
735 %if %{builddoc}
736 %files doc
737 %defattr(-,root,root)
738 %{_datadir}/doc/kernel-doc-%{kversion}/Documentation/*
739 %dir %{_datadir}/doc/kernel-doc-%{kversion}/Documentation
740 %dir %{_datadir}/doc/kernel-doc-%{kversion}
741 %endif
742
743 %changelog
744 * Tue Jul 11 2006 Dave Jones <davej@redhat.com> [2.6.17-1.2142_FC4]
745 - 2.6.17.4
746 - Disable split pagetable lock.
747
748 * Wed Jul  5 2006 Dave Jones <davej@redhat.com>
749 - Get rid of stack backtrace on panic, which in most
750   cases actually caused a loss of info instead of a gain.
751
752 * Fri Jun 30 2006 Dave Jones <davej@redhat.com> [2.6.17-1.2141_FC4]
753 - 2.6.17.3
754
755 * Fri Jun 30 2006 Dave Jones <davej@redhat.com> [2.6.17-1.2140_FC4]
756 - 2.6.17.2
757 - Fix up the alsa list_add bug.
758
759 * Mon Jun 26 2006 Dave Jones <davej@redhat.com>
760 - Fix up various stupidities incurred by the last big rebase.
761   - Reenable SMP x86-64 builds.
762   - Reenable SMBFS.
763 - Enable PCI fake hotplug driver.
764 - Enable gameport/joystick on i586 builds. (#196581)
765
766 * Sat Jun 24 2006 Dave Jones <davej@redhat.com>
767 - Enable profiling for 586 kernels.
768
769 * Fri Jun 23 2006 Dave Jones <davej@redhat.com> [2.6.17-1.2139_FC4]
770 - Rebuild with slab debug off.
771
772 * Tue Jun 20 2006 Dave Jones <davej@redhat.com> [2.6.17-1.2138_FC4]
773 - 2.6.17.1
774
775 * Mon Jun  5 2006 Dave Jones <davej@redhat.com> [2.6.16-1.2115_FC4]
776 - 2.6.16.20
777
778 * Tue May 30 2006 Dave Jones <davej@redhat.com> [2.6.16-1.2114_FC4]
779 - 2.6.16.19
780
781 * Mon May 29 2006 Dave Jones <davej@redhat.com> [2.6.16-1.2113_FC4]
782 - Improved list_head debugging.
783
784 * Tue May 23 2006 Dave Jones <davej@redhat.com> [2.6.16-1.2112_FC4]
785 - 2.6.16.18
786
787 * Sat May 20 2006 Dave Jones <davej@redhat.com> [2.6.16-1.2111_FC4]
788 - 2.6.16.17
789
790 * Wed May 10 2006 Dave Jones <davej@redhat.com> [2.6.16-1.2110_FC4]
791 - 2.6.16.16
792
793 * Tue May  9 2006 Dave Jones <davej@redhat.com> [2.6.16-1.2109_FC4]
794 - 2.6.16.15
795 - make 16C950 UARTs work (again). (#126403)
796 - Fix exec-shield default, which should fix a few programs that
797   stopped running.
798
799 * Thu May  4 2006 Dave Jones <davej@redhat.com> [2.6.16-1.2108_FC4]
800 - 2.6.16.14
801
802 * Tue May  2 2006 Dave Jones <davej@redhat.com> [2.6.16-1.2107_FC4]
803 - 2.6.16.13
804
805 * Mon May  1 2006 Dave Jones <davej@redhat.com>
806 - 2.6.16.12
807
808 * Tue Apr 25 2006 Dave Jones <davej@redhat.com>
809 - Fix up SCSI errors with mymusix usb mp3 player (#186187)
810
811 * Mon Apr 24 2006 Dave Jones <davej@redhat.com>
812 - 2.6.16.11
813
814 * Wed Apr 19 2006 Dave Jones <davej@redhat.com>
815 - Enable PCI MSI support.
816
817 * Tue Apr 18 2006 Dave Jones <davej@redhat.com> [2.6.16-1.2096_FC4]
818 - 2.6.16.9
819
820 * Tue Apr 18 2006 Dave Jones <davej@redhat.com> [2.6.16-1.2093_FC4]
821 - 2.6.16.7
822
823 * Mon Apr 17 2006 Dave Jones <davej@redhat.com> [2.6.16-1.2092_FC4]
824 - 2.6.16.6
825
826 * Sun Apr 16 2006 Dave Jones <davej@redhat.com>
827 - 2.6.16.5
828
829 * Fri Apr  7 2006 Dave Jones <davej@redhat.com>
830 - 2.6.16.2
831
832 * Tue Apr  4 2006 Dave Jones <davej@redhat.com>
833 - Reenable non-standard serial ports. (#187466)
834 - Reenable snd-es18xx for x86-32 (#187733)
835
836 * Thu Mar 30 2006 Dave Jones <davej@redhat.com>
837 - ship the .kernelrelease file in -devel too.
838 - Disable EDAC debug.
839
840 * Tue Mar 26 2006 Dave Jones <davej@redhat.com> [2.6.16-1.2069_FC4]
841 - 2.6.16.1
842
843 * Mon Mar 25 2006 Dave Jones <davej@redhat.com>
844 - Include patches posted for review for inclusion in 2.6.16.1
845 - Updated new audit msg types.
846 - Reenable HDLC driver (#186257)
847 - Make acpi-cpufreq 'sticky'
848 - Fix broken x86-64 32bit vDSO (#186924)
849
850 * Tue Mar 21 2006 Dave Jones <davej@redhat.com>
851 - Improve spinlock scalability on big machines.
852
853 * Mon Mar 20 2006 Dave Jones <davej@redhat.com>
854 - Sync with FC5's 2.6.16 kernel.
855 - Update Tux & Exec-shield to latest.
856