2 %bcond_without source # don't build kernel-source package
3 %bcond_without doc # don't build kernel-doc package
4 %bcond_with verbose # verbose build (V=1)
10 %define alt_kernel 5.10
12 # kernel release (used in filesystem and eventually in uname -r)
13 # modules will be looked from /lib/modules/%{kernel_release}
14 # localversion is just that without version for "> localversion"
15 %define localversion %{rel}
16 %define kernel_release %{version}%{?alt_kernel:-%{alt_kernel}}-%{localversion}
18 Summary: The Linux kernel (the core of the Linux operating system)
19 Summary(de.UTF-8): Der Linux-Kernel (Kern des Linux-Betriebssystems)
20 Summary(et.UTF-8): Linuxi kernel (ehk operatsioonisüsteemi tuum)
21 Summary(fr.UTF-8): Le Kernel-Linux (La partie centrale du systeme)
22 Summary(pl.UTF-8): Jądro Linuksa
23 Name: kernel%{_alt_kernel}
24 Version: %{basever}.%{postver}
29 Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%{basever}.tar.xz
30 # Source0-md5: 753adc474bf799d569dec4f165ed92c3
31 %if "%{postver}" != "0"
32 Source1: http://www.kernel.org/pub/linux/kernel/v5.x/patch-%{version}.xz
33 # Source1-md5: c4e619db077bd092f082d89857deb221
36 Source2: kernel-module-build.pl
39 Source10: kernel-x86.config
40 Source11: kernel-x86_64.config
42 URL: http://www.kernel.org/
43 BuildRequires: binutils >= 3:2.18
45 BuildRequires: /sbin/depmod
46 BuildRequires: elfutils-devel
48 BuildRequires: gcc >= 5:3.2
49 BuildRequires: gcc-plugin-devel
50 BuildRequires: xz >= 1:4.999.7
52 BuildRequires: hostname
54 BuildRequires: openssl-devel
55 BuildRequires: perl-base
56 BuildRequires: rpm >= 4.5-74
57 BuildRequires: rpmbuild(macros) >= 1.652
58 Requires(post): coreutils
59 Requires(post): dracut
60 Requires(post): kmod >= 12-2
61 Requires: /sbin/depmod
64 Requires: kmod >= 12-2
66 Requires: cpuinfo(pae)
69 Suggests: linux-firmware
70 Provides: %{name}(netfilter) = 20070806
71 Provides: %{name}(vermagic) = %{kernel_release}
72 Obsoletes: kernel%{_alt_kernel}-vanilla
73 Obsoletes: kernel-firmware
74 Obsoletes: kernel-modules
75 Conflicts: e2fsprogs < 1.29
76 Conflicts: isdn4k-utils < 3.1pre1
77 Conflicts: jfsutils < 1.1.3
78 Conflicts: linux-firmware < 20120720
79 Conflicts: lvm2 < 2.02.40
80 Conflicts: module-init-tools < 3.16
81 Conflicts: nfs-utils < 1.0.5
82 Conflicts: oprofile < 0.9
83 Conflicts: ppp < 1:2.4.0
84 Conflicts: procps < 3.2.0
85 Conflicts: quota-tools < 3.09
86 Conflicts: reiserfsprogs < 3.6.3
87 Conflicts: rpm < 4.4.2-0.2
88 Conflicts: udev < 1:081
89 Conflicts: util-linux < 2.10o
90 Conflicts: xfsprogs < 2.6.0
91 ExclusiveArch: i686 x86_64
93 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
96 %define target_arch_dir x86
98 %define target_arch_dir %{_target_base_arch}
101 %define defconfig arch/%{target_arch_dir}/defconfig
103 # No ELF objects there to strip (skips processing 27k files)
104 %define _noautostrip \\(.*%{_kernelsrcdir}/.*\\|.*/vmlinux.*\\)
105 %define _noautochrpath .*%{_kernelsrcdir}/.*
106 %define _enable_debug_packages 0
108 %define initrd_dir /boot
110 %define topdir %{_builddir}/%{name}-%{version}
111 %define srcdir %{topdir}/linux-%{basever}
112 %define objdir %{topdir}/%{targetobj}
113 %define targetobj %{_target_base_arch}-gcc-%(%{kgcc} -dumpversion)
115 %define _kernelsrcdir /usr/src/linux%{_alt_kernel}-%{version}
117 %if "%{_target_base_arch}" != "%{_host_base_arch}"
118 %define CrossOpts ARCH=%{_target_base_arch} CROSS_COMPILE=%{_target_cpu}-tld-linux-
119 %define DepMod /bin/true
121 %if "%{_host_base_arch}" == "x86_64" && "%{_target_base_arch}" == "i386"
122 %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
123 %define DepMod /sbin/depmod
127 %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
128 %define DepMod /sbin/depmod
130 %define MakeOpts %{CrossOpts} HOSTCC="%{__cc}"
133 This package contains the Linux kernel that is used to boot and run
134 your system. It contains few device drivers for specific hardware.
135 Most hardware is instead supported by modules loaded after booting.
137 %description -l de.UTF-8
138 Das Kernel-Paket enthält den Linux-Kernel (vmlinuz), den Kern des
139 Linux-Betriebssystems. Der Kernel ist für grundliegende
140 Systemfunktionen verantwortlich: Speicherreservierung,
141 Prozeß-Management, Geräte Ein- und Ausgaben, usw.
143 %description -l fr.UTF-8
144 Le package kernel contient le kernel linux (vmlinuz), la partie
145 centrale d'un système d'exploitation Linux. Le noyau traite les
146 fonctions basiques d'un système d'exploitation: allocation mémoire,
147 allocation de process, entrée/sortie de peripheriques, etc.
149 %description -l pl.UTF-8
150 Pakiet zawiera jądro Linuksa niezbędne do prawidłowego działania
151 Twojego komputera. Zawiera w sobie sterowniki do sprzętu znajdującego
152 się w komputerze, takiego jak sterowniki dysków itp.
155 Summary: vmlinux - uncompressed kernel image
156 Summary(de.UTF-8): vmlinux - dekompressiertes Kernel Bild
157 Summary(pl.UTF-8): vmlinux - rozpakowany obraz jądra
159 Obsoletes: kernel-smp-vmlinux
160 Obsoletes: kernel%{_alt_kernel}-vanilla-vmlinux
163 vmlinux - uncompressed kernel image.
165 %description vmlinux -l de.UTF-8
166 vmlinux - dekompressiertes Kernel Bild.
168 %description vmlinux -l pl.UTF-8
169 vmlinux - rozpakowany obraz jądra.
172 Summary: DRM kernel modules
173 Summary(de.UTF-8): DRM Kernel Treiber
174 Summary(pl.UTF-8): Sterowniki DRM
176 Requires(postun): %{name} = %{epoch}:%{version}-%{release}
177 Requires: %{name} = %{epoch}:%{version}-%{release}
178 Obsoletes: kernel-smp-drm
179 Obsoletes: kernel%{_alt_kernel}-vanilla-drm
185 %description drm -l de.UTF-8
188 %description drm -l pl.UTF-8
192 Summary: PCMCIA modules
193 Summary(de.UTF-8): PCMCIA Module
194 Summary(pl.UTF-8): Moduły PCMCIA
196 Requires(postun): %{name} = %{epoch}:%{version}-%{release}
197 Requires: %{name} = %{epoch}:%{version}-%{release}
198 Obsoletes: kernel-smp-pcmcia
199 Obsoletes: kernel%{_alt_kernel}-vanilla-pcmcia
200 Conflicts: pcmcia-cs < 3.1.21
201 Conflicts: pcmciautils < 004
207 %description pcmcia -l de.UTF-8
210 %description pcmcia -l pl.UTF-8
214 Summary: ALSA kernel modules
215 Summary(de.UTF-8): ALSA Kernel Module
216 Summary(pl.UTF-8): Sterowniki dźwięku ALSA
218 Requires(postun): %{name} = %{epoch}:%{version}-%{release}
219 Requires: %{name} = %{epoch}:%{version}-%{release}
220 Obsoletes: kernel-smp-sound-alsa
221 Obsoletes: kernel%{_alt_kernel}-vanilla-sound-alsa
224 %description sound-alsa
225 ALSA (Advanced Linux Sound Architecture) sound drivers.
227 %description sound-alsa -l de.UTF-8
228 ALSA (Advanced Linux Sound Architecture) Sound-Treiber.
230 %description sound-alsa -l pl.UTF-8
231 Sterowniki dźwięku ALSA (Advanced Linux Sound Architecture).
234 Summary: Header files for the Linux kernel
235 Summary(de.UTF-8): Header Dateien für den Linux-Kernel
236 Summary(pl.UTF-8): Pliki nagłówkowe jądra Linuksa
237 Group: Development/Building
238 Provides: %{name}-headers(netfilter) = 20070806
239 Obsoletes: kernel%{_alt_kernel}-vanilla-headers
243 These are the C header files for the Linux kernel, which define
244 structures and constants that are needed when rebuilding the kernel or
245 building kernel modules.
247 %description headers -l de.UTF-8
248 Dies sind die C Header Dateien für den Linux-Kernel, die definierte
249 Strukturen und Konstante beinhalten, die beim rekompilieren des
250 Kernels oder bei Kernel Modul kompilationen gebraucht werden.
252 %description headers -l pl.UTF-8
253 Pakiet zawiera pliki nagłówkowe jądra, niezbędne do rekompilacji jądra
254 oraz budowania modułów jądra.
256 %package module-build
257 Summary: Development files for building kernel modules
258 Summary(de.UTF-8): Development Dateien die beim Kernel Modul kompilationen gebraucht werden
259 Summary(pl.UTF-8): Pliki służące do budowania modułów jądra
260 Group: Development/Building
261 Requires: %{name}-headers = %{epoch}:%{version}-%{release}
262 Obsoletes: kernel%{_alt_kernel}-vanilla-module-build
263 Conflicts: rpmbuild(macros) < 1.652
266 %description module-build
267 Development files from kernel source tree needed to build Linux kernel
268 modules from external packages.
270 %description module-build -l de.UTF-8
271 Development Dateien des Linux-Kernels die beim kompilieren externer
272 Kernel Module gebraucht werden.
274 %description module-build -l pl.UTF-8
275 Pliki ze drzewa źródeł jądra potrzebne do budowania modułów jądra
276 Linuksa z zewnętrznych pakietów.
279 Summary: Kernel source tree
280 Summary(de.UTF-8): Der Kernel Quelltext
281 Summary(pl.UTF-8): Kod źródłowy jądra Linuksa
282 Group: Development/Building
283 Requires: %{name}-module-build = %{epoch}:%{version}-%{release}
284 Obsoletes: kernel%{_alt_kernel}-vanilla-source
288 This is the source code for the Linux kernel. You can build a custom
289 kernel that is better tuned to your particular hardware.
291 %description source -l de.UTF-8
292 Das Kernel-Source-Paket enthält den source code (C/Assembler-Code) des
293 Linux-Kernels. Die Source-Dateien werden gebraucht, um viele
294 C-Programme zu kompilieren, da sie auf Konstanten zurückgreifen, die
295 im Kernel-Source definiert sind. Die Source-Dateien können auch
296 benutzt werden, um einen Kernel zu kompilieren, der besser auf Ihre
297 Hardware ausgerichtet ist.
299 %description source -l fr.UTF-8
300 Le package pour le kernel-source contient le code source pour le noyau
301 linux. Ces sources sont nécessaires pour compiler la plupart des
302 programmes C, car il dépend de constantes définies dans le code
303 source. Les sources peuvent être aussi utilisée pour compiler un noyau
304 personnalisé pour avoir de meilleures performances sur des matériels
307 %description source -l pl.UTF-8
308 Pakiet zawiera kod źródłowy jądra systemu.
311 Summary: Kernel documentation
312 Summary(de.UTF-8): Kernel Dokumentation
313 Summary(pl.UTF-8): Dokumentacja do jądra Linuksa
315 Obsoletes: kernel%{_alt_kernel}-vanilla-doc
319 This is the documentation for the Linux kernel, as found in
320 /usr/src/linux/Documentation directory.
322 %description doc -l de.UTF-8
323 Dies ist die Kernel Dokumentation wie sie im 'Documentation'
324 Verzeichniss vorgefunden werden kann.
326 %description doc -l pl.UTF-8
327 Pakiet zawiera dokumentację do jądra Linuksa pochodzącą z katalogu
328 /usr/src/linux/Documentation.
332 ln -s %{SOURCE2} kernel-module-build.pl
333 ln -s %{SOURCE3} Makefile
336 %if "%{postver}" != "0"
337 %{__xz} -dc %{SOURCE1} | patch -p1 -s
340 # Fix EXTRAVERSION in main Makefile
341 sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{?alt_kernel:-%{alt_kernel}}#g' Makefile
343 # cleanup backups after patching
344 find '(' -name '*~' -o -name '*.orig' -o -name '.gitignore' ')' -print0 | xargs -0 -r -l512 rm -f
346 find -name '*.py' -print0 | \
347 xargs -0 %{__sed} -i -e '1s,/usr/bin/python$,%{__python},' \
348 -e '1s,/usr/bin/env python$,%{__python},' \
349 -e '1s,/usr/bin/env python3$,%{__python3},'
351 %{__sed} -i -e '1s,/usr/bin/python$,%{__python},' \
352 -e '1s,/usr/bin/env python$,%{__python},' \
353 -e '1s,/usr/bin/env python3$,%{__python3},' \
354 drivers/staging/greybus/tools/lbtest \
355 scripts/bloat-o-meter \
357 scripts/jobserver-exec \
359 tools/hv/vmbus_testing \
360 tools/kvm/kvm_stat/kvm_stat \
361 tools/testing/selftests/exec/binfmt_script
363 find -name '*.pl' -print0 | \
364 xargs -0 %{__sed} -i -e '1s,/usr/bin/env perl,%{__perl},' \
366 %{__sed} -i -e '1s,/usr/bin/env perl,%{__perl},' \
367 scripts/dtc/dt_to_config \
370 scripts/documentation-file-ref-check \
371 scripts/get_dvb_firmware \
373 scripts/sphinx-pre-install \
376 %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+bash(\s|$),#!/bin/bash\\1,' \
379 %{__sed} -i -e '1s,/usr/bin/awk,/bin/awk,' \
380 scripts/ld-version.sh
384 cat > %{targetobj}.mk <<'EOF'
385 # generated by %{name}.spec
386 KERNELSRC := %{srcdir}
387 KERNELOUTPUT := %{objdir}
389 SRCARCH := %{target_arch_dir}
390 ARCH := %{_target_base_arch}
391 Q := %{!?with_verbose:@}
392 MAKE_OPTS := %{MakeOpts}
393 DEFCONFIG := %{defconfig}
397 install -d arch/%{target_arch_dir}
399 cat %{SOURCE10} > %{defconfig}
402 cat %{SOURCE11} > %{defconfig}
404 sed -i "s:CONFIG_LOCALVERSION=\"\":CONFIG_LOCALVERSION=\"-%{localversion}\":" %{defconfig}
406 ln -sf %{defconfig} .config
410 TARGETOBJ=%{targetobj} \
411 %{?with_verbose:V=1} \
416 TARGETOBJ=%{targetobj} \
417 %{?with_verbose:V=1} \
421 rm -rf $RPM_BUILD_ROOT
422 %{__make} %{MakeOpts} -j1 %{!?with_verbose:-s} modules_install \
424 %{?with_verbose:V=1} \
426 mod_compress_cmd=true \
427 INSTALL_MOD_PATH=$RPM_BUILD_ROOT \
428 KERNELRELEASE=%{kernel_release}
430 install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/misc
432 # create directories which may be missing, to simplyfy %files
433 install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/kernel/{arch,sound,mm}
435 # rpm obeys filelinkto checks for ghosted symlinks, convert to files
436 rm -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
437 touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
439 # no point embed content for %ghost files. empty them
447 test -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.$a
448 > $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.$a
452 install -d $RPM_BUILD_ROOT/boot
453 cp -a %{objdir}/System.map $RPM_BUILD_ROOT/boot/System.map-%{kernel_release}
454 cp -aL %{objdir}/.config $RPM_BUILD_ROOT/boot/config-%{kernel_release}
455 cp -a %{objdir}/arch/%{target_arch_dir}/boot/bzImage $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
456 install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release}
459 touch $RPM_BUILD_ROOT%{initrd_dir}/initramfs-%{kernel_release}.img
461 %if "%{_target_base_arch}" != "%{_host_base_arch}"
462 touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.dep
466 install -d $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/%{kernel_release}
469 install -d $RPM_BUILD_ROOT%{_kernelsrcdir}
471 # test if we can hardlink -- %{_builddir} and $RPM_BUILD_ROOT on same partition
472 if cp -al %{srcdir}/COPYING $RPM_BUILD_ROOT/COPYING 2>/dev/null; then
474 rm -f $RPM_BUILD_ROOT/COPYING
477 cp -a$l %{srcdir}/* $RPM_BUILD_ROOT%{_kernelsrcdir}
478 cp -a %{objdir}/Module.symvers $RPM_BUILD_ROOT%{_kernelsrcdir}
479 cp -aL %{objdir}/.config $RPM_BUILD_ROOT%{_kernelsrcdir}
480 cp -a %{objdir}/include $RPM_BUILD_ROOT%{_kernelsrcdir}
481 # copy arch/x86/include/generated
482 for dir in $(cd %{objdir} && find arch -name generated -type d); do
483 cp -a %{objdir}/$dir $RPM_BUILD_ROOT%{_kernelsrcdir}/$dir
484 find $RPM_BUILD_ROOT%{_kernelsrcdir}/$dir -name '.*.cmd' -exec rm "{}" ";"
487 # version.h location changed in 3.7, but a lot of external modules don't know about it
488 # add a compatibility symlink
489 ln -s ../generated/uapi/linux/version.h $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/version.h
491 # disable this here, causes a lot of build-time problems and our rpm-build disables it anyway
492 %{__sed} -i -e 's|\(CONSTIFY_PLUGIN.*:=.*\)|# \1|' $RPM_BUILD_ROOT%{_kernelsrcdir}/Makefile
494 # collect module-build files and directories
495 # Usage: kernel-module-build.pl $rpmdir $fileoutdir
497 cd $RPM_BUILD_ROOT%{_kernelsrcdir}
498 %{__perl} %{topdir}/kernel-module-build.pl %{_kernelsrcdir} $fileoutdir
501 for f in `find %{objdir}/scripts -type f -print | grep -v "/\.\|\.o$"` ; do
504 echo "%attr(755,root,root) %{_kernelsrcdir}/$ff" >>files.mb_include_modulebuild_and_dirs
506 echo "%{_kernelsrcdir}/$ff" >>files.mb_include_modulebuild_and_dirs
508 echo "%exclude %{_kernelsrcdir}/$ff" >>files.source_exclude_modulebuild_and_dirs
509 cp -a "$f" "$RPM_BUILD_ROOT%{_kernelsrcdir}/$ff"
513 # move to %{_docdir} so we wouldn't depend on any kernel package for dirs
514 install -d $RPM_BUILD_ROOT%{_docdir}
515 mv $RPM_BUILD_ROOT{%{_kernelsrcdir}/Documentation,%{_docdir}/%{name}-%{version}}
517 %{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/dontdiff
518 %{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/Makefile
519 #%{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/*/Makefile
520 %{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/*/*/Makefile
522 %{__rm} -r $RPM_BUILD_ROOT%{_kernelsrcdir}/Documentation
526 rm -rf $RPM_BUILD_ROOT
529 if [ -x /sbin/new-kernel-pkg ]; then
530 /sbin/new-kernel-pkg --remove %{kernel_release}
534 %depmod %{kernel_release}
538 if [ -x /sbin/dracut ]; then
539 /sbin/dracut --force --quiet /boot/initramfs-%{kernel_release}.img %{kernel_release}
542 if [ -x /sbin/update-grub -a -f /etc/sysconfig/grub ]; then
543 if [ "$(. /etc/sysconfig/grub; echo ${UPDATE_GRUB:-yes})" = "yes" ]; then
544 /sbin/update-grub >/dev/null
549 %depmod %{kernel_release}
552 %depmod %{kernel_release}
555 %depmod %{kernel_release}
558 %depmod %{kernel_release}
561 %depmod %{kernel_release}
564 %depmod %{kernel_release}
567 ln -snf %{basename:%{_kernelsrcdir}} %{_prefix}/src/linux%{_alt_kernel}
570 if [ "$1" = "0" ]; then
571 if [ -L %{_prefix}/src/linux%{_alt_kernel} ]; then
572 if [ "$(readlink %{_prefix}/src/linux%{_alt_kernel})" = "linux%{_alt_kernel}-%{version}" ]; then
573 rm -f %{_prefix}/src/linux%{_alt_kernel}
578 %triggerin module-build -- %{name} = %{epoch}:%{version}-%{release}
579 ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/build
580 ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/source
582 %triggerun module-build -- %{name} = %{epoch}:%{version}-%{release}
583 if [ "$1" = 0 ]; then
584 rm -f /lib/modules/%{kernel_release}/{build,source}
588 %defattr(644,root,root,755)
589 /boot/vmlinuz-%{kernel_release}
590 /boot/System.map-%{kernel_release}
591 /boot/config-%{kernel_release}
592 %ghost %{initrd_dir}/initramfs-%{kernel_release}.img
594 %dir /lib/modules/%{kernel_release}
595 %dir /lib/modules/%{kernel_release}/kernel
596 /lib/modules/%{kernel_release}/kernel/arch
597 /lib/modules/%{kernel_release}/kernel/block
598 /lib/modules/%{kernel_release}/kernel/crypto
599 /lib/modules/%{kernel_release}/kernel/drivers
600 %exclude /lib/modules/%{kernel_release}/kernel/drivers/gpu
601 /lib/modules/%{kernel_release}/kernel/fs
602 /lib/modules/%{kernel_release}/kernel/kernel
603 /lib/modules/%{kernel_release}/kernel/lib
604 /lib/modules/%{kernel_release}/kernel/net
605 /lib/modules/%{kernel_release}/kernel/mm
606 %dir /lib/modules/%{kernel_release}/kernel/sound
607 /lib/modules/%{kernel_release}/kernel/sound/ac97_bus.ko*
608 /lib/modules/%{kernel_release}/kernel/sound/sound*.ko*
609 %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/pci/cx88/cx88-alsa.ko*
610 %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/usb/em28xx/em28xx-alsa.ko*
611 %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/pci/saa7134/saa7134-alsa.ko*
612 %dir /lib/modules/%{kernel_release}/misc
613 %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/[!p]*
614 %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/pd6729.ko*
615 %exclude /lib/modules/%{kernel_release}/kernel/drivers/*/pcmcia
616 %exclude /lib/modules/%{kernel_release}/kernel/drivers/ata/pata_pcmcia.ko*
617 %exclude /lib/modules/%{kernel_release}/kernel/drivers/bluetooth/*_cs.ko*
618 %exclude /lib/modules/%{kernel_release}/kernel/drivers/ide/ide-cs.ko*
619 %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/*_cs.ko*
620 %exclude /lib/modules/%{kernel_release}/kernel/drivers/parport/parport_cs.ko*
621 %exclude /lib/modules/%{kernel_release}/kernel/drivers/tty/serial/8250/serial_cs.ko*
622 %exclude /lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko*
623 /lib/modules/%{kernel_release}/kernel/security
624 /lib/modules/%{kernel_release}/kernel/virt
626 %dir %{_sysconfdir}/modprobe.d/%{kernel_release}
629 /lib/modules/%{kernel_release}/modules.order
630 /lib/modules/%{kernel_release}/modules.builtin*
632 # rest modules.* are ghost (regenerated by post depmod -a invocation)
633 %ghost /lib/modules/%{kernel_release}/modules.alias
634 %ghost /lib/modules/%{kernel_release}/modules.alias.bin
635 %ghost /lib/modules/%{kernel_release}/modules.dep
636 %ghost /lib/modules/%{kernel_release}/modules.dep.bin
637 %ghost /lib/modules/%{kernel_release}/modules.devname
638 %ghost /lib/modules/%{kernel_release}/modules.softdep
639 %ghost /lib/modules/%{kernel_release}/modules.symbols
640 %ghost /lib/modules/%{kernel_release}/modules.symbols.bin
642 # symlinks pointing to kernelsrcdir
643 %ghost /lib/modules/%{kernel_release}/build
644 %ghost /lib/modules/%{kernel_release}/source
647 %defattr(644,root,root,755)
648 /boot/vmlinux-%{kernel_release}
651 %defattr(644,root,root,755)
652 /lib/modules/%{kernel_release}/kernel/drivers/gpu
655 %defattr(644,root,root,755)
656 /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/*ko*
657 /lib/modules/%{kernel_release}/kernel/drivers/*/pcmcia
658 %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/pcmcia*ko*
659 /lib/modules/%{kernel_release}/kernel/drivers/bluetooth/*_cs.ko*
660 /lib/modules/%{kernel_release}/kernel/drivers/ata/pata_pcmcia.ko*
661 /lib/modules/%{kernel_release}/kernel/drivers/ide/ide-cs.ko*
662 /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/*_cs.ko*
663 /lib/modules/%{kernel_release}/kernel/drivers/parport/parport_cs.ko*
664 /lib/modules/%{kernel_release}/kernel/drivers/tty/serial/8250/serial_cs.ko*
665 /lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko*
668 %defattr(644,root,root,755)
669 /lib/modules/%{kernel_release}/kernel/sound
670 %exclude %dir /lib/modules/%{kernel_release}/kernel/sound
671 %exclude /lib/modules/%{kernel_release}/kernel/sound/ac97_bus.ko*
672 %exclude /lib/modules/%{kernel_release}/kernel/sound/sound*.ko*
673 /lib/modules/%{kernel_release}/kernel/drivers/media/pci/cx88/cx88-alsa.ko*
674 /lib/modules/%{kernel_release}/kernel/drivers/media/usb/em28xx/em28xx-alsa.ko*
675 /lib/modules/%{kernel_release}/kernel/drivers/media/pci/saa7134/saa7134-alsa.ko*
677 %files headers -f files.headers_exclude_kbuild
678 %defattr(644,root,root,755)
679 %dir %{_kernelsrcdir}
680 %{_kernelsrcdir}/include
681 %dir %{_kernelsrcdir}/arch
682 %dir %{_kernelsrcdir}/arch/[!K]*
683 %{_kernelsrcdir}/arch/*/include
684 %dir %{_kernelsrcdir}/security
685 %dir %{_kernelsrcdir}/security/selinux
686 %{_kernelsrcdir}/security/selinux/include
687 %dir %{_kernelsrcdir}/usr
688 %dir %{_kernelsrcdir}/usr/include
689 %{_kernelsrcdir}/.config
690 %{_kernelsrcdir}/Module.symvers
692 %files module-build -f files.mb_include_modulebuild_and_dirs
693 %defattr(644,root,root,755)
694 %exclude %dir %{_kernelsrcdir}/arch/um
695 %{_kernelsrcdir}/arch/*/kernel/asm-offsets*
696 %{_kernelsrcdir}/arch/*/kernel/sigframe*.h
697 %{_kernelsrcdir}/drivers/media/pci/bt8xx/bttv.h
698 %{_kernelsrcdir}/kernel/bounds.c
699 %{_kernelsrcdir}/scripts/basic/*.c
700 %attr(755,root,root) %{_kernelsrcdir}/scripts/kconfig/*.sh
701 %{_kernelsrcdir}/scripts/kconfig/*.pl
702 %{_kernelsrcdir}/scripts/kconfig/*.glade
703 %{_kernelsrcdir}/scripts/kconfig/*.cc
704 %{_kernelsrcdir}/scripts/kconfig/*.y
705 %{_kernelsrcdir}/scripts/kconfig/*.l
706 %{_kernelsrcdir}/scripts/kconfig/[c-k]*.c
707 %{_kernelsrcdir}/scripts/kconfig/[c-k]*.h
708 %{_kernelsrcdir}/scripts/kconfig/l*.h
709 %{_kernelsrcdir}/scripts/kconfig/[m-o]*.c
710 %{_kernelsrcdir}/scripts/kconfig/[m-o]*.h
711 %{_kernelsrcdir}/scripts/kconfig/preprocess.c
712 %{_kernelsrcdir}/scripts/kconfig/[q-u]*.c
713 %{_kernelsrcdir}/scripts/kconfig/[q-u]*.h
714 %{_kernelsrcdir}/scripts/kconfig/lxdialog
715 %{_kernelsrcdir}/scripts/mod/*.c
716 %{_kernelsrcdir}/scripts/mod/modpost.h
717 %attr(755,root,root) %{_kernelsrcdir}/scripts/mkcompile_h
718 %{_kernelsrcdir}/scripts/mkmakefile
719 %attr(755,root,root) %{_kernelsrcdir}/scripts/setlocalversion
720 %{_kernelsrcdir}/scripts/subarch.include
721 %{_kernelsrcdir}/scripts/*.c
722 %{_kernelsrcdir}/scripts/*.h
723 %attr(755,root,root) %{_kernelsrcdir}/scripts/*.sh
724 %{_kernelsrcdir}/scripts/selinux/genheaders/*.c
725 %{_kernelsrcdir}/scripts/selinux/mdp/*.c
726 %exclude %dir %{_kernelsrcdir}/security
727 %exclude %dir %{_kernelsrcdir}/security/selinux
731 %defattr(644,root,root,755)
732 %dir %{_docdir}/%{name}-%{version}
734 %{_docdir}/%{name}-%{version}/[!jkz]*
735 %{_docdir}/%{name}-%{version}/kbuild
736 %{_docdir}/%{name}-%{version}/kernel-hacking
740 %files source -f files.source_exclude_modulebuild_and_dirs
741 %defattr(644,root,root,755)
742 %{_kernelsrcdir}/arch/*/[!Mik]*
743 %{_kernelsrcdir}/arch/*/kernel/[!M]*
744 %{_kernelsrcdir}/arch/ia64/install.sh
745 %{_kernelsrcdir}/arch/m68k/ifpsp060/[!M]*
746 %{_kernelsrcdir}/arch/m68k/ifpsp060/MISC
747 %{_kernelsrcdir}/arch/m68k/install.sh
748 %{_kernelsrcdir}/arch/parisc/install.sh
749 %{_kernelsrcdir}/arch/x86/ia32/[!M]*
750 %{_kernelsrcdir}/arch/arm64/kvm
751 %{_kernelsrcdir}/arch/mips/kvm
752 %{_kernelsrcdir}/arch/powerpc/kexec
753 %{_kernelsrcdir}/arch/powerpc/kvm
754 %{_kernelsrcdir}/arch/s390/kvm
755 %{_kernelsrcdir}/arch/x86/kvm
756 %exclude %{_kernelsrcdir}/arch/*/kernel/asm-offsets*
757 %exclude %{_kernelsrcdir}/arch/*/kernel/sigframe*.h
758 %exclude %{_kernelsrcdir}/drivers/media/pci/bt8xx/bttv.h
759 %{_kernelsrcdir}/block
760 %{_kernelsrcdir}/certs
761 %{_kernelsrcdir}/crypto
762 %{_kernelsrcdir}/drivers
764 %{_kernelsrcdir}/init
766 %{_kernelsrcdir}/kernel
767 %exclude %{_kernelsrcdir}/kernel/bounds.c
771 %{_kernelsrcdir}/virt
772 %{_kernelsrcdir}/samples
773 %{_kernelsrcdir}/scripts/*
774 %exclude %{_kernelsrcdir}/scripts/Kbuild.include
775 %exclude %{_kernelsrcdir}/scripts/Makefile*
776 %exclude %{_kernelsrcdir}/scripts/basic
777 %exclude %{_kernelsrcdir}/scripts/kconfig
778 %exclude %{_kernelsrcdir}/scripts/mkcompile_h
779 %exclude %{_kernelsrcdir}/scripts/mkmakefile
780 %exclude %{_kernelsrcdir}/scripts/mod
781 %exclude %{_kernelsrcdir}/scripts/setlocalversion
782 %exclude %{_kernelsrcdir}/scripts/*.c
783 %exclude %{_kernelsrcdir}/scripts/*.h
784 %exclude %{_kernelsrcdir}/scripts/*.sh
785 %exclude %dir %{_kernelsrcdir}/scripts/selinux
786 %exclude %{_kernelsrcdir}/scripts/selinux/Makefile
787 %exclude %dir %{_kernelsrcdir}/scripts/selinux/genheaders
788 %exclude %{_kernelsrcdir}/scripts/selinux/genheaders/Makefile
789 %exclude %{_kernelsrcdir}/scripts/selinux/genheaders/*.c
790 %exclude %dir %{_kernelsrcdir}/scripts/selinux/mdp
791 %exclude %{_kernelsrcdir}/scripts/selinux/mdp/Makefile
792 %exclude %{_kernelsrcdir}/scripts/selinux/mdp/*.c
793 %{_kernelsrcdir}/sound
794 %{_kernelsrcdir}/security
795 %exclude %{_kernelsrcdir}/security/selinux/include
796 %{_kernelsrcdir}/tools/*
798 %{_kernelsrcdir}/COPYING
799 %{_kernelsrcdir}/CREDITS
800 %{_kernelsrcdir}/LICENSES
801 %{_kernelsrcdir}/MAINTAINERS
802 %{_kernelsrcdir}/README