/[packages]/cauldron/kernel-linus/current/SPECS/kernel-linus.spec
ViewVC logotype

Contents of /cauldron/kernel-linus/current/SPECS/kernel-linus.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1426469 - (show annotations) (download)
Wed Jul 31 20:53:03 2019 UTC (4 years, 8 months ago) by tmb
File size: 25833 byte(s)
update defconfigs
1 # upstream versioning
2 %define kernelversion 5
3 %define patchlevel 2
4 # sublevel is now used for -stable patches
5 %define sublevel 5
6
7 # kernel Makefile extraversion is substituted by
8 # kpatch wich are either 0 (empty), rc (kpatch)
9 %define kpatch 0
10
11 # this is the releaseversion
12 %define mgarelease 1
13
14 # This is only to make life easier for people that creates derivated kernels
15 # a.k.a name it kernel-tmb :)
16 %define kname kernel-linus
17
18 %define rpmtag %{distsuffix}%{mgaver}
19 %if %kpatch
20 %define rpmrel %mkrel 0.%{kpatch}.%{mgarelease}
21 %else
22 %define rpmrel %mkrel %{mgarelease}
23 %endif
24
25 # theese two never change, they are used to fool rpm/urpmi/smart
26 %define fakever 1
27 %define fakerel %mkrel 1
28
29 # When we are using a pre/rc patch, the tarball is a sublevel -1
30 %if %kpatch
31 %if %sublevel
32 %define tar_ver %{kernelversion}.%{patchlevel}
33 %else
34 %define tar_ver %{kernelversion}.%(expr %{patchlevel} - 1)
35 %endif
36 %else
37 %define tar_ver %{kernelversion}.%{patchlevel}
38 %endif
39 %define kversion %{kernelversion}.%{patchlevel}.%{sublevel}
40 %define kverrel %{kversion}-%{rpmrel}
41
42 # used for not making too long names for rpms or search paths
43 %if %kpatch
44 %define buildrpmrel 0.%{kpatch}.%{mgarelease}%{rpmtag}
45 %else
46 %define buildrpmrel %{mgarelease}%{rpmtag}
47 %endif
48
49 %define buildrel %{kversion}-%{buildrpmrel}
50
51 %define klinus_notice NOTE: This kernel has no Mageia patches and no third-party drivers.
52
53 # having different top level names for packges means that you have to remove them by hard :(
54 %define top_dir_name %{kname}-%{_arch}
55
56 %define build_dir ${RPM_BUILD_DIR}/%{top_dir_name}
57 %define src_dir %{build_dir}/linux-%{tar_ver}
58
59 # disable useless debug rpms...
60 %global debug_package %{nil}
61 %global _enable_debug_packages %{nil}
62 %global __debug_package %{nil}
63 %global __debug_install_post %{nil}
64 %global _build_id_links none
65
66 # no bytecompiling wanted as it breaks build on selftests we dont even ship
67 # for older buildsystems
68 %global _python_bytecompile_build 0
69 # for systems with >= rpm-mageia-setup-2.29-1.mga7
70 %global __brp_python_bytecompile %nil
71
72 # build defines
73 %define build_doc 1
74 %define build_source 1
75 %define build_devel 1
76
77 %define build_kernel 1
78
79 %define distro_branch %(perl -pe '/(\\d+)\\.(\\d)\\.?(\\d)?/; $_="$1.$2"' /etc/mageia-release)
80
81 # End of user definitions
82 %{?_without_kernel: %global build_kernel 0}
83 %{?_without_doc: %global build_doc 0}
84 %{?_without_source: %global build_source 0}
85 %{?_without_devel: %global build_devel 0}
86
87 %{?_with_kernel: %global build_kernel 1}
88 %{?_with_doc: %global build_doc 1}
89 %{?_with_source: %global build_source 1}
90 %{?_with_devel: %global build_devel 1}
91
92 %if %(if [ -z "$CC" ] ; then echo 0; else echo 1; fi)
93 %define kmake %make_build CC="$CC"
94 %else
95 %define kmake %make_build
96 %endif
97 # there are places where parallel make doesn't work
98 %define smake make
99
100 # Parallelize xargs invocations on smp machines
101 %define kxargs xargs %([ -z "$RPM_BUILD_NCPUS" ] \\\
102 && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
103 [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-P $RPM_BUILD_NCPUS")
104
105 # Aliases for amd64 builds (better make source links?)
106 %define target_cpu %(echo %{_target_cpu} | sed -e "s/amd64/x86_64/")
107 %define target_arch %(echo %{_arch} | sed -e "s/amd64/x86_64/" -e 's/arm.*/arm/')
108
109 # src.rpm description
110 Summary: The Linux kernel (the core of the Linux operating system)
111 Name: %{kname}
112 Version: %{kversion}
113 Release: %{rpmrel}
114 License: GPLv2
115 Group: System/Kernel and hardware
116 ExclusiveArch: %{ix86} x86_64 %{arm}
117 ExclusiveOS: Linux
118 URL: https://www.kernel.org/
119
120 ####################################################################
121 #
122 # Sources
123 #
124 ### This is for full SRC RPM
125 Source0: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/linux-%{tar_ver}.tar.xz
126 Source1: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/linux-%{tar_ver}.tar.sign
127
128 # This is for disabling mrproper and other targets on -devel rpms
129 Source2: disable-mrproper-in-devel-rpms.patch
130
131 Source4: README.kernel-sources
132
133 # Kernel defconfigs
134 Source20: i386_defconfig
135 Source21: x86_64_defconfig
136 Source22: arm_defconfig
137 Source23: arm64_defconfig
138
139 ####################################################################
140 #
141 # Patches
142
143 #
144 # Patch0 to Patch100 are for core kernel upgrades.
145 #
146
147 # Pre linus patch: https://cdn.kernel.org/pub/linux/kernel/v(kernelversion).(patchlevel)/testing
148
149 %if %sublevel
150 Patch1: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/patch-%{kernelversion}.%{patchlevel}.%{sublevel}.xz
151 %endif
152 %if %kpatch
153 # (tmb) Created with:
154 # wget https://git.kernel.org/torvalds/p/v5.1-rc6/v5.0 -O patch-5.1-rc6
155 # xz -6e patch-5.1-rc6
156 Patch2: patch-%{kernelversion}.%{patchlevel}-%{kpatch}.xz
157 %endif
158
159 # critical fixes
160
161 #END
162 ####################################################################
163
164 # global defines
165 Autoreqprov: no
166 BuildRequires: gcc
167 BuildRequires: kmod >= 12-2
168 BuildRequires: bc
169 BuildRequires: binutils >= 1:2.25.1
170 # for orc unwinder
171 BuildRequires: elfutils-devel
172 # for crypto stuff
173 BuildRequires: pkgconfig(openssl)
174 # since 4.16
175 BuildRequires: bison
176 BuildRequires: flex
177
178 %description
179 Source package to build the Linux kernel.
180
181 %{klinus_notice}
182
183
184 #
185 # kernel: Symmetric MultiProcessing kernel
186 #
187 %if %build_kernel
188 %package -n %{kname}-%{buildrel}
189 Version: %{fakever}
190 Release: %{fakerel}
191 %ifarch %{ix86}
192 Summary: Linux Kernel for desktop use with i586 & 4GB RAM
193 %else
194 %ifarch %{arm}
195 Summary: Linux Kernel for Arm machines based on Kirkwood
196 %else
197 Summary: Linux Kernel for desktop use with %{_arch}
198 %endif
199 %endif
200 Group: System/Kernel and hardware
201 Provides: should-restart = system
202 Provides: installonlypkg(kernel)
203 Provides: kernel = %{tar_ver}
204 Provides: alsa
205 Requires: bootloader-utils >= 1.16-1
206 Requires: dracut >= 046-2
207 Requires: kmod >= 12-2
208 Requires: sysfsutils >= 2.1.0-16
209 Requires: kernel-firmware >= 20170101-1
210
211 # conflict dkms packages that dont support kernel-4.14
212 Conflicts: dkms-broadcom-wl < 6.30.223.271-47
213 Conflicts: dkms-fglrx <= 15.302
214 Conflicts: dkms-nvidia-current < 384.98-2
215 Conflicts: dkms-nvidia340 < 340.104-3
216 Conflicts: dkms-nvidia304 < 304.137-2
217 Conflicts: dkms-virtualbox < 5.2.2-1
218 Conflicts: dkms-xtables-addons < 2.13-3
219 # (tmb) conflict older btrfs-progs to get the new in same transaction and in initrd
220 Conflicts: btrfs-progs < 4.14-2
221 # (tmb) conflict too old radeon-firmware to get the uvd firmwares in initrd
222 Conflicts: radeon-firmware < 20171123-1
223 # (tmb) conflict old firmware to get the firmwares in initrd
224 Conflicts: kernel-firmware-nonfree < 20171123-1
225 # (tmb) conflict old microcode to get updated ones in initrd for early loading
226 Conflicts: microcode < 0.20180807-1
227 # (tmb) conflict old theme to get mga5 theme in initrd
228 Conflicts: mageia-gfxboot-theme < 4.5.6.6-1
229 # (tmb) conflict too old grub2(-efi)
230 Conflicts: grub2 < 2.02-0.git9752.18
231 Conflicts: grub2-efi < 2.02-0.git9752.18
232 # (tmb) conflict too old efibootmgr
233 Conflicts: efibootmgr < 0.11.0-7
234 # (tmb) conflict for vmmouse breakage (mga#16954)
235 Conflicts: x11-driver-input-vmmouse < 13.1.0-1
236
237 %ifarch %{ix86}
238 Conflicts: arch(x86_64)
239 %endif
240
241 %description -n %{kname}-%{buildrel}
242 %ifarch %{ix86}
243 This kernel is compiled for desktop use, single or multiple i586
244 processor(s)/core(s) and less than 4GB RAM, using HZ_1000, voluntary
245 preempt, CFS cpu scheduler and cfq i/o scheduler.
246 This kernel relies on in-kernel smp alternatives to switch between
247 up & smp mode depending on detected hardware. To force the kernel
248 to boot in single processor mode, use the "nosmp" boot parameter.
249 %else
250 %ifarch %{arm}
251 This kernel is compiled for Arm Kirkwood boxes. It will run on openrd
252 boards. It's configured using HZ_100, preempt, CFS cpu scheduler and
253 cfq i/o scheduler.
254 This kernel relies on in-kernel smp alternatives to switch between
255 up & smp mode depending on detected hardware. To force the kernel
256 to boot in single processor mode, use the "nosmp" boot parameter.
257 %else
258 This kernel is compiled for desktop use, single or multiple %{_arch}
259 processor(s)/core(s), using HZ_1000, voluntary preempt, CFS cpu
260 scheduler and cfq i/o scheduler.
261 This kernel relies on in-kernel smp alternatives to switch between
262 up & smp mode depending on detected hardware. To force the kernel
263 to boot in single processor mode, use the "nosmp" boot parameter.
264 %endif
265 %endif
266
267 %{klinus_notice}
268 %endif # build_kernel
269
270
271 #
272 # kernel-source: kernel sources
273 #
274 %if %build_source
275 %package -n %{kname}-source-%{buildrel}
276 Version: %{fakever}
277 Release: %{fakerel}
278 Provides: %{kname}-source, kernel-source = %{kverrel}
279 Provides: %{kname}-source-%{kernelversion}.%{patchlevel}
280 Requires: glibc-devel, ncurses-devel, make, gcc, perl, diffutils
281 Summary: The source code for the Linux kernel
282 Group: Development/Kernel
283 Autoreqprov: no
284 Buildarch: noarch
285
286 %description -n %{kname}-source-%{buildrel}
287 The %{kname}-source package contains the source code files for the
288 Linux kernel. Theese source files are only needed if you want to build
289 your own custom kernel that is better tuned to your particular hardware.
290
291 If you only want the files needed to build 3rdparty (nVidia, Ati, dkms-*,...)
292 drivers against, install the *-devel-* rpm that is matching your kernel.
293
294 %{klinus_notice}
295 %endif #build_source
296
297
298 #
299 # kernel-devel: stripped kernel sources
300 #
301 %if %build_devel
302 %package -n %{kname}-devel-%{buildrel}
303 Version: %{fakever}
304 Release: %{fakerel}
305 Provides: kernel-devel = %{kverrel}
306 Summary: The %{kname} devel files for 3rdparty modules build
307 Group: Development/Kernel
308 Autoreqprov: no
309 Requires: glibc-devel, ncurses-devel, make, gcc, perl
310 Requires: pkgconfig(libelf)
311 %ifarch %{ix86}
312 Conflicts: arch(x86_64)
313 %endif
314
315 %description -n %{kname}-devel-%{buildrel}
316 This package contains the kernel-devel files that should be enough to build
317 3rdparty drivers against for use with the %{kname}-%{buildrel}.
318
319 If you want to build your own kernel, you need to install the full
320 %{kname}-source-%{buildrel} rpm.
321
322 %{klinus_notice}
323 %endif #build_devel
324
325
326 #
327 # kernel-doc: documentation for the Linux kernel
328 #
329 %if %build_doc
330 %package -n %{kname}-doc
331 Version: %{kversion}
332 Release: %{rpmrel}
333 Summary: Various documentation bits found in the kernel source
334 Group: Documentation
335 Buildarch: noarch
336
337 %description -n %{kname}-doc
338 This package contains documentation files form the kernel source. Various
339 bits of information about the Linux kernel and the device drivers shipped
340 with it are documented in these files. You also might want install this
341 package if you need a reference to the options that can be passed to Linux
342 kernel modules at load time.
343
344 %{klinus_notice}
345 %endif #build_doc
346
347
348 #
349 # kernel-latest: virtual rpm
350 #
351 %if %build_kernel
352 %package -n %{kname}-latest
353 Version: %{kversion}
354 Release: %{rpmrel}
355 Summary: Virtual rpm for latest %{kname}
356 Group: System/Kernel and hardware
357 Requires: %{kname}-%{buildrel}
358 %ifarch %{ix86}
359 Conflicts: arch(x86_64)
360 %endif
361
362 %description -n %{kname}-latest
363 This package is a virtual rpm that aims to make sure you always have the
364 latest %{kname} installed...
365
366 %{klinus_notice}
367 %endif #build_kernel
368
369
370 #
371 # kernel-source-latest: virtual rpm
372 #
373 %if %build_source
374 %package -n %{kname}-source-latest
375 Version: %{kversion}
376 Release: %{rpmrel}
377 Summary: Virtual rpm for latest %{kname}-source
378 Group: System/Kernel and hardware
379 Requires: %{kname}-source-%{buildrel}
380 Buildarch: noarch
381
382 %description -n %{kname}-source-latest
383 This package is a virtual rpm that aims to make sure you always have the
384 latest %{kname}-source installed...
385
386 %{klinus_notice}
387 %endif #build_source
388
389
390 #
391 # kernel-devel-latest: virtual rpm
392 #
393 %if %build_devel
394 %package -n %{kname}-devel-latest
395 Version: %{kversion}
396 Release: %{rpmrel}
397 Summary: Virtual rpm for latest %{kname}-devel
398 Group: System/Kernel and hardware
399 Requires: %{kname}-devel-%{buildrel}
400 %ifarch %{ix86}
401 Conflicts: arch(x86_64)
402 %endif
403
404 %description -n %{kname}-devel-latest
405 This package is a virtual rpm that aims to make sure you always have the
406 latest %{kname}-devel installed...
407
408 %{klinus_notice}
409 %endif #build_devel
410
411
412 #
413 # End packages - here begins build stage
414 #
415 %prep
416 %setup -q -n %top_dir_name -c
417
418 pushd %src_dir
419
420 %if %sublevel
421 %patch1 -p1
422 %endif
423 %if %kpatch
424 %patch2 -p1
425 %endif
426
427 # critical fixes
428
429 popd
430
431 # PATCH END
432
433
434 #
435 # Setup Begin
436 #
437
438 # Install defconfigs...
439 install %{SOURCE20} %{build_dir}/linux-%{tar_ver}/arch/x86/configs/
440 install %{SOURCE21} %{build_dir}/linux-%{tar_ver}/arch/x86/configs/
441 install %{SOURCE22} %{build_dir}/linux-%{tar_ver}/arch/arm/configs/
442 install %{SOURCE23} %{build_dir}/linux-%{tar_ver}/arch/arm64/configs/
443
444 # make sure the kernel has the sublevel we know it has...
445 LC_ALL=C perl -p -i -e "s/^SUBLEVEL.*/SUBLEVEL = %{sublevel}/" linux-%{tar_ver}/Makefile
446
447
448 %build
449 # Common target directories
450 %define _bootdir /boot
451 %define _modulesdir /lib/modules
452 %define _kerneldir /usr/src/%{kname}-%{buildrel}
453 %define _develdir /usr/src/%{kname}-devel-%{buildrel}
454
455
456 # Directories definition needed for building
457 %define temp_root %{build_dir}/temp-root
458 %define temp_boot %{temp_root}%{_bootdir}
459 %define temp_modules %{temp_root}%{_modulesdir}
460 %define temp_source %{temp_root}%{_kerneldir}
461 %define temp_devel %{temp_root}%{_develdir}
462
463
464 # Create a simulacro of buildroot
465 rm -rf %{temp_root}
466 install -d %{temp_root}
467
468
469 # make sure we are in the directory
470 cd %{src_dir}
471
472 # fix missing exec flag on file introduced in 4.14.10-rc1
473 chmod 755 tools/objtool/sync-check.sh
474
475 # make sure EXTRAVERSION says what we want it to say
476 LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{buildrpmrel}/" Makefile
477
478 # Prepare the kernel
479 %smake -s mrproper
480 %ifarch %{ix86} x86_64
481 cp arch/x86/configs/%{target_arch}_defconfig .config
482 %else
483 cp arch/%{target_arch}/configs/%{target_arch}_defconfig .config
484 %endif
485 %smake ARCH=%{_arch} oldconfig
486
487 # Build the kernel
488 %kmake ARCH=%{_arch} -s all
489 # Install kernel
490 install -d %{temp_boot}
491 install -m 644 System.map %{temp_boot}/System.map-%{buildrel}
492 install -m 644 .config %{temp_boot}/config-%{buildrel}
493 %ifarch %{arm}
494 cp -f arch/arm/boot/zImage %{temp_boot}/vmlinuz-%{buildrel}
495 install -d %{temp_root}/usr/lib/linux-%{buildrel}/
496 for d in arch/arm/boot/dts/*.dtb; do \
497 install -D -m644 $d %{temp_root}/usr/lib/linux-%{buildrel}/$(basename $d); \
498 done
499 %else
500 cp -f arch/%{target_arch}/boot/bzImage %{temp_boot}/vmlinuz-%{buildrel}
501 %endif
502
503 # Install modules
504 install -d %{temp_modules}/%{buildrel}
505 %smake ARCH=%{_arch} INSTALL_MOD_PATH=%{temp_root} KERNELRELEASE=%{buildrel} modules_install
506
507 # Save devel tree
508 %if %build_devel
509 mkdir -p %{temp_devel}
510 for i in $(find . -name 'Makefile*'); do cp -R --parents $i %{temp_devel};done
511 for i in $(find . -name 'Kconfig*' -o -name 'Kbuild*' -o -name config.mk); do cp -R --parents $i %{temp_devel};done
512 cp -fR include %{temp_devel}
513 cp -fR scripts %{temp_devel}
514 cp -fR tools/include %{temp_devel}/tools/
515 # needed for selinux
516 cp -R --parents security/selinux/include/*.h %{temp_devel}
517 %ifarch %{arm}
518 cp -fR arch/%{target_arch}/tools %{temp_devel}/arch/%{target_arch}/
519 cp -fR arch/%{target_arch}/kernel/signal.h %{temp_devel}/arch/%{target_arch}/kernel/
520 %endif
521 %ifarch %{ix86} x86_64
522 cp -fR arch/x86/boot/{ctype.h,string.{c,h}} %{temp_devel}/arch/x86/boot/
523 cp -fR arch/x86/kernel/asm-offsets.{c,s} %{temp_devel}/arch/x86/kernel/
524 cp -fR arch/x86/kernel/asm-offsets_{32,64}.c %{temp_devel}/arch/x86/kernel/
525 cp -fR arch/x86/purgatory/* %{temp_devel}/arch/x86/purgatory/
526 cp -fR arch/x86/entry/syscalls/syscall* %{temp_devel}/arch/x86/entry/syscalls/
527 cp -fR arch/x86/include %{temp_devel}/arch/x86/
528 cp -fR arch/x86/tools %{temp_devel}/arch/x86/
529 %else
530 cp -fR arch/%{target_arch}/kernel/asm-offsets.{c,s} %{temp_devel}/arch/%{target_arch}/kernel/
531 for f in $(find arch/%{target_arch} -name include); do cp -fR --parents $f %{temp_devel}; done
532 %endif
533 %ifarch x86_64
534 # orc unwinder needs theese
535 cp -fR tools/build/Build{,.include} %{temp_devel}/tools/build
536 cp -fR tools/build/fixdep.c %{temp_devel}/tools/build
537 cp -fR tools/lib/{str_error_r.c,string.c} %{temp_devel}/tools/lib
538 cp -fR tools/lib/subcmd/* %{temp_devel}/tools/lib/subcmd
539 cp -fR tools/objtool/* %{temp_devel}/tools/objtool
540 cp -fR tools/scripts/utilities.mak %{temp_devel}/tools/scripts
541 %endif
542
543 # Needed for generation of kernel/bounds.s
544 cp -fR kernel/bounds.c %{temp_devel}/kernel/
545
546 # needed by include/generated/timeconst.h
547 cp -fR kernel/time/timeconst.bc %{temp_devel}/kernel/time/
548
549 # ship config and symvers
550 cp -fR .config Module.symvers %{temp_devel}
551
552 # Needed for truecrypt build (Danny)
553 cp -fR drivers/md/dm.h %{temp_devel}/drivers/md/
554
555 # Check and clean the -devel tree
556 pushd %{temp_devel} >/dev/null
557 %smake ARCH=%{_arch} -s prepare scripts clean
558 rm -f .config.old
559 popd >/dev/null
560
561 # Disable mrproper and other targets
562 patch -p1 -d %{temp_devel} -i %{SOURCE2}
563
564 # Fix permissions
565 chmod -R a+rX %{temp_devel}
566 %endif # build_devel
567
568 #make sure we are in the directory
569 cd %src_dir
570
571 # kernel-source is shipped as an unprepared tree
572 %smake ARCH=%{_arch} -s mrproper
573
574
575 ###
576 ### Install
577 ###
578 %install
579 install -m 644 %{SOURCE4} .
580
581 cd %src_dir
582 # Directories definition needed for installing
583 %define target_source %{buildroot}/%{_kerneldir}
584 %define target_boot %{buildroot}%{_bootdir}
585 %define target_modules %{buildroot}%{_modulesdir}
586 %define target_devel %{buildroot}%{_develdir}
587
588 # We want to be able to test several times the install part
589 rm -rf %{buildroot}
590 cp -a %{temp_root} %{buildroot}
591
592 # Create directories infastructure
593 %if %build_source
594 install -d %{target_source}
595
596 tar cf - . | tar xf - -C %{target_source}
597 chmod -R a+rX %{target_source}
598
599 # we remove all the source files that we don't ship
600
601 # first architecture files
602 for i in alpha arc avr32 blackfin c6x cris csky frv hexagon h8300 ia64 m32r mips \
603 microblaze m68k m68knommu metag mn10300 nds32 nios2 openrisc parisc powerpc ppc \
604 riscv s390 score sh sh64 sparc tile unicore32 v850 xtensa; do
605 rm -rf %{target_source}/arch/$i
606
607 %if %build_devel
608 rm -rf %{target_devel}/arch/$i
609 %endif
610 done
611 %ifnarch %{arm}
612 rm -rf %{target_source}/arch/arm*
613 rm -rf %{target_source}/include/kvm/arm*
614 rm -rf %{target_source}/include/soc
615 rm -rf %{target_source}/tools/arch/arm*
616 %endif
617
618 # remove arch files based on target arch in -devel rpms
619 %if %build_devel
620 %ifnarch %{ix86} x86_64
621 rm -rf %{target_devel}/arch/x86
622 %endif
623 %ifnarch %{arm}
624 rm -rf %{target_devel}/arch/arm
625 rm -rf %{target_devel}/arch/arm64
626 rm -rf %{target_devel}/include/kvm/arm*
627 rm -rf %{target_devel}/include/soc
628 %endif
629 %endif
630
631
632 # other misc files
633 rm -f %{target_source}/{.clang-format,.config.old,.config.cmd,.tmp_gas_check,.mailmap,.missing-syscalls.d,arch/.gitignore,.gitattributes,.get_maintainer.ignore,.cocciconfig}
634 rm -rf %{target_source}/.tmp_depmod/
635
636 # clean tools tree
637 pushd %{target_source}
638 %smake -C tools clean
639 %smake -C tools/build clean
640 %smake -C tools/build/feature clean
641 popd
642
643 # nuke last as it gets re-created
644 rm -f %{target_source}/.cache.mk
645
646 #endif %build_source
647 %endif
648
649
650 # compressing modules
651 find %{target_modules} -name "*.ko" | %kxargs xz -6e
652
653
654 # We used to have a copy of PrepareKernel here
655 # Now, we make sure that the thing in the linux dir is what we want it to be
656
657 for i in %{target_modules}/*; do
658 rm -f $i/build $i/source
659 done
660
661
662 # sniff, if we gzipped all the modules, we change the stamp :(
663 # we really need the depmod -ae here
664 pushd %{target_modules}
665 for i in *; do
666 /sbin/depmod -ae -b %{buildroot} -F %{target_boot}/System.map-$i $i
667 echo $?
668 done
669
670 for i in *; do
671 pushd $i
672 echo "Creating module.description for $i"
673 modules=`find . -name "*.ko.xz"`
674 echo $modules | xargs /sbin/modinfo \
675 | perl -lne 'print "$name\t$1" if $name && /^description:\s*(.*)/; $name = $1 if m!^filename:\s*(.*)\.k?o!; $name =~ s!.*/!!' > modules.description
676 popd
677 done
678 popd
679
680
681 ###
682 ### Clean
683 ###
684
685 %clean
686 rm -rf %{buildroot}
687 # We don't want to remove this, the whole reason of its existence is to be
688 # able to do several rpm --short-circuit -bi for testing install
689 # phase without repeating compilation phase
690 #rm -rf %{temp_root}
691
692
693 ###
694 ### Scripts
695 ###
696
697 ### kernel
698 %if %build_kernel
699 %preun -n %{kname}-%{buildrel}
700 /sbin/installkernel -R %{buildrel}
701 if [ -L /lib/modules/%{buildrel}/build ]; then
702 rm -f /lib/modules/%{buildrel}/build
703 fi
704 if [ -L /lib/modules/%{buildrel}/source ]; then
705 rm -f /lib/modules/%{buildrel}/source
706 fi
707 pushd /boot > /dev/null
708 if [ -L vmlinuz-linus ]; then
709 if [ "$(readlink vmlinuz-linus)" = "vmlinuz-%{buildrel}" ]; then
710 rm -f vmlinuz-linus
711 fi
712 fi
713 if [ -L initrd-linus.img ]; then
714 if [ "$(readlink initrd-linus.img)" = "initrd-%{buildrel}.img" ]; then
715 rm -f initrd-linus.img
716 fi
717 fi
718 popd > /dev/null
719 exit 0
720
721 %post -n %{kname}-%{buildrel}
722 /sbin/installkernel -L %{buildrel}
723 if [ -d /usr/src/%{kname}-devel-%{buildrel} ]; then
724 ln -sf /usr/src/%{kname}-devel-%{buildrel} /lib/modules/%{buildrel}/build
725 ln -sf /usr/src/%{kname}-devel-%{buildrel} /lib/modules/%{buildrel}/source
726 fi
727 pushd /boot > /dev/null
728 if [ -L vmlinuz-linus ]; then
729 rm -f vmlinuz-linus
730 fi
731 ln -sf vmlinuz-%{buildrel} vmlinuz-linus
732 if [ -L initrd-linus.img ]; then
733 rm -f initrd-linus.img
734 fi
735 ln -sf initrd-%{buildrel}.img initrd-linus.img
736 popd > /dev/null
737
738 %posttrans -n %{kname}-%{buildrel}
739 if [ -x /usr/sbin/dkms_autoinstaller -a -d /usr/src/%{kname}-devel-%{buildrel} ]; then
740 /usr/sbin/dkms_autoinstaller start %{buildrel}
741 fi
742
743 %postun -n %{kname}-%{buildrel}
744 /sbin/kernel_remove_initrd %{buildrel}
745 rm -rf /lib/modules/%{buildrel} > /dev/null
746 %endif # build_kernel
747
748
749 ### kernel-devel
750 %if %build_devel
751 %post -n %{kname}-devel-%{buildrel}
752 # place /build and /source symlinks in place.
753 if [ -d /lib/modules/%{buildrel} ]; then
754 ln -sf /usr/src/%{kname}-devel-%{buildrel} /lib/modules/%{buildrel}/build
755 ln -sf /usr/src/%{kname}-devel-%{buildrel} /lib/modules/%{buildrel}/source
756 fi
757
758 %preun -n %{kname}-devel-%{buildrel}
759 # we need to delete <modules>/{build,source} at uninstall
760 if [ -L /lib/modules/%{buildrel}/build ]; then
761 rm -f /lib/modules/%{buildrel}/build
762 fi
763 if [ -L /lib/modules/%{buildrel}/source ]; then
764 rm -f /lib/modules/%{buildrel}/source
765 fi
766 exit 0
767 %endif #build_devel
768
769
770 ###
771 ### file lists
772 ###
773
774 # kernel
775 %if %build_kernel
776 %files -n %{kname}-%{buildrel}
777 %{_bootdir}/config-%{buildrel}
778 %{_bootdir}/vmlinuz-%{buildrel}
779 %{_bootdir}/System.map-%{buildrel}
780 %dir %{_modulesdir}/%{buildrel}/
781 %{_modulesdir}/%{buildrel}/kernel
782 %{_modulesdir}/%{buildrel}/modules.*
783 %doc README.kernel-sources
784 %ifarch %arm
785 %dir /usr/lib/linux-%{buildrel}
786 /usr/lib/linux-%{buildrel}/*.dtb
787 %endif
788 %endif # build_kernel
789
790 # kernel-source
791 %if %build_source
792 %files -n %{kname}-source-%{buildrel}
793 %doc %{_kerneldir}/LICENSES
794 %dir %{_kerneldir}
795 %dir %{_kerneldir}/arch
796 %dir %{_kerneldir}/include
797 %{_kerneldir}/.gitignore
798 %{_kerneldir}/COPYING
799 %{_kerneldir}/CREDITS
800 %{_kerneldir}/Documentation
801 %{_kerneldir}/Kbuild
802 %{_kerneldir}/Kconfig
803 %{_kerneldir}/MAINTAINERS
804 %{_kerneldir}/Makefile
805 %{_kerneldir}/README
806 %{_kerneldir}/arch/Kconfig
807 %ifarch %arm
808 %{_kerneldir}/arch/arm
809 %{_kerneldir}/arch/arm64
810 %endif
811 %{_kerneldir}/arch/x86
812 %{_kerneldir}/arch/um
813 %{_kerneldir}/block
814 %{_kerneldir}/certs
815 %{_kerneldir}/crypto
816 %{_kerneldir}/drivers
817 %{_kerneldir}/fs
818 %{_kerneldir}/include/acpi
819 %{_kerneldir}/include/asm-generic
820 %{_kerneldir}/include/clocksource
821 %{_kerneldir}/include/crypto
822 %{_kerneldir}/include/drm
823 %{_kerneldir}/include/dt-bindings
824 %{_kerneldir}/include/kvm
825 %{_kerneldir}/include/linux
826 %{_kerneldir}/include/math-emu
827 %{_kerneldir}/include/memory
828 %{_kerneldir}/include/net
829 %{_kerneldir}/include/pcmcia
830 %{_kerneldir}/include/ras
831 %{_kerneldir}/include/scsi
832 %ifarch %arm
833 %{_kerneldir}/include/soc
834 %endif
835 %{_kerneldir}/include/sound
836 %{_kerneldir}/include/target
837 %{_kerneldir}/include/trace
838 %{_kerneldir}/include/uapi
839 %{_kerneldir}/include/video
840 %{_kerneldir}/include/media
841 %{_kerneldir}/include/misc
842 %{_kerneldir}/include/keys
843 %{_kerneldir}/include/rdma
844 %{_kerneldir}/include/xen
845 %{_kerneldir}/init
846 %{_kerneldir}/ipc
847 %{_kerneldir}/kernel
848 %{_kerneldir}/lib
849 %{_kerneldir}/mm
850 %{_kerneldir}/net
851 %{_kerneldir}/samples
852 %{_kerneldir}/scripts
853 %{_kerneldir}/security
854 %{_kerneldir}/sound
855 %{_kerneldir}/tools
856 %{_kerneldir}/usr
857 %{_kerneldir}/virt
858 %doc README.kernel-sources
859 %endif # build_source
860
861 # kernel-devel
862 %if %build_devel
863 %files -n %{kname}-devel-%{buildrel}
864 %dir %{_develdir}
865 %dir %{_develdir}/arch
866 %dir %{_develdir}/include
867 %{_develdir}/.config
868 %{_develdir}/Documentation
869 %{_develdir}/Kbuild
870 %{_develdir}/Kconfig
871 %{_develdir}/Makefile
872 %{_develdir}/Module.symvers
873 %{_develdir}/arch/Kconfig
874 %ifarch %{arm}
875 %{_develdir}/arch/arm
876 %{_develdir}/arch/arm64
877 %endif
878 %ifarch %{ix86} x86_64
879 %{_develdir}/arch/x86
880 %endif
881 %{_develdir}/arch/um
882 %{_develdir}/block
883 %{_develdir}/certs
884 %{_develdir}/crypto
885 %{_develdir}/drivers
886 %{_develdir}/fs
887 %{_develdir}/include/acpi
888 %{_develdir}/include/asm-generic
889 %{_develdir}/include/clocksource
890 %{_develdir}/include/config
891 %{_develdir}/include/crypto
892 %{_develdir}/include/drm
893 %{_develdir}/include/dt-bindings
894 %{_develdir}/include/generated
895 %{_develdir}/include/keys
896 %{_develdir}/include/kvm
897 %{_develdir}/include/linux
898 %{_develdir}/include/math-emu
899 %{_develdir}/include/memory
900 %{_develdir}/include/misc
901 %{_develdir}/include/net
902 %{_develdir}/include/pcmcia
903 %{_develdir}/include/ras
904 %{_develdir}/include/rdma
905 %{_develdir}/include/scsi
906 %ifarch %arm
907 %{_develdir}/include/soc
908 %endif
909 %{_develdir}/include/sound
910 %{_develdir}/include/target
911 %{_develdir}/include/trace
912 %{_develdir}/include/uapi
913 %{_develdir}/include/video
914 %{_develdir}/include/media
915 %{_develdir}/include/xen
916 %{_develdir}/init
917 %{_develdir}/ipc
918 %{_develdir}/kernel
919 %{_develdir}/lib
920 %{_develdir}/mm
921 %{_develdir}/net
922 %{_develdir}/samples
923 %{_develdir}/scripts
924 %{_develdir}/security
925 %{_develdir}/sound
926 %{_develdir}/tools
927 %{_develdir}/usr
928 %{_develdir}/virt
929 %doc README.kernel-sources
930 %endif # build_devel
931
932
933 %if %build_doc
934 %files -n %{kname}-doc
935 %doc linux-%{tar_ver}/Documentation/*
936 %endif # build_doc
937
938 %if %build_kernel
939 %files -n %{kname}-latest
940 %endif # build_kernel
941
942 %if %build_source
943 %files -n %{kname}-source-latest
944 %endif # build_source
945
946 %if %build_devel
947 %files -n %{kname}-devel-latest
948 %endif # build_devel

  ViewVC Help
Powered by ViewVC 1.1.30