Browse code

linux-aws, linux-rt: Fix linux headers and doc folder names

[linux-rt] : Fix linux headers, doc folder and linux-<uname -r>.cfg
: Drop rt patchset version from <uname -r>
: Patch to ignore localversion-rt file read

[linux-aws]: Fix linux headers, doc folder and linux-<uname -r>.cfg

Change-Id: I53447c3d6653e208f045b5887ba44a333df862cd
Signed-off-by: Keerthana K <keerthanak@vmware.com>
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/17128
Reviewed-by: Srivatsa S. Bhat <srivatsab@vmware.com>
Tested-by: Srivatsa S. Bhat <srivatsab@vmware.com>

Keerthana K authored on 2022/07/28 20:02:55
Showing 3 changed files
... ...
@@ -8,7 +8,7 @@
8 8
 Summary:        Kernel
9 9
 Name:           linux-aws
10 10
 Version:        5.10.78
11
-Release:        7%{?dist}
11
+Release:        8%{?dist}
12 12
 License:        GPLv2
13 13
 URL:            http://www.kernel.org/
14 14
 Group:          System Environment/Kernel
... ...
@@ -219,8 +219,8 @@ done \
219 219
 %install
220 220
 install -vdm 755 %{buildroot}%{_sysconfdir}
221 221
 install -vdm 755 %{buildroot}/boot
222
-install -vdm 755 %{buildroot}%{_docdir}/%{name}-%{uname_r}
223
-install -vdm 755 %{buildroot}%{_usrsrc}/%{name}-headers-%{uname_r}
222
+install -vdm 755 %{buildroot}%{_docdir}/linux-%{uname_r}
223
+install -vdm 755 %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}
224 224
 install -vdm 755 %{buildroot}%{_libdir}/debug/%{_modulesdir}
225 225
 make %{?_smp_mflags} INSTALL_MOD_PATH=%{buildroot} modules_install
226 226
 
... ...
@@ -244,7 +244,7 @@ install -vm 644 arch/x86/boot/bzImage %{buildroot}/boot/vmlinuz-%{uname_r}
244 244
 # Restrict the permission on System.map-X file
245 245
 install -vm 400 System.map %{buildroot}/boot/System.map-%{uname_r}
246 246
 install -vm 644 .config %{buildroot}/boot/config-%{uname_r}
247
-cp -r Documentation/* %{buildroot}%{_docdir}/%{name}-%{uname_r}
247
+cp -r Documentation/* %{buildroot}%{_docdir}/linux-%{uname_r}
248 248
 
249 249
 %if 0%{?__debug_package}
250 250
 install -vm 644 vmlinux %{buildroot}%{_libdir}/debug/%{_modulesdir}/vmlinux-%{uname_r}
... ...
@@ -252,7 +252,7 @@ install -vm 644 vmlinux %{buildroot}%{_libdir}/debug/%{_modulesdir}/vmlinux-%{un
252 252
 ln -s vmlinux-%{uname_r} %{buildroot}%{_libdir}/debug/%{_modulesdir}/vmlinux
253 253
 %endif
254 254
 
255
-cat > %{buildroot}/boot/%{name}-%{uname_r}.cfg << "EOF"
255
+cat > %{buildroot}/boot/linux-%{uname_r}.cfg << "EOF"
256 256
 # GRUB Environment Block
257 257
 photon_cmdline=init=/lib/systemd/systemd ro loglevel=3 quiet nvme_core.io_timeout=4294967295
258 258
 photon_linux=vmlinuz-%{uname_r}
... ...
@@ -269,18 +269,18 @@ EOF
269 269
 rm -rf %{buildroot}%{_modulesdir}/source \
270 270
        %{buildroot}%{_modulesdir}/build
271 271
 
272
-find . -name Makefile* -o -name Kconfig* -o -name *.pl | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/%{name}-headers-%{uname_r}' copy
273
-find arch/%{archdir}/include include scripts -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/%{name}-headers-%{uname_r}' copy
274
-find $(find arch/%{archdir} -name include -o -name scripts -type d) -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/%{name}-headers-%{uname_r}' copy
275
-find arch/%{archdir}/include Module.symvers include scripts -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/%{name}-headers-%{uname_r}' copy
272
+find . -name Makefile* -o -name Kconfig* -o -name *.pl | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy
273
+find arch/%{archdir}/include include scripts -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy
274
+find $(find arch/%{archdir} -name include -o -name scripts -type d) -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy
275
+find arch/%{archdir}/include Module.symvers include scripts -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy
276 276
 %ifarch x86_64
277 277
 # CONFIG_STACK_VALIDATION=y requires objtool to build external modules
278
-install -vsm 755 tools/objtool/objtool %{buildroot}%{_usrsrc}/%{name}-headers-%{uname_r}/tools/objtool/
279
-install -vsm 755 tools/objtool/fixdep %{buildroot}%{_usrsrc}/%{name}-headers-%{uname_r}/tools/objtool/
278
+install -vsm 755 tools/objtool/objtool %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}/tools/objtool/
279
+install -vsm 755 tools/objtool/fixdep %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}/tools/objtool/
280 280
 %endif
281 281
 
282
-cp .config %{buildroot}%{_usrsrc}/%{name}-headers-%{uname_r} # copy .config manually to be where it's expected to be
283
-ln -sf "%{_usrsrc}/%{name}-headers-%{uname_r}" "%{buildroot}%{_modulesdir}/build"
282
+cp .config %{buildroot}%{_usrsrc}/linux-headers-%{uname_r} # copy .config manually to be where it's expected to be
283
+ln -sf "%{_usrsrc}/linux-headers-%{uname_r}" "%{buildroot}%{_modulesdir}/build"
284 284
 find %{buildroot}/lib/modules -name '*.ko' -print0 | xargs -0 chmod u+x
285 285
 
286 286
 # disable (JOBS=1) parallel build to fix this issue:
... ...
@@ -292,7 +292,7 @@ find %{buildroot}/lib/modules -name '*.ko' -print0 | xargs -0 chmod u+x
292 292
 
293 293
 %post
294 294
 /sbin/depmod -a %{uname_r}
295
-ln -sf %{name}-%{uname_r}.cfg /boot/photon.cfg
295
+ln -sf linux-%{uname_r}.cfg /boot/photon.cfg
296 296
 
297 297
 %post drivers-gpu
298 298
 /sbin/depmod -a %{uname_r}
... ...
@@ -310,7 +310,7 @@ ln -sf %{name}-%{uname_r}.cfg /boot/photon.cfg
310 310
 /boot/System.map-%{uname_r}
311 311
 /boot/config-%{uname_r}
312 312
 /boot/vmlinuz-%{uname_r}
313
-%config(noreplace) /boot/%{name}-%{uname_r}.cfg
313
+%config(noreplace) /boot/linux-%{uname_r}.cfg
314 314
 %config %{_localstatedir}/lib/initramfs/kernel/%{uname_r}
315 315
 %defattr(0644,root,root)
316 316
 %{_modulesdir}/*
... ...
@@ -323,12 +323,12 @@ ln -sf %{name}-%{uname_r}.cfg /boot/photon.cfg
323 323
 
324 324
 %files docs
325 325
 %defattr(-,root,root)
326
-%{_defaultdocdir}/%{name}-%{uname_r}/*
326
+%{_defaultdocdir}/linux-%{uname_r}/*
327 327
 
328 328
 %files devel
329 329
 %defattr(-,root,root)
330 330
 %{_modulesdir}/build
331
-%{_usrsrc}/%{name}-headers-%{uname_r}
331
+%{_usrsrc}/linux-headers-%{uname_r}
332 332
 
333 333
 %files drivers-gpu
334 334
 %defattr(-,root,root)
... ...
@@ -346,6 +346,8 @@ ln -sf %{name}-%{uname_r}.cfg /boot/photon.cfg
346 346
 %endif
347 347
 
348 348
 %changelog
349
+* Thu Jul 28 2022 Keerthana K <keerthanak@vmware.com> 5.10.78-8
350
+- Fix linux headers, doc folder and linux-<uname -r>.cfg names
349 351
 * Fri Jun 24 2022 Shreenidhi Shedi <sshedi@vmware.com> 5.10.78-7
350 352
 - Fix debug_package macro usage while adding vmlinux to debuginfo rpm
351 353
 * Tue Jun 14 2022 Brennan Lamoreaux <blamoreaux@vmware.com> 5.10.78-6
... ...
@@ -17,7 +17,7 @@
17 17
 Summary:        Kernel
18 18
 Name:           linux-rt
19 19
 Version:        5.10.78
20
-Release:        13%{?kat_build:.kat}%{?dist}
20
+Release:        14%{?kat_build:.kat}%{?dist}
21 21
 License:        GPLv2
22 22
 URL:            http://www.kernel.org/
23 23
 Group:          System Environment/Kernel
... ...
@@ -26,7 +26,7 @@ Distribution:   Photon
26 26
 
27 27
 # Keep rt_version matched up with localversion.patch
28 28
 %define rt_version rt54
29
-%define uname_r %{version}-%{rt_version}-%{release}-rt
29
+%define uname_r %{version}-%{release}-rt
30 30
 %define _modulesdir /lib/modules/%{uname_r}
31 31
 
32 32
 Source0:        http://www.kernel.org/pub/linux/kernel/v5.x/linux-%{version}.tar.xz
... ...
@@ -404,6 +404,9 @@ Patch603: 0303-locking-rwsem-rt-Remove-might_sleep-in-__up_read.patch
404 404
 # Keep rt_version matched up with this patch.
405 405
 Patch604: 0304-Linux-5.10.73-rt54-REBASE.patch
406 406
 
407
+#Ignore reading localversion-rt
408
+Patch699: 0001-setlocalversion-Skip-reading-localversion-rt-file.patch
409
+
407 410
 #Photon Specific Changes
408 411
 Patch700: 0000-Revert-clockevents-Stop-unused-clockevent-devices.patch
409 412
 
... ...
@@ -492,6 +495,7 @@ Requires(postun):(coreutils or toybox)
492 492
 %description
493 493
 The Linux package contains the Linux kernel with RT (real-time)
494 494
 features.
495
+Built with rt patchset version %{rt_version}.
495 496
 %if 0%{?fips}
496 497
 This kernel is FIPS certified.
497 498
 %endif
... ...
@@ -640,8 +644,8 @@ done \
640 640
 
641 641
 install -vdm 755 %{buildroot}%{_sysconfdir}
642 642
 install -vdm 755 %{buildroot}/boot
643
-install -vdm 755 %{buildroot}%{_docdir}/%{name}-%{uname_r}
644
-install -vdm 755 %{buildroot}%{_usrsrc}/%{name}-headers-%{uname_r}
643
+install -vdm 755 %{buildroot}%{_docdir}/linux-%{uname_r}
644
+install -vdm 755 %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}
645 645
 install -vdm 755 %{buildroot}%{_libdir}/debug/%{_modulesdir}
646 646
 make %{?_smp_mflags} INSTALL_MOD_PATH=%{buildroot} modules_install
647 647
 
... ...
@@ -683,7 +687,7 @@ install -vm 644 arch/x86/boot/bzImage %{buildroot}/boot/vmlinuz-%{uname_r}
683 683
 # Restrict the permission on System.map-X file
684 684
 install -vm 400 System.map %{buildroot}/boot/System.map-%{uname_r}
685 685
 install -vm 644 .config %{buildroot}/boot/config-%{uname_r}
686
-cp -r Documentation/* %{buildroot}%{_docdir}/%{name}-%{uname_r}
686
+cp -r Documentation/* %{buildroot}%{_docdir}/linux-%{uname_r}
687 687
 
688 688
 %if 0%{?__debug_package}
689 689
 install -vm 644 vmlinux %{buildroot}%{_libdir}/debug/%{_modulesdir}/vmlinux-%{uname_r}
... ...
@@ -691,7 +695,7 @@ install -vm 644 vmlinux %{buildroot}%{_libdir}/debug/%{_modulesdir}/vmlinux-%{un
691 691
 ln -s vmlinux-%{uname_r} %{buildroot}%{_libdir}/debug/%{_modulesdir}/vmlinux
692 692
 %endif
693 693
 
694
-cat > %{buildroot}/boot/%{name}-%{uname_r}.cfg << "EOF"
694
+cat > %{buildroot}/boot/linux-%{uname_r}.cfg << "EOF"
695 695
 # GRUB Environment Block
696 696
 photon_cmdline=init=/lib/systemd/systemd ro loglevel=3 quiet nosoftlockup intel_idle.max_cstate=0 mce=ignore_ce nowatchdog cpuidle.off=1 nmi_watchdog=0 audit=0
697 697
 photon_linux=vmlinuz-%{uname_r}
... ...
@@ -708,18 +712,18 @@ EOF
708 708
 rm -rf %{buildroot}%{_modulesdir}/source \
709 709
        %{buildroot}%{_modulesdir}/build
710 710
 
711
-find . -name Makefile* -o -name Kconfig* -o -name *.pl | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/%{name}-headers-%{uname_r}' copy
712
-find arch/%{archdir}/include include scripts -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/%{name}-headers-%{uname_r}' copy
713
-find $(find arch/%{archdir} -name include -o -name scripts -type d) -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/%{name}-headers-%{uname_r}' copy
714
-find arch/%{archdir}/include Module.symvers include scripts -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/%{name}-headers-%{uname_r}' copy
711
+find . -name Makefile* -o -name Kconfig* -o -name *.pl | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy
712
+find arch/%{archdir}/include include scripts -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy
713
+find $(find arch/%{archdir} -name include -o -name scripts -type d) -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy
714
+find arch/%{archdir}/include Module.symvers include scripts -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy
715 715
 %ifarch x86_64
716 716
 # CONFIG_STACK_VALIDATION=y requires objtool to build external modules
717
-install -vsm 755 tools/objtool/objtool %{buildroot}%{_usrsrc}/%{name}-headers-%{uname_r}/tools/objtool/
718
-install -vsm 755 tools/objtool/fixdep %{buildroot}%{_usrsrc}/%{name}-headers-%{uname_r}/tools/objtool/
717
+install -vsm 755 tools/objtool/objtool %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}/tools/objtool/
718
+install -vsm 755 tools/objtool/fixdep %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}/tools/objtool/
719 719
 %endif
720 720
 
721
-cp .config %{buildroot}%{_usrsrc}/%{name}-headers-%{uname_r} # copy .config manually to be where it's expected to be
722
-ln -sf "%{_usrsrc}/%{name}-headers-%{uname_r}" "%{buildroot}%{_modulesdir}/build"
721
+cp .config %{buildroot}%{_usrsrc}/linux-headers-%{uname_r} # copy .config manually to be where it's expected to be
722
+ln -sf "%{_usrsrc}/linux-headers-%{uname_r}" "%{buildroot}%{_modulesdir}/build"
723 723
 find %{buildroot}/lib/modules -name '*.ko' -print0 | xargs -0 chmod u+x
724 724
 
725 725
 %include %{SOURCE2}
... ...
@@ -727,14 +731,14 @@ find %{buildroot}/lib/modules -name '*.ko' -print0 | xargs -0 chmod u+x
727 727
 
728 728
 %post
729 729
 /sbin/depmod -a %{uname_r}
730
-ln -sf %{name}-%{uname_r}.cfg /boot/photon.cfg
730
+ln -sf linux-%{uname_r}.cfg /boot/photon.cfg
731 731
 
732 732
 %files
733 733
 %defattr(-,root,root)
734 734
 /boot/System.map-%{uname_r}
735 735
 /boot/config-%{uname_r}
736 736
 /boot/vmlinuz-%{uname_r}
737
-%config(noreplace) /boot/%{name}-%{uname_r}.cfg
737
+%config(noreplace) /boot/linux-%{uname_r}.cfg
738 738
 %config %{_localstatedir}/lib/initramfs/kernel/%{uname_r}
739 739
 %defattr(0644,root,root)
740 740
 %{_modulesdir}/*
... ...
@@ -745,15 +749,19 @@ ln -sf %{name}-%{uname_r}.cfg /boot/photon.cfg
745 745
 
746 746
 %files docs
747 747
 %defattr(-,root,root)
748
-%{_defaultdocdir}/%{name}-%{uname_r}/*
748
+%{_defaultdocdir}/linux-%{uname_r}/*
749 749
 %{_mandir}/*
750 750
 
751 751
 %files devel
752 752
 %defattr(-,root,root)
753 753
 %{_modulesdir}/build
754
-%{_usrsrc}/%{name}-headers-%{uname_r}
754
+%{_usrsrc}/linux-headers-%{uname_r}
755 755
 
756 756
 %changelog
757
+* Wed Aug 03 2022 Keerthana K <keerthanak@vmware.com> 5.10.78-14
758
+- Fix linux headers, doc folder and linux-<uname -r>.cfg names
759
+- Drop rt_version from uname_r
760
+- Patch to skip reading localversion-rt
757 761
 * Mon Aug 01 2022 Tejaswini Jayaramaiah <jtejaswini@vmware.com> 5.10.78-13
758 762
 - Enable CONFIG_CGROUP_BPF in config to run containers with cgroup v2
759 763
 * Fri Jul 22 2022 Him Kalyan Bordoloi <bordoloih@vmware.com> 5.10.78-12
760 764
new file mode 100644
... ...
@@ -0,0 +1,30 @@
0
+From d8fa572209f8de6c4a48dc8d3ab5eb5f4095c174 Mon Sep 17 00:00:00 2001
1
+From: Keerthana K <keerthanak@vmware.com>
2
+Date: Wed, 27 Jul 2022 11:40:49 +0000
3
+Subject: [PATCH] setlocalversion: Skip reading localversion-rt file
4
+
5
+This patch is required to skip reading localversion-rt file which
6
+is appended to local version.
7
+
8
+Signed-off-by: Keerthana K <keerthanak@vmware.com>
9
+---
10
+ scripts/setlocalversion | 3 +++
11
+ 1 file changed, 3 insertions(+)
12
+
13
+diff --git a/scripts/setlocalversion b/scripts/setlocalversion
14
+index 2cb0b92f4..6ceb42b15 100755
15
+--- a/scripts/setlocalversion
16
+@@ -144,6 +144,9 @@ collect_files()
17
+ 		*\~*)
18
+ 			continue
19
+ 			;;
20
++		*localversion-rt)
21
++			continue
22
++			;;
23
+ 		esac
24
+ 		if test -e "$file"; then
25
+ 			res="$res$(cat "$file")"
26
+-- 
27
+2.28.0
28
+