Initial adaptation to i686

Changes allow for a working i686 build
This commit is contained in:
Skip Grube 2024-10-15 12:00:49 -04:00
parent 7a3275bae7
commit 076198c9f6
2 changed files with 9942 additions and 17 deletions

9912
SOURCES/config-6.1.112-i686 Normal file

File diff suppressed because it is too large Load Diff

View File

@ -38,7 +38,7 @@
%endif %endif
# Set pkg_release. # Set pkg_release.
%global pkg_release 1%{?buildid}%{?dist} %global pkg_release 2%{?buildid}%{?dist}
# Architectures upon which we can sign the kernel # Architectures upon which we can sign the kernel
# for secure boot authentication. # for secure boot authentication.
@ -124,6 +124,15 @@
%define with_vdso_install 0 %define with_vdso_install 0
%endif %endif
%ifarch i686
%define with_doc 0
%define with_bpftool 0
%define bldarch x86
%define hdrarch x86
%define make_target bzImage
%define kernel_image arch/x86/boot/bzImage
%endif
%ifarch x86_64 || aarch64 %ifarch x86_64 || aarch64
%define with_doc 0 %define with_doc 0
%endif %endif
@ -164,7 +173,7 @@ License: GPLv2 and Redistributable, no modification permitted.
URL: https://www.kernel.org/ URL: https://www.kernel.org/
Version: %{pkg_version} Version: %{pkg_version}
Release: %{pkg_release} Release: %{pkg_release}
ExclusiveArch: x86_64 aarch64 noarch ExclusiveArch: x86_64 aarch64 noarch i686
ExclusiveOS: Linux ExclusiveOS: Linux
Provides: kernel = %{version}-%{release} Provides: kernel = %{version}-%{release}
Provides: installonlypkg(kernel) Provides: installonlypkg(kernel)
@ -227,6 +236,7 @@ Source0: https://www.kernel.org/pub/linux/kernel/v6.x/linux-%{LKAver}.tar.xz
Source2: config-%{version}-x86_64 Source2: config-%{version}-x86_64
Source4: config-%{version}-aarch64 Source4: config-%{version}-aarch64
Source5: config-%{version}-i686
Source20: mod-denylist.sh Source20: mod-denylist.sh
Source21: mod-sign.sh Source21: mod-sign.sh
@ -244,11 +254,7 @@ Source2000: cpupower.service
Source2001: cpupower.config Source2001: cpupower.config
Source2002: kvm_stat.logrotate Source2002: kvm_stat.logrotate
# Do not package the source tarball.
# To build .src.rpm, run with '--with src'
%if %{?_with_src:0}%{!?_with_src:1}
NoSource: 0
%endif
%if %{signkernel} %if %{signkernel}
%define secureboot_ca_0 %{_datadir}/pki/sb-certs/secureboot-ca-%{_arch}.cer %define secureboot_ca_0 %{_datadir}/pki/sb-certs/secureboot-ca-%{_arch}.cer
@ -591,13 +597,14 @@ mv COPYING COPYING-%{version}-%{release}
cp -a %{SOURCE2} . cp -a %{SOURCE2} .
cp -a %{SOURCE4} . cp -a %{SOURCE4} .
cp -a %{SOURCE5} .
# Set the EXTRAVERSION string in the top level Makefile. # Set the EXTRAVERSION string in the top level Makefile.
sed -i "s@^EXTRAVERSION.*@EXTRAVERSION = -%{release}.%{_target_cpu}@" Makefile sed -i "s@^EXTRAVERSION.*@EXTRAVERSION = -%{release}.%{_target_cpu}@" Makefile
%ifarch x86_64 || aarch64 %ifarch x86_64 || aarch64 || i686
cp config-%{version}-%{_target_cpu} .config cp config-%{version}-%{_target_cpu} .config
%{__make} -s ARCH=%{bldarch} listnewconfig | grep -E '^CONFIG_' > newoptions-el9-%{_target_cpu}.txt || true %{__make} ARCH=%{bldarch} listnewconfig | grep -E '^CONFIG_' > newoptions-el9-%{_target_cpu}.txt || true
if [ -s newoptions-el9-%{_target_cpu}.txt ]; then if [ -s newoptions-el9-%{_target_cpu}.txt ]; then
cat newoptions-el9-%{_target_cpu}.txt cat newoptions-el9-%{_target_cpu}.txt
exit 1 exit 1
@ -631,7 +638,7 @@ popd > /dev/null
%build %build
pushd linux-%{KVERREL} > /dev/null pushd linux-%{KVERREL} > /dev/null
%ifarch x86_64 || aarch64 %ifarch x86_64 || aarch64 || i686
cp config-%{version}-%{_target_cpu} .config cp config-%{version}-%{_target_cpu} .config
%{__make} -s ARCH=%{bldarch} oldconfig %{__make} -s ARCH=%{bldarch} oldconfig
@ -750,7 +757,7 @@ pushd linux-%{KVERREL} > /dev/null
rm -fr $RPM_BUILD_ROOT rm -fr $RPM_BUILD_ROOT
%ifarch x86_64 || aarch64 %ifarch x86_64 || aarch64 || i686
mkdir -p $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT
%if %{with_std} %if %{with_std}
@ -935,7 +942,7 @@ cp -a --parents arch/arm/include/asm/opcodes.h $RPM_BUILD_ROOT/lib/modules/%{KVE
cp -a include $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build/include cp -a include $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build/include
%ifarch x86_64 %ifarch x86_64 || i686
# Files required for 'make prepare' to succeed with kernel-lt-devel. # Files required for 'make prepare' to succeed with kernel-lt-devel.
cp -a --parents arch/x86/entry/syscalls/syscall_32.tbl $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build/ cp -a --parents arch/x86/entry/syscalls/syscall_32.tbl $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build/
cp -a --parents arch/x86/entry/syscalls/syscall_64.tbl $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build/ cp -a --parents arch/x86/entry/syscalls/syscall_64.tbl $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build/
@ -957,10 +964,13 @@ cp -a --parents scripts/syscallhdr.sh $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/bui
cp -a --parents tools/arch/x86/include/asm $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build cp -a --parents tools/arch/x86/include/asm $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build
cp -a --parents tools/arch/x86/include/uapi/asm $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build cp -a --parents tools/arch/x86/include/uapi/asm $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build
cp -a --parents tools/objtool/arch/x86/lib $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build #cp -a --parents tools/objtool/arch/x86/lib $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build
cp -a --parents tools/arch/x86/lib/ $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build cp -a --parents tools/arch/x86/lib/ $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build
cp -a --parents tools/arch/x86/tools/gen-insn-attr-x86.awk $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build cp -a --parents tools/arch/x86/tools/gen-insn-attr-x86.awk $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build
%ifnarch i686
cp -a --parents tools/objtool/arch/x86/ $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build cp -a --parents tools/objtool/arch/x86/ $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build
cp -a --parents tools/objtool/arch/x86/lib $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build
%endif
%endif %endif
# Clean up the intermediate tools files. # Clean up the intermediate tools files.
@ -1173,7 +1183,7 @@ mkdir -p $RPM_BUILD_ROOT%{_unitdir} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
install -m644 %{SOURCE2000} $RPM_BUILD_ROOT%{_unitdir}/cpupower.service install -m644 %{SOURCE2000} $RPM_BUILD_ROOT%{_unitdir}/cpupower.service
install -m644 %{SOURCE2001} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/cpupower install -m644 %{SOURCE2001} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/cpupower
%ifarch x86_64 %ifarch x86_64 || i686
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8 mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8
pushd tools/power/x86/x86_energy_perf_policy > /dev/null pushd tools/power/x86/x86_energy_perf_policy > /dev/null
%{__make} -s %{?_smp_mflags} DESTDIR=$RPM_BUILD_ROOT install %{__make} -s %{?_smp_mflags} DESTDIR=$RPM_BUILD_ROOT install
@ -1323,7 +1333,7 @@ fi\
%{expand:%%kernel_lt_variant_posttrans %{?-v*}}\ %{expand:%%kernel_lt_variant_posttrans %{?-v*}}\
%{expand:%%post %{?-v*:%{-v*}-}core}\ %{expand:%%post %{?-v*:%{-v*}-}core}\
%{-r:\ %{-r:\
if [ `uname -i` == "x86_64" ] &&\ if ([ `uname -i` == "x86_64" ] || [ `uname -i` == "i686" ]) &&\
[ -f /etc/sysconfig/kernel ]; then\ [ -f /etc/sysconfig/kernel ]; then\
/bin/sed -r -i -e 's/^DEFAULTKERNEL=%{-r*}$/DEFAULTKERNEL=%{name}%{?-v:-%{-v*}}/' /etc/sysconfig/kernel || exit $?\ /bin/sed -r -i -e 's/^DEFAULTKERNEL=%{-r*}$/DEFAULTKERNEL=%{name}%{?-v:-%{-v*}}/' /etc/sysconfig/kernel || exit $?\
fi}\ fi}\
@ -1393,7 +1403,7 @@ fi
%{_unitdir}/cpupower.service %{_unitdir}/cpupower.service
%{_mandir}/man[1-8]/cpupower* %{_mandir}/man[1-8]/cpupower*
%config(noreplace) %{_sysconfdir}/sysconfig/cpupower %config(noreplace) %{_sysconfdir}/sysconfig/cpupower
%ifarch x86_64 %ifarch x86_64 || i686
%{_bindir}/x86_energy_perf_policy %{_bindir}/x86_energy_perf_policy
%{_mandir}/man8/x86_energy_perf_policy* %{_mandir}/man8/x86_energy_perf_policy*
%{_bindir}/turbostat %{_bindir}/turbostat
@ -1442,7 +1452,7 @@ fi
%endif %endif
# Empty meta-package. # Empty meta-package.
%ifarch x86_64 || aarch64 %ifarch x86_64 || aarch64 || i686
%files %files
%endif %endif
@ -1500,6 +1510,9 @@ fi
%kernel_lt_variant_files %{_use_vdso} %{with_std} %kernel_lt_variant_files %{_use_vdso} %{with_std}
%changelog %changelog
* Mon Oct 14 2024 Skip Grube <skip@rockylinux.org> - 6.1.112-2
- Added x86 (i686) target build support
* Mon Sep 30 2024 Akemi Yagi <toracat@elrepo.org> - 6.1.112 * Mon Sep 30 2024 Akemi Yagi <toracat@elrepo.org> - 6.1.112
- Updated with the 6.1.112 source tarball. - Updated with the 6.1.112 source tarball.
- Enable DPAA - Enable DPAA