do a "defconfig + elconfig" to get a .config

- Copy rhel/diff.config to config-aarch64.
- Enable building the kernel config in such a way that the defconfig's
  options are _used_ but certain RHEL-specific options are overridden.
- The build salt got carried over from the RHEL diff.config, remove that.
- Unset CONFIG_DEBUG_INFO_REDUCED so that CONFIG_DEBUG_INFO_BTF can be
  enabled. Otherwise the build fails at the step where the bpftool
  package gets built.
This commit is contained in:
Pratham Patel 2023-11-19 09:13:36 +05:30
parent ff349cb793
commit 30d3add7d3
No known key found for this signature in database
2 changed files with 154 additions and 9040 deletions

File diff suppressed because it is too large Load Diff

View File

@ -128,7 +128,8 @@
%define bldarch x86_64
%define hdrarch x86_64
%define make_target bzImage
%define kernel_image arch/x86/boot/bzImage
%define kernel_image arch/%{asmarch}/boot/%{make_target}
%define defconfig arch/%{asmarch}/configs/%{bldarch}_defconfig
%endif
%ifarch aarch64
@ -136,9 +137,12 @@
%define bldarch arm64
%define hdrarch arm64
%define make_target Image.gz
%define kernel_image arch/arm64/boot/Image.gz
%define kernel_image arch/%{asmarch}/boot/%{make_target}
%define defconfig arch/%{asmarch}/configs/defconfig
%endif
%define elconfig arch/%{asmarch}/configs/el.config
%if %{with_vdso_install}
%define use_vdso 1
%define _use_vdso 1
@ -555,19 +559,19 @@ pathfix.py -i "%{__python3} %{py3_shbang_opts}" -n -p \
mv COPYING COPYING-%{version}-%{release}
cp -a %{SOURCE2} .
cp -a %{SOURCE4} .
cp %{_sourcedir}/config-$(uname -m) %{elconfig}
# Set the EXTRAVERSION string in the top level Makefile.
sed -i "s@^EXTRAVERSION.*@EXTRAVERSION = -%{release}.%{_target_cpu}@" Makefile
%ifarch x86_64 || aarch64
cp config-%{_target_cpu} .config
./scripts/kconfig/merge_config.sh %{defconfig} %{elconfig}
%{__make} ARCH=%{bldarch} listnewconfig | grep -E '^CONFIG_' > newoptions-el9-%{_target_cpu}.txt || true
if [ -s newoptions-el9-%{_target_cpu}.txt ]; then
cat newoptions-el9-%{_target_cpu}.txt
fi
rm -f newoptions-el9-%{_target_cpu}.txt
rm -vf .config*
%endif
# Add DUP and kpatch certificates to system trusted keys for RHEL.
@ -575,17 +579,17 @@ rm -f newoptions-el9-%{_target_cpu}.txt
openssl x509 -inform der -in %{SOURCE100} -out rheldup3.pem
openssl x509 -inform der -in %{SOURCE101} -out rhelkpatch1.pem
cat rheldup3.pem rhelkpatch1.pem > certs/rhel.pem
for i in config-*; do
for i in %{elconfig}; do
sed -i 's@CONFIG_SYSTEM_TRUSTED_KEYS="*"@CONFIG_SYSTEM_TRUSTED_KEYS="certs/rhel.pem"@' $i
done
%else
for i in config-*; do
for i in %{elconfig}; do
sed -i 's@CONFIG_SYSTEM_TRUSTED_KEYS="*"@CONFIG_SYSTEM_TRUSTED_KEYS=""@' $i
done
%endif
# Adjust the FIPS module name for RHEL9.
for i in config-*; do
for i in %{elconfig}; do
sed -i 's@CONFIG_CRYPTO_FIPS_NAME=.*@CONFIG_CRYPTO_FIPS_NAME="Red Hat Enterprise Linux 9 - Kernel Cryptographic API"@' $i
done
@ -597,9 +601,7 @@ popd > /dev/null
pushd linux-%{KVERREL} > /dev/null
%ifarch x86_64 || aarch64
cp config-%{_target_cpu} .config
%{__make} ARCH=%{bldarch} oldconfig
./scripts/kconfig/merge_config.sh %{defconfig} %{elconfig}
%if %{signkernel} || %{signmodules}
cp %{SOURCE23} certs/