mirror of
https://abf.rosa.ru/djam/kernel-5.15.git
synced 2025-02-24 02:52:55 +00:00
add aarch64 support
This commit is contained in:
parent
99581a128b
commit
59b214f027
2 changed files with 10567 additions and 31 deletions
10510
kernel-arm64.config
Normal file
10510
kernel-arm64.config
Normal file
File diff suppressed because it is too large
Load diff
88
kernel.spec
88
kernel.spec
|
@ -40,13 +40,19 @@
|
||||||
%define kverrel %{kversion}-%{fullrpmrel}
|
%define kverrel %{kversion}-%{fullrpmrel}
|
||||||
%define tar_ver %{kernelversion}.%{patchlevel}
|
%define tar_ver %{kernelversion}.%{patchlevel}
|
||||||
|
|
||||||
|
# i586
|
||||||
%ifarch %{ix86}
|
%ifarch %{ix86}
|
||||||
# Use a standard suffix for 32-bit x86
|
%define arch_suffix i686
|
||||||
%define arch_suffix i586
|
%endif
|
||||||
%else
|
|
||||||
|
%ifarch %{x86_64}
|
||||||
%define arch_suffix %{_arch}
|
%define arch_suffix %{_arch}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%ifarch aarch64
|
||||||
|
%define arch_suffix arm64
|
||||||
|
%endif
|
||||||
|
|
||||||
%define buildrpmrel %{fullrpmrel}%{rpmtag}-%{arch_suffix}
|
%define buildrpmrel %{fullrpmrel}%{rpmtag}-%{arch_suffix}
|
||||||
%define buildrel %{kversion}-%{buildrpmrel}
|
%define buildrel %{kversion}-%{buildrpmrel}
|
||||||
|
|
||||||
|
@ -64,7 +70,11 @@
|
||||||
%bcond_without additional_keys
|
%bcond_without additional_keys
|
||||||
%endif
|
%endif
|
||||||
# User Mode Linux, https://habr.com/ru/company/itsumma/blog/459558/
|
# User Mode Linux, https://habr.com/ru/company/itsumma/blog/459558/
|
||||||
|
%ifarch %{ix86} %{x86_64}
|
||||||
%bcond_without uml
|
%bcond_without uml
|
||||||
|
%else
|
||||||
|
%bcond_with uml
|
||||||
|
%endif
|
||||||
|
|
||||||
# "Nickel" is a special brand for certified distros
|
# "Nickel" is a special brand for certified distros
|
||||||
# gost_sign will probably be enabled outside of Nickel later,
|
# gost_sign will probably be enabled outside of Nickel later,
|
||||||
|
@ -181,9 +191,9 @@
|
||||||
|
|
||||||
# http://nickdesaulniers.github.io/blog/2018/06/02/speeding-up-linux-kernel-builds-with-ccache/
|
# http://nickdesaulniers.github.io/blog/2018/06/02/speeding-up-linux-kernel-builds-with-ccache/
|
||||||
%if %{with ccache}
|
%if %{with ccache}
|
||||||
%define kmake KBUILD_BUILD_TIMESTAMP='' %make CC='ccache gcc'
|
%define kmake KBUILD_BUILD_TIMESTAMP='' %make CC='ccache gcc' ARCH="%{arch_suffix}"
|
||||||
%else
|
%else
|
||||||
%define kmake %make CC='gcc'
|
%define kmake %make CC='gcc' ARCH="%{arch_suffix}"
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# there are places where parallel make don't work
|
# there are places where parallel make don't work
|
||||||
|
@ -345,9 +355,9 @@ BuildRequires: findutils util-linux
|
||||||
|
|
||||||
%if %{with binary_extra_modules}
|
%if %{with binary_extra_modules}
|
||||||
BuildRequires: kernel-source-rtl8821ce
|
BuildRequires: kernel-source-rtl8821ce
|
||||||
BuildRequires: kernel-source-shredder-kernel
|
|
||||||
BuildRequires: kernel-source-tripso
|
BuildRequires: kernel-source-tripso
|
||||||
%ifarch %{ix86} %{x86_64}
|
%ifarch %{ix86} %{x86_64}
|
||||||
|
BuildRequires: kernel-source-shredder-kernel
|
||||||
BuildRequires: kernel-source-virtualbox
|
BuildRequires: kernel-source-virtualbox
|
||||||
# TODO: drop it for kernels >= 5.6
|
# TODO: drop it for kernels >= 5.6
|
||||||
# because all guest modules have been upstreamized
|
# because all guest modules have been upstreamized
|
||||||
|
@ -914,7 +924,6 @@ latest kernel-uml-modules-%{flavour} %{kernelversion}.%{patchlevel}.x
|
||||||
%if %{with binary_extra_modules}
|
%if %{with binary_extra_modules}
|
||||||
|
|
||||||
%ksob_mk_module_pkg -n 8821ce -s net/wireless
|
%ksob_mk_module_pkg -n 8821ce -s net/wireless
|
||||||
%ksob_mk_module_pkg -n shredder-kernel -s extra -r rosa-shredder-user
|
|
||||||
%ksob_mk_module_pkg -n xt_TRIPSO -s net -r tripso
|
%ksob_mk_module_pkg -n xt_TRIPSO -s net -r tripso
|
||||||
|
|
||||||
# virtualbox host
|
# virtualbox host
|
||||||
|
@ -923,6 +932,8 @@ latest kernel-uml-modules-%{flavour} %{kernelversion}.%{patchlevel}.x
|
||||||
%ksob_mk_module_pkg -n vboxnetadp -s misc
|
%ksob_mk_module_pkg -n vboxnetadp -s misc
|
||||||
%ksob_mk_module_pkg -n vboxdrv -s misc
|
%ksob_mk_module_pkg -n vboxdrv -s misc
|
||||||
%ksob_mk_module_pkg -n vboxpci -s misc
|
%ksob_mk_module_pkg -n vboxpci -s misc
|
||||||
|
# shredder
|
||||||
|
%ksob_mk_module_pkg -n shredder-kernel -s extra -r rosa-shredder-user
|
||||||
|
|
||||||
#------------------------------------------------
|
#------------------------------------------------
|
||||||
# a package which will pull all those modules
|
# a package which will pull all those modules
|
||||||
|
@ -963,6 +974,7 @@ Requires: kernel-module-vboxsf-%{flavour}-%{buildrel}
|
||||||
Meta package to pull VirtualBox guest kernel modules for kernel-%{flavour}-%{kernelversion}.%{patchlevel}
|
Meta package to pull VirtualBox guest kernel modules for kernel-%{flavour}-%{kernelversion}.%{patchlevel}
|
||||||
|
|
||||||
%files -n kernel-modules-virtualbox-guest-%{flavour}-%{kernelversion}.%{patchlevel}-latest
|
%files -n kernel-modules-virtualbox-guest-%{flavour}-%{kernelversion}.%{patchlevel}-latest
|
||||||
|
# end ifarch
|
||||||
%endif
|
%endif
|
||||||
# empty
|
# empty
|
||||||
#------------------------------------------------
|
#------------------------------------------------
|
||||||
|
@ -1128,7 +1140,7 @@ CONFIG_DIR=arch/%{arch_type}/configs
|
||||||
mkdir -p "${CONFIG_DIR}"
|
mkdir -p "${CONFIG_DIR}"
|
||||||
|
|
||||||
cfg_file=arch/%{arch_type}/configs/%{arch_suffix}_defconfig-%{flavour}
|
cfg_file=arch/%{arch_type}/configs/%{arch_suffix}_defconfig-%{flavour}
|
||||||
make ARCH=%{_arch} oldconfig && \
|
make ARCH=%{arch_suffix} oldconfig && \
|
||||||
mv .config ${cfg_file}
|
mv .config ${cfg_file}
|
||||||
|
|
||||||
# Looks like 'make oldconfig' removes '# CONFIG_64BIT is not set' for some
|
# Looks like 'make oldconfig' removes '# CONFIG_64BIT is not set' for some
|
||||||
|
@ -1318,7 +1330,13 @@ LC_ALL=C sed -ri "s/^EXTRAVERSION.*/EXTRAVERSION = -%{flavour}-%{buildrpmrel}/"
|
||||||
# build the kernel
|
# build the kernel
|
||||||
echo "Building kernel %{kver_full}"
|
echo "Building kernel %{kver_full}"
|
||||||
|
|
||||||
%kmake V=1 -s all
|
TARGETS="all"
|
||||||
|
# need to install dtbs to proper boot arm64 devices
|
||||||
|
%ifarch aarch64
|
||||||
|
TARGETS="$TARGETS dtbs"
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%kmake V=1 -s all $TARGETS
|
||||||
|
|
||||||
# Install modules
|
# Install modules
|
||||||
mkdir -p %{temp_modules}/%{kver_full}
|
mkdir -p %{temp_modules}/%{kver_full}
|
||||||
|
@ -1338,14 +1356,6 @@ cp 8821ce.ko %{temp_modules}/%{kver_full}/kernel/net/wireless/8821ce.ko
|
||||||
popd
|
popd
|
||||||
rm -fr kernel-source-rtl8821ce
|
rm -fr kernel-source-rtl8821ce
|
||||||
|
|
||||||
cp -r "$(rpm -q --qf '/usr/src/shredder-kernel-%%{VERSION}-%%{RELEASE}' kernel-source-shredder-kernel)" kernel-source-shredder-kernel
|
|
||||||
pushd kernel-source-shredder-kernel
|
|
||||||
%kmake KERNEL_PATH=%{src_dir}
|
|
||||||
mkdir -p %{temp_modules}/%{kver_full}/kernel/extra/
|
|
||||||
cp shredder-kernel.ko %{temp_modules}/%{kver_full}/kernel/extra/
|
|
||||||
popd
|
|
||||||
rm -fr kernel-source-shredder-kernel
|
|
||||||
|
|
||||||
cp -r "$(rpm -q --qf '/usr/src/tripso-%%{VERSION}-%%{RELEASE}' kernel-source-tripso)" kernel-source-tripso
|
cp -r "$(rpm -q --qf '/usr/src/tripso-%%{VERSION}-%%{RELEASE}' kernel-source-tripso)" kernel-source-tripso
|
||||||
pushd kernel-source-tripso
|
pushd kernel-source-tripso
|
||||||
%kmake KDIR=%{src_dir}
|
%kmake KDIR=%{src_dir}
|
||||||
|
@ -1354,8 +1364,16 @@ cp xt_TRIPSO.ko %{temp_modules}/%{kver_full}/kernel/net/
|
||||||
popd
|
popd
|
||||||
rm -fr kernel-source-tripso
|
rm -fr kernel-source-tripso
|
||||||
|
|
||||||
# build commands for virtualbox are based on the ones from the virtualbox package
|
|
||||||
%ifarch %{ix86} %{x86_64}
|
%ifarch %{ix86} %{x86_64}
|
||||||
|
cp -r "$(rpm -q --qf '/usr/src/shredder-kernel-%%{VERSION}-%%{RELEASE}' kernel-source-shredder-kernel)" kernel-source-shredder-kernel
|
||||||
|
pushd kernel-source-shredder-kernel
|
||||||
|
%kmake KERNEL_PATH=%{src_dir}
|
||||||
|
mkdir -p %{temp_modules}/%{kver_full}/kernel/extra/
|
||||||
|
cp shredder-kernel.ko %{temp_modules}/%{kver_full}/kernel/extra/
|
||||||
|
popd
|
||||||
|
rm -fr kernel-source-shredder-kernel
|
||||||
|
|
||||||
|
# build commands for virtualbox are based on the ones from the virtualbox package
|
||||||
cp -r "$(rpm -q --qf '/usr/src/vboxadditions-%%{VERSION}-%%{RELEASE}' kernel-source-virtualbox-vboxadditions)" kernel-source-virtualbox-vboxadditions
|
cp -r "$(rpm -q --qf '/usr/src/vboxadditions-%%{VERSION}-%%{RELEASE}' kernel-source-virtualbox-vboxadditions)" kernel-source-virtualbox-vboxadditions
|
||||||
mkdir -p %{temp_modules}/%{kver_full}/kernel/misc/
|
mkdir -p %{temp_modules}/%{kver_full}/kernel/misc/
|
||||||
pushd kernel-source-virtualbox-vboxadditions
|
pushd kernel-source-virtualbox-vboxadditions
|
||||||
|
@ -1388,6 +1406,7 @@ do
|
||||||
cp -v "${i}/${i}.ko" %{temp_modules}/%{kver_full}/kernel/misc/
|
cp -v "${i}/${i}.ko" %{temp_modules}/%{kver_full}/kernel/misc/
|
||||||
done
|
done
|
||||||
popd
|
popd
|
||||||
|
# end ifarch ix86
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with nickel}
|
%if %{with nickel}
|
||||||
|
@ -1438,7 +1457,11 @@ install -m 644 System.map %{temp_boot}/System.map-%{kver_full}
|
||||||
install -m 644 .config %{temp_boot}/config-%{kver_full}
|
install -m 644 .config %{temp_boot}/config-%{kver_full}
|
||||||
xz -c Module.symvers > %{temp_boot}/symvers-%{kver_full}.xz
|
xz -c Module.symvers > %{temp_boot}/symvers-%{kver_full}.xz
|
||||||
|
|
||||||
cp -f arch/%{arch_type}/boot/bzImage %{temp_boot}/vmlinuz-%{kver_full}
|
%ifarch aarch64
|
||||||
|
cp -f arch/arm64/boot/Image.gz %{temp_boot}/vmlinuz-%{kver_full}
|
||||||
|
%else
|
||||||
|
cp -f arch/%{arch_type}/boot/bzImage %{temp_boot}/vmlinuz-%{kver_full}
|
||||||
|
%endif
|
||||||
|
|
||||||
# headers
|
# headers
|
||||||
%if %{build_headers}
|
%if %{build_headers}
|
||||||
|
@ -1463,11 +1486,18 @@ cp -fR kernel/bounds.c %{temp_devel_root}/kernel
|
||||||
cp -fR kernel/time/timeconst.bc %{temp_devel_root}/kernel/time
|
cp -fR kernel/time/timeconst.bc %{temp_devel_root}/kernel/time
|
||||||
cp -fR tools %{temp_devel_root}/
|
cp -fR tools %{temp_devel_root}/
|
||||||
cp -fR arch/%{arch_type}/kernel/asm-offsets.{c,s} %{temp_devel_root}/arch/%{arch_type}/kernel/
|
cp -fR arch/%{arch_type}/kernel/asm-offsets.{c,s} %{temp_devel_root}/arch/%{arch_type}/kernel/
|
||||||
|
%ifarch %{ix86} %{x86_64}
|
||||||
cp -fR arch/%{arch_type}/kernel/asm-offsets_{32,64}.c %{temp_devel_root}/arch/%{arch_type}/kernel/
|
cp -fR arch/%{arch_type}/kernel/asm-offsets_{32,64}.c %{temp_devel_root}/arch/%{arch_type}/kernel/
|
||||||
cp -fR arch/%{arch_type}/purgatory/* %{temp_devel_root}/arch/%{arch_type}/purgatory/
|
cp -fR arch/%{arch_type}/purgatory/* %{temp_devel_root}/arch/%{arch_type}/purgatory/
|
||||||
|
# needed for arch/x86/purgatory
|
||||||
|
cp -fR lib/*.h lib/*.c %{temp_devel_root}/lib/
|
||||||
cp -fR arch/%{arch_type}/entry/syscalls/syscall* %{temp_devel_root}/arch/%{arch_type}/entry/syscalls/
|
cp -fR arch/%{arch_type}/entry/syscalls/syscall* %{temp_devel_root}/arch/%{arch_type}/entry/syscalls/
|
||||||
cp -fR arch/%{arch_type}/include %{temp_devel_root}/arch/%{arch_type}/
|
|
||||||
cp -fR arch/%{arch_type}/tools %{temp_devel_root}/arch/%{arch_type}/
|
cp -fR arch/%{arch_type}/tools %{temp_devel_root}/arch/%{arch_type}/
|
||||||
|
# needed for kexec
|
||||||
|
cp -fR arch/%{arch_type}/boot/*.h %{temp_devel_root}/arch/%{arch_type}/boot/
|
||||||
|
cp -fR arch/%{arch_type}/boot/*.c %{temp_devel_root}/arch/%{arch_type}/boot/
|
||||||
|
%endif
|
||||||
|
cp -fR arch/%{arch_type}/include %{temp_devel_root}/arch/%{arch_type}/
|
||||||
cp -fR .config Module.symvers %{temp_devel_root}
|
cp -fR .config Module.symvers %{temp_devel_root}
|
||||||
|
|
||||||
# Needed for truecrypt build (Danny)
|
# Needed for truecrypt build (Danny)
|
||||||
|
@ -1487,29 +1517,23 @@ cp -fR fs/aufs/magic.mk %{temp_devel_root}/fs/aufs
|
||||||
# SELinux needs security/selinux/include
|
# SELinux needs security/selinux/include
|
||||||
cp -fR security/selinux/include %{temp_devel_root}/security/selinux
|
cp -fR security/selinux/include %{temp_devel_root}/security/selinux
|
||||||
|
|
||||||
# needed for kexec
|
|
||||||
cp -fR arch/%{arch_type}/boot/*.h %{temp_devel_root}/arch/%{arch_type}/boot/
|
|
||||||
cp -fR arch/%{arch_type}/boot/*.c %{temp_devel_root}/arch/%{arch_type}/boot/
|
|
||||||
|
|
||||||
# needed for arch/x86/purgatory
|
|
||||||
cp -fR lib/*.h lib/*.c %{temp_devel_root}/lib/
|
|
||||||
|
|
||||||
for i in alpha arc avr32 blackfin c6x cris csky frv h8300 hexagon ia64 m32r m68k m68knommu metag microblaze \
|
for i in alpha arc avr32 blackfin c6x cris csky frv h8300 hexagon ia64 m32r m68k m68knommu metag microblaze \
|
||||||
mips mn10300 nds32 nios2 openrisc parisc powerpc riscv s390 score sh sparc tile unicore32 xtensa; do
|
mips mn10300 nds32 nios2 openrisc parisc powerpc riscv s390 score sh sparc tile unicore32 xtensa; do
|
||||||
rm -rf %{temp_devel_root}/arch/$i
|
rm -rf %{temp_devel_root}/arch/$i
|
||||||
done
|
done
|
||||||
|
|
||||||
|
%ifarch %{ix86} %{x86_64}
|
||||||
rm -rf %{temp_devel_root}/arch/arm*
|
rm -rf %{temp_devel_root}/arch/arm*
|
||||||
rm -rf %{temp_devel_root}/include/kvm/arm*
|
rm -rf %{temp_devel_root}/include/kvm/arm*
|
||||||
rm -rf %{temp_devel_root}/include/soc
|
rm -rf %{temp_devel_root}/include/soc
|
||||||
|
%endif
|
||||||
|
|
||||||
# Clean the scripts tree, and make sure everything is ok (sanity check)
|
# Clean the scripts tree, and make sure everything is ok (sanity check)
|
||||||
# running prepare+scripts (tree was already "prepared" in build)
|
# running prepare+scripts (tree was already "prepared" in build)
|
||||||
pushd %{temp_devel_root}
|
pushd %{temp_devel_root}
|
||||||
%smake V=1 -s prepare
|
%smake V=1 -s clean ARCH=%{arch_type}
|
||||||
%smake V=1 -s scripts
|
|
||||||
%smake V=1 -s clean
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
rm -f %{temp_devel_root}/.config.old
|
rm -f %{temp_devel_root}/.config.old
|
||||||
|
|
||||||
# fix permissions
|
# fix permissions
|
||||||
|
@ -1589,11 +1613,13 @@ cat > $kernel_files <<EOF
|
||||||
%if %{with binary_extra_modules}
|
%if %{with binary_extra_modules}
|
||||||
# 8821ce.ko.debug will not be excluded and will be in the main debug subpackage
|
# 8821ce.ko.debug will not be excluded and will be in the main debug subpackage
|
||||||
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8821ce.ko%{kmod_suffix}
|
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8821ce.ko%{kmod_suffix}
|
||||||
|
%ifarch %{ix86} %{x86_64}
|
||||||
%exclude %{_modulesdir}/%{kver_full}/kernel/extra/shredder-kernel.ko%{kmod_suffix}
|
%exclude %{_modulesdir}/%{kver_full}/kernel/extra/shredder-kernel.ko%{kmod_suffix}
|
||||||
%exclude %{_modulesdir}/%{kver_full}/kernel/net/xt_TRIPSO.ko%{kmod_suffix}
|
|
||||||
# vbox host: vboxnetflt vboxnetadp vboxdrv vboxpci
|
# vbox host: vboxnetflt vboxnetadp vboxdrv vboxpci
|
||||||
# vbox guest: vboxvideo vboxguest vboxsf
|
# vbox guest: vboxvideo vboxguest vboxsf
|
||||||
%exclude %{_modulesdir}/%{kver_full}/kernel/misc/vbox*.ko%{kmod_suffix}
|
%exclude %{_modulesdir}/%{kver_full}/kernel/misc/vbox*.ko%{kmod_suffix}
|
||||||
|
%endif
|
||||||
|
%exclude %{_modulesdir}/%{kver_full}/kernel/net/xt_TRIPSO.ko%{kmod_suffix}
|
||||||
%if %{with nickel}
|
%if %{with nickel}
|
||||||
%exclude %{_modulesdir}/%{kver_full}/kernel/misc/nlkm.ko%{kmod_suffix}
|
%exclude %{_modulesdir}/%{kver_full}/kernel/misc/nlkm.ko%{kmod_suffix}
|
||||||
%exclude %{_modulesdir}/%{kver_full}/kernel/misc/memfreetest.ko%{kmod_suffix}
|
%exclude %{_modulesdir}/%{kver_full}/kernel/misc/memfreetest.ko%{kmod_suffix}
|
||||||
|
|
Loading…
Add table
Reference in a new issue