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