
Reduce noise in logs. Our patches are supposed to be fuzz free. This results in no actual code change. Change-Id: Ic1d714530210efb365a4a335e9ac543ad81294e3 Closes-Bug: 1877387 Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
260 lines
10 KiB
Diff
260 lines
10 KiB
Diff
From 8f38a28fc2750dc526363dc4b7cce3c152bb913b Mon Sep 17 00:00:00 2001
|
|
Message-Id: <8f38a28fc2750dc526363dc4b7cce3c152bb913b.1588873412.git.Jim.Somerville@windriver.com>
|
|
From: Jim Somerville <Jim.Somerville@windriver.com>
|
|
Date: Mon, 23 Apr 2018 15:18:45 -0400
|
|
Subject: [PATCH 1/2] Build logic and sources for TiC
|
|
|
|
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
|
Signed-off-by: Robin Lu <bin1.lu@intel.com>
|
|
Signed-off-by: Dongqi Chen <chen.dq@neusoft.com>
|
|
---
|
|
SPECS/kernel-rt.spec | 87 ++++++++++++++++++++++++++++++++--------------------
|
|
1 file changed, 53 insertions(+), 34 deletions(-)
|
|
|
|
diff --git a/SPECS/kernel-rt.spec b/SPECS/kernel-rt.spec
|
|
index f9cfea3..b89db57 100644
|
|
--- a/SPECS/kernel-rt.spec
|
|
+++ b/SPECS/kernel-rt.spec
|
|
@@ -36,9 +36,9 @@ Summary: The Linux kernel
|
|
%define pkgrelease 147.3.1.rt24.96.el8_1
|
|
|
|
# allow pkg_release to have configurable %%{?dist} tag
|
|
-%define specrelease 147.3.1.rt24.96%{?dist}
|
|
+%define specrelease 147.3.1.rt24.96.el8_1
|
|
|
|
-%define pkg_release %{specrelease}%{?buildid}
|
|
+%define pkg_release %{specrelease}%{?buildid}%{?_tis_dist}.%{tis_patch_ver}
|
|
|
|
# What parts do we want to build? We must build at least one kernel.
|
|
# These are the kernels that are built IF the architecture allows it.
|
|
@@ -46,6 +46,7 @@ Summary: The Linux kernel
|
|
# by later arch-specific checks.
|
|
|
|
%define _with_kabidupchk 1
|
|
+%define _with_tools 1
|
|
# The following build options are enabled by default.
|
|
# Use either --without <opt> in your rpmbuild command or force values
|
|
# to 0 in here to disable them.
|
|
@@ -54,6 +55,8 @@ Summary: The Linux kernel
|
|
%define with_up %{?_without_up: 0} %{?!_without_up: 1}
|
|
# kernel-debug
|
|
%define with_debug %{?_without_debug: 0} %{?!_without_debug: 1}
|
|
+# STX: disable debug build
|
|
+%define with_debug 0
|
|
# kernel-headers
|
|
# realtime
|
|
%define with_realtime %{?_without_realtime: 0} %{?!_without_realtime: 1}
|
|
@@ -67,6 +70,8 @@ Summary: The Linux kernel
|
|
%define with_bpftool %{?_without_bpftool: 0} %{?!_without_bpftool: 1}
|
|
# kernel-debuginfo
|
|
%define with_debuginfo %{?_without_debuginfo: 0} %{?!_without_debuginfo: 1}
|
|
+# STX: disable debuginfo
|
|
+%define with_debuginfo 0
|
|
# Want to build a the vsdo directories installed
|
|
%define with_vdso_install %{?_without_vdso_install: 0} %{?!_without_vdso_install: 1}
|
|
# kernel-zfcpdump (s390 specific kernel for zfcpdump)
|
|
@@ -126,10 +131,11 @@ Summary: The Linux kernel
|
|
%global rttag .rt24
|
|
# realtimeN
|
|
%global rtbuild .96
|
|
-%define with_headers 0
|
|
+%define with_headers 1
|
|
%define with_cross_headers 0
|
|
%define with_perf 0
|
|
-%define with_tools 0
|
|
+# generate kernel-rt-tools
|
|
+%define with_tools 1
|
|
%define with_bpftool 0
|
|
%define with_zfcpdump 0
|
|
%define with_kabichk 0
|
|
@@ -291,7 +297,7 @@ Requires: rt-setup
|
|
#
|
|
BuildRequires: kmod, patch, bash, tar, git
|
|
BuildRequires: bzip2, xz, findutils, gzip, m4, perl-interpreter, perl-Carp, perl-devel, perl-generators, make, diffutils, gawk
|
|
-BuildRequires: gcc, binutils, redhat-rpm-config, hmaccalc, python3-devel
|
|
+BuildRequires: gcc, binutils, redhat-rpm-config, hmaccalc, python2-devel
|
|
BuildRequires: net-tools, hostname, bc, bison, flex, elfutils-devel
|
|
%if %{with_sparse}
|
|
BuildRequires: sparse
|
|
@@ -357,6 +363,7 @@ BuildRequires: xmlto
|
|
%if %{with_perf} || %{with_tools}
|
|
BuildRequires: asciidoc
|
|
%endif
|
|
+BuildRequires: kernel-headers
|
|
|
|
Source0: linux-%{rpmversion}-%{pkgrelease}.tar.xz
|
|
|
|
@@ -417,6 +424,12 @@ Source301: kernel-kabi-dw-%{rpmversion}-%{distro_build}.tar.bz2
|
|
Source2000: cpupower.service
|
|
Source2001: cpupower.config
|
|
|
|
+# Sources for stx
|
|
+Source3000: centos.cer
|
|
+
|
|
+#Stx config
|
|
+Source30000: kernel-rt-4.18.0-x86_64.config.tis_extra
|
|
+
|
|
## Patches needed for building this package
|
|
|
|
# END OF PATCH DEFINITIONS
|
|
@@ -915,6 +928,7 @@ ApplyOptionalPatch()
|
|
fi
|
|
}
|
|
|
|
+
|
|
%setup -q -n %{name}-%{rpmversion}-%{pkgrelease} -c
|
|
mv linux-%{rpmversion}-%{pkgrelease} linux-%{KVERREL}
|
|
|
|
@@ -938,20 +952,6 @@ mv COPYING COPYING-%{version}
|
|
# This Prevents scripts/setlocalversion from mucking with our version numbers.
|
|
touch .scmversion
|
|
|
|
-# Do not use "ambiguous" python shebangs. RHEL 8 now has a new script
|
|
-# (/usr/lib/rpm/redhat/brp-mangle-shebangs), which forces us to specify a
|
|
-# "non-ambiguous" python shebang for scripts we ship in buildroot. This
|
|
-# script throws an error like below:
|
|
-# *** ERROR: ambiguous python shebang in /usr/bin/kvm_stat: #!/usr/bin/python. Change it to python3 (or python2) explicitly.
|
|
-# We patch all sources below for which we got a report/error.
|
|
-pathfix.py -i %{__python3} -p -n \
|
|
- tools/kvm/kvm_stat/kvm_stat \
|
|
- scripts/show_delta \
|
|
- scripts/diffconfig \
|
|
- scripts/bloat-o-meter \
|
|
- tools/perf/tests/attr.py \
|
|
- tools/perf/scripts/python/stat-cpi.py \
|
|
- tools/perf/scripts/python/sched-migration.py
|
|
%define make make %{?cross_opts} HOSTCFLAGS="%{?build_hostcflags}" HOSTLDFLAGS="%{?build_hostldflags}"
|
|
|
|
# only deal with configs if we are going to build for the arch
|
|
@@ -965,6 +965,9 @@ cd configs
|
|
|
|
# Drop some necessary files from the source dir into the buildroot
|
|
cp $RPM_SOURCE_DIR/kernel-*.config .
|
|
+# Copy stx config
|
|
+cp $RPM_SOURCE_DIR/kernel-rt-%{version}-*.config.tis_extra .
|
|
+
|
|
cp %{SOURCE41} .
|
|
VERSION=%{version} ./generate_all_configs.sh %{name}
|
|
|
|
@@ -984,8 +987,20 @@ do
|
|
done
|
|
%endif
|
|
|
|
+# Handle StarlingX Cloud customizations. Use -n to match oldnoconfig below. We want this before
|
|
+# the make line below so that the one below removes any dependencies of ones that we
|
|
+# turn off here. We also want it before "make listnewconfig" so that we can set the
|
|
+# config option for new configs introduced in the StarlingX Cloud patches.
|
|
+for i in *.config
|
|
+do
|
|
+ if [ -f ${i}.tis_extra ]; then
|
|
+ ../scripts/kconfig/merge_config.sh -m -n ${i} ${i}.tis_extra
|
|
+ mv .config ${i}
|
|
+ fi
|
|
+done
|
|
+
|
|
cp %{SOURCE42} .
|
|
-./process_configs.sh -w %{name} %{rpmversion}
|
|
+./process_configs.sh -w -c %{name} %{rpmversion}
|
|
|
|
# end of kernel config
|
|
%endif
|
|
@@ -1092,7 +1107,7 @@ BuildKernel() {
|
|
fi
|
|
%if %{signkernel}
|
|
# Sign the image if we're using EFI
|
|
- %pesign -s -i $KernelImage -o vmlinuz.signed -a %{SOURCE13} -c %{SOURCE14} -n %{pesign_name}
|
|
+ %pesign -s -i $KernelImage -o vmlinuz.signed -a %{SOURCE3000} -c %{SOURCE3000} -n %{pesign_name}
|
|
if [ ! -s vmlinuz.signed ]; then
|
|
echo "pesigning failed"
|
|
exit 1
|
|
@@ -1439,6 +1454,12 @@ BuildKernel() {
|
|
# Save the signing keys so we can sign the modules in __modsign_install_post
|
|
cp certs/signing_key.pem certs/signing_key.pem.sign${Flav}
|
|
cp certs/signing_key.x509 certs/signing_key.x509.sign${Flav}
|
|
+ # STX: Copy these keys as part of the devel package
|
|
+ # The Module signing keys are to ensure that only Out-of-tree
|
|
+ # built against the StarlingX Kernel get signed and loaded sans warnings
|
|
+ cp certs/signing_key.pem ${RPM_BUILD_ROOT}/lib/modules/${KernelVer}/build/
|
|
+ chmod 755 ${RPM_BUILD_ROOT}/lib/modules/${KernelVer}/build/signing_key.pem
|
|
+ cp certs/signing_key.x509 ${RPM_BUILD_ROOT}/lib/modules/${KernelVer}/build/
|
|
fi
|
|
%endif
|
|
|
|
@@ -1991,7 +2012,7 @@ fi
|
|
%endif # with_perf
|
|
|
|
%if %{with_tools}
|
|
-%files -n kernel-tools
|
|
+%files -n %{name}-tools
|
|
%defattr(-,root,root)
|
|
%ifarch %{cpupowerarchs}
|
|
%files -n %{name}-tools -f cpupower.lang
|
|
@@ -2087,26 +2108,24 @@ fi
|
|
%if %{with_realtime}\
|
|
%exclude /lib/modules/%{KVERREL}%{?3:+%{3}}/kernel/arch/x86/kvm\
|
|
%exclude /lib/modules/%{KVERREL}%{?3:+%{3}}/kernel/drivers/gpu/drm/i915/gvt\
|
|
-%exclude /lib/modules/%{KVERREL}%{?3:+%{3}}/modules.kvm\
|
|
-%exclude /lib/modules/%{KVERREL}%{?3:+%{3}}/kernel/drivers/ptp/ptp_kvm*\
|
|
%endif\
|
|
%{!?_licensedir:%global license %%doc}\
|
|
%license linux-%{KVERREL}/COPYING-%{version}\
|
|
/lib/modules/%{KVERREL}%{?3:+%{3}}/%{?-k:%{-k*}}%{!?-k:vmlinuz}\
|
|
-%ghost /%{image_install_path}/%{?-k:%{-k*}}%{!?-k:vmlinuz}-%{KVERREL}%{?3:+%{3}}\
|
|
+/%{image_install_path}/%{?-k:%{-k*}}%{!?-k:vmlinuz}-%{KVERREL}%{?3:+%{3}}\
|
|
/lib/modules/%{KVERREL}%{?3:+%{3}}/.vmlinuz.hmac \
|
|
-%ghost /%{image_install_path}/.vmlinuz-%{KVERREL}%{?3:+%{3}}.hmac \
|
|
+/%{image_install_path}/.vmlinuz-%{KVERREL}%{?3:+%{3}}.hmac \
|
|
%ifarch aarch64\
|
|
/lib/modules/%{KVERREL}%{?3:+%{3}}/dtb \
|
|
-%ghost /%{image_install_path}/dtb-%{KVERREL}%{?3:+%{3}} \
|
|
+/%{image_install_path}/dtb-%{KVERREL}%{?3:+%{3}} \
|
|
%endif\
|
|
%attr(600,root,root) /lib/modules/%{KVERREL}%{?3:+%{3}}/System.map\
|
|
-%ghost /boot/System.map-%{KVERREL}%{?3:+%{3}}\
|
|
+/boot/System.map-%{KVERREL}%{?3:+%{3}}\
|
|
/lib/modules/%{KVERREL}%{?3:+%{3}}/symvers.gz\
|
|
/lib/modules/%{KVERREL}%{?3:+%{3}}/config\
|
|
-%ghost /boot/symvers-%{KVERREL}%{?3:+%{3}}.gz\
|
|
-%ghost /boot/config-%{KVERREL}%{?3:+%{3}}\
|
|
-%ghost /boot/initramfs-%{KVERREL}%{?3:+%{3}}.img\
|
|
+/boot/symvers-%{KVERREL}%{?3:+%{3}}.gz\
|
|
+/boot/config-%{KVERREL}%{?3:+%{3}}\
|
|
+/boot/initramfs-%{KVERREL}%{?3:+%{3}}.img\
|
|
%dir /lib/modules\
|
|
%dir /lib/modules/%{KVERREL}%{?3:+%{3}}\
|
|
%dir /lib/modules/%{KVERREL}%{?3:+%{3}}/kernel\
|
|
@@ -2127,7 +2146,6 @@ fi
|
|
%exclude /lib/modules/%{KVERREL}%{?3:+%{3}}/kernel/arch/x86/kvm\
|
|
%exclude /lib/modules/%{KVERREL}%{?3:+%{3}}/kernel/drivers/gpu/drm/i915/gvt\
|
|
%exclude /lib/modules/%{KVERREL}%{?3:+%{3}}/modules.kvm\
|
|
-%exclude /lib/modules/%{KVERREL}%{?3:+%{3}}/kernel/drivers/ptp/ptp_kvm*\
|
|
%endif\
|
|
%{expand:%%files %{?3:%{3}-}devel}\
|
|
%defattr(-,root,root)\
|
|
@@ -2157,19 +2175,20 @@ fi
|
|
/lib/modules/%{KVERREL}%{?3:+%{3}}/modules.kvm\
|
|
/lib/modules/%{KVERREL}%{?3:+%{3}}/kernel/arch/x86/kvm\
|
|
/lib/modules/%{KVERREL}%{?3:+%{3}}/kernel/drivers/gpu/drm/i915/gvt/kvmgt.ko*\
|
|
-/lib/modules/%{KVERREL}%{?3:+%{3}}/kernel/drivers/ptp/ptp_kvm.ko*\
|
|
%if %{with_debuginfo}\
|
|
%{expand:%%files %{?3:%{3}-}kvm-debuginfo}\
|
|
%dir %{debuginfodir}/lib/modules/%{KVERREL}%{?3:+%{3}}/kernel/arch/x86/kvm\
|
|
%{debuginfodir}/lib/modules/%{KVERREL}%{?3:+%{3}}/kernel/arch/x86/kvm\
|
|
%{debuginfodir}/lib/modules/%{KVERREL}%{?3:+%{3}}/kernel/drivers/gpu/drm/i915/gvt\
|
|
-%{debuginfodir}/lib/modules/%{KVERREL}%{?3:+%{3}}/kernel/drivers/ptp/ptp_kvm*\
|
|
%endif\
|
|
%endif\
|
|
%{nil}
|
|
|
|
%kernel_variant_files %{with_vdso_install} %{with_up}
|
|
+# STX: disable debug build
|
|
+%if %{with_debug}
|
|
%kernel_variant_files %{with_vdso_install} %{with_debug} debug
|
|
+%endif
|
|
%if %{with_zfcpdump}
|
|
%kernel_variant_files %{with_vdso_install} %{with_zfcpdump} zfcpdump
|
|
%endif
|
|
--
|
|
1.8.3.1
|
|
|