2011-10-05 07:01:45 +02:00
|
|
|
#
|
2011-10-25 07:02:09 +02:00
|
|
|
# spec file for package kernel-source
|
2011-10-05 07:01:45 +02:00
|
|
|
#
|
2024-01-02 09:37:06 +01:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2011-10-05 07:01:45 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2022-03-17 07:01:51 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2011-10-05 07:01:45 +02:00
|
|
|
#
|
2014-01-31 08:01:42 +01:00
|
|
|
|
2014-02-02 08:01:46 +01:00
|
|
|
|
2024-07-15 09:36:08 +02:00
|
|
|
%define srcversion 6.10
|
2024-08-05 06:39:02 +02:00
|
|
|
%define patchversion 6.10.3
|
|
|
|
%define git_commit ba01e0e99300e32d9451fb54748dbe3f82fe94f9
|
2011-10-05 07:01:45 +02:00
|
|
|
%define variant %{nil}
|
|
|
|
|
|
|
|
%include %_sourcedir/kernel-spec-macros
|
|
|
|
|
2024-03-13 09:29:45 +01:00
|
|
|
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,group-source-files.pl,split-modules,modversions,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols,log.sh,try-disable-staging-driver,compress-vmlinux.sh,mkspec-dtb,check-module-license,klp-symbols,splitflist,mergedep,moddep,modflist,kernel-subpackage-build})
|
2021-10-08 07:19:35 +02:00
|
|
|
|
2011-10-05 07:01:45 +02:00
|
|
|
Name: kernel-source
|
2024-08-05 06:39:02 +02:00
|
|
|
Version: 6.10.3
|
2013-10-03 08:02:42 +02:00
|
|
|
%if 0%{?is_kotd}
|
2024-08-05 06:39:02 +02:00
|
|
|
Release: <RELEASE>.gba01e0e
|
2013-10-03 08:02:42 +02:00
|
|
|
%else
|
2014-11-01 08:04:35 +01:00
|
|
|
Release: 0
|
2013-10-03 08:02:42 +02:00
|
|
|
%endif
|
2022-03-17 07:01:51 +01:00
|
|
|
Summary: The Linux Kernel Sources
|
|
|
|
License: GPL-2.0-only
|
|
|
|
Group: Development/Sources
|
|
|
|
URL: https://www.kernel.org/
|
2011-10-05 07:01:45 +02:00
|
|
|
AutoReqProv: off
|
2022-03-21 12:44:19 +01:00
|
|
|
%if 0%{?suse_version} > 1500 || 0%{?sle_version} > 150300
|
|
|
|
BuildRequires: bash-sh
|
|
|
|
%endif
|
2014-02-02 08:01:46 +01:00
|
|
|
BuildRequires: coreutils
|
2011-10-05 07:01:45 +02:00
|
|
|
BuildRequires: fdupes
|
2014-02-02 08:01:46 +01:00
|
|
|
BuildRequires: sed
|
2024-03-13 09:29:45 +01:00
|
|
|
%if ! 0%{?is_kotd} || ! %{?is_kotd_qa}%{!?is_kotd_qa:0}
|
|
|
|
BuildArch: noarch
|
|
|
|
%else
|
|
|
|
ExclusiveArch: do_not_build
|
|
|
|
%endif
|
|
|
|
Prefix: /usr/src
|
|
|
|
|
|
|
|
%define src_install_dir usr/src/linux-%kernelrelease%variant
|
|
|
|
|
|
|
|
# if undefined use legacy location of before SLE15
|
|
|
|
%if %{undefined _rpmmacrodir}
|
|
|
|
%define _rpmmacrodir /etc/rpm
|
|
|
|
%endif
|
|
|
|
|
2022-10-03 10:42:53 +02:00
|
|
|
Source0: https://www.kernel.org/pub/linux/kernel/v6.x/linux-%srcversion.tar.xz
|
|
|
|
%if "https://www.kernel.org/pub/linux/kernel/v6.x/" != ""
|
|
|
|
Source1: https://www.kernel.org/pub/linux/kernel/v6.x/linux-%srcversion.tar.sign
|
2022-09-02 10:17:13 +02:00
|
|
|
Source2: linux.keyring
|
|
|
|
%endif
|
2011-10-05 07:01:45 +02:00
|
|
|
Source3: kernel-source.rpmlintrc
|
|
|
|
Source14: series.conf
|
|
|
|
Source16: guards
|
|
|
|
Source17: apply-patches
|
2023-06-22 05:56:22 +02:00
|
|
|
Source19: kernel-binary-conflicts
|
|
|
|
Source20: obsolete-kmps
|
2011-10-05 07:01:45 +02:00
|
|
|
Source21: config.conf
|
|
|
|
Source23: supported.conf
|
|
|
|
Source33: check-for-config-changes
|
2011-10-25 07:02:09 +02:00
|
|
|
Source35: group-source-files.pl
|
2015-02-12 08:04:40 +01:00
|
|
|
Source36: README.PATCH-POLICY.SUSE
|
2011-10-05 07:01:45 +02:00
|
|
|
Source37: README.SUSE
|
|
|
|
Source38: README.KSYMS
|
|
|
|
Source40: source-timestamp
|
2016-06-26 16:47:43 +02:00
|
|
|
Source46: split-modules
|
|
|
|
Source47: modversions
|
2011-10-05 07:01:45 +02:00
|
|
|
Source48: macros.kernel-source
|
|
|
|
Source49: kernel-module-subpackage
|
|
|
|
Source50: kabi.pl
|
|
|
|
Source51: mkspec
|
|
|
|
Source52: kernel-source%variant.changes
|
|
|
|
Source53: kernel-source.spec.in
|
|
|
|
Source54: kernel-binary.spec.in
|
|
|
|
Source55: kernel-syms.spec.in
|
|
|
|
Source56: kernel-docs.spec.in
|
2013-05-01 08:12:39 +02:00
|
|
|
Source57: kernel-cert-subpackage
|
2014-04-01 08:03:05 +02:00
|
|
|
Source58: constraints.in
|
2011-10-05 07:01:45 +02:00
|
|
|
Source60: config.sh
|
|
|
|
Source61: compute-PATCHVERSION.sh
|
2013-10-03 08:02:42 +02:00
|
|
|
Source62: old-flavors
|
2011-10-05 07:01:45 +02:00
|
|
|
Source63: arch-symbols
|
|
|
|
Source64: package-descriptions
|
|
|
|
Source65: kernel-spec-macros
|
|
|
|
Source67: log.sh
|
2011-10-25 07:02:09 +02:00
|
|
|
Source68: host-memcpy-hack.h
|
2012-01-06 07:02:55 +01:00
|
|
|
Source69: try-disable-staging-driver
|
2014-04-15 08:02:51 +02:00
|
|
|
Source70: kernel-obs-build.spec.in
|
|
|
|
Source71: kernel-obs-qa.spec.in
|
2014-08-18 08:02:31 +02:00
|
|
|
Source72: compress-vmlinux.sh
|
2016-12-13 08:07:16 +01:00
|
|
|
Source73: dtb.spec.in.in
|
|
|
|
Source74: mkspec-dtb
|
2018-04-04 08:43:11 +02:00
|
|
|
Source75: release-projects
|
|
|
|
Source76: check-module-license
|
2018-04-19 23:07:42 +02:00
|
|
|
Source77: klp-symbols
|
2018-05-24 08:03:09 +02:00
|
|
|
Source78: modules.fips
|
2019-03-19 09:08:50 +01:00
|
|
|
Source79: splitflist
|
|
|
|
Source80: mergedep
|
|
|
|
Source81: moddep
|
|
|
|
Source82: modflist
|
|
|
|
Source83: kernel-subpackage-build
|
|
|
|
Source84: kernel-subpackage-spec
|
|
|
|
Source85: kernel-default-base.spec.txt
|
2024-01-17 08:58:36 +01:00
|
|
|
Source86: old_changelog.txt
|
2011-10-05 07:01:45 +02:00
|
|
|
Source100: config.tar.bz2
|
|
|
|
Source101: config.addon.tar.bz2
|
|
|
|
Source102: patches.arch.tar.bz2
|
|
|
|
Source103: patches.drivers.tar.bz2
|
|
|
|
Source104: patches.fixes.tar.bz2
|
|
|
|
Source105: patches.rpmify.tar.bz2
|
|
|
|
Source106: patches.suse.tar.bz2
|
|
|
|
Source108: patches.addon.tar.bz2
|
|
|
|
Source109: patches.kernel.org.tar.bz2
|
|
|
|
Source110: patches.apparmor.tar.bz2
|
|
|
|
Source111: patches.rt.tar.bz2
|
|
|
|
Source113: patches.kabi.tar.bz2
|
2023-06-22 05:56:22 +02:00
|
|
|
Source114: patches.drm.tar.bz2
|
2011-10-05 07:01:45 +02:00
|
|
|
Source120: kabi.tar.bz2
|
2011-05-21 07:04:56 +02:00
|
|
|
Source121: sysctl.tar.bz2
|
2024-03-13 09:29:45 +01:00
|
|
|
Requires(post): coreutils sed
|
2011-10-05 07:01:45 +02:00
|
|
|
# Source is only complete with devel files.
|
2018-04-04 08:43:11 +02:00
|
|
|
Requires: kernel-devel%variant = %version-%source_rel
|
2023-12-04 08:06:44 +01:00
|
|
|
Provides: %name = %version-%source_rel
|
|
|
|
Provides: %name-srchash-%git_commit
|
|
|
|
Provides: linux
|
|
|
|
Provides: multiversion(kernel)
|
2018-07-25 10:03:18 +02:00
|
|
|
# extra packages needed for building a kernel from scratch
|
|
|
|
Recommends: bc
|
|
|
|
Recommends: bison
|
|
|
|
Recommends: flex
|
|
|
|
Recommends: libelf-devel
|
2016-08-02 08:03:59 +02:00
|
|
|
Recommends: openssl-devel
|
2022-05-04 10:17:15 +02:00
|
|
|
# pahole needed for BTF
|
|
|
|
%if 0%{?suse_version} > 1500 || 0%{?sle_version} > 150300
|
|
|
|
Recommends: dwarves >= 1.22
|
|
|
|
%endif
|
2021-11-16 09:04:47 +01:00
|
|
|
# dracut no longer carries installkernel
|
2021-12-01 10:12:51 +01:00
|
|
|
%if 0%{?suse_version} > 1500 || 0%{?sle_version} > 150300
|
2021-11-16 09:04:47 +01:00
|
|
|
Recommends: kernel-install-tools
|
|
|
|
%endif
|
2020-05-29 10:07:22 +02:00
|
|
|
%obsolete_rebuilds %name
|
2011-10-05 07:01:45 +02:00
|
|
|
|
2020-09-09 10:20:49 +02:00
|
|
|
# Force bzip2 instead of lzma compression to
|
|
|
|
# 1) allow install on older dist versions, and
|
|
|
|
# 2) decrease build times (bsc#962356 boo#1175882)
|
|
|
|
%define _binary_payload w9.bzdio
|
|
|
|
|
2011-10-05 07:01:45 +02:00
|
|
|
%define symbols %(set -- $([ -e %_sourcedir/extra-symbols ] && cat %_sourcedir/extra-symbols) ; echo $*)
|
|
|
|
|
|
|
|
%define do_vanilla "%variant" == ""
|
|
|
|
|
|
|
|
%description
|
|
|
|
Linux kernel sources with many fixes and improvements.
|
|
|
|
|
2010-12-01 11:20:27 +01:00
|
|
|
|
2011-10-25 07:02:09 +02:00
|
|
|
%source_timestamp
|
2024-03-13 09:29:45 +01:00
|
|
|
|
|
|
|
%post
|
|
|
|
%relink_function
|
|
|
|
|
|
|
|
relink linux-%kernelrelease%variant /usr/src/linux%variant
|
|
|
|
|
|
|
|
%files -f nondevel.files
|
|
|
|
|
2011-10-05 07:01:45 +02:00
|
|
|
%package -n kernel-devel%variant
|
2011-10-25 07:02:09 +02:00
|
|
|
Summary: Development files needed for building kernel modules
|
|
|
|
Group: Development/Sources
|
|
|
|
AutoReqProv: off
|
2011-10-05 07:01:45 +02:00
|
|
|
Provides: kernel-devel%variant = %version-%source_rel
|
2014-02-02 08:01:46 +01:00
|
|
|
Provides: multiversion(kernel)
|
2014-09-04 08:03:33 +02:00
|
|
|
Requires: kernel-macros
|
2019-11-30 09:08:50 +01:00
|
|
|
Requires(post): coreutils
|
2024-03-13 09:29:45 +01:00
|
|
|
%obsolete_rebuilds kernel-devel%variant
|
2011-10-05 07:01:45 +02:00
|
|
|
|
|
|
|
%description -n kernel-devel%variant
|
|
|
|
Kernel-level headers and Makefiles required for development of
|
|
|
|
external kernel modules.
|
|
|
|
|
2024-03-13 09:29:45 +01:00
|
|
|
|
2014-09-04 08:03:33 +02:00
|
|
|
%source_timestamp
|
|
|
|
|
2024-03-13 09:29:45 +01:00
|
|
|
%post -n kernel-devel%variant
|
|
|
|
%relink_function
|
|
|
|
|
|
|
|
relink linux-%kernelrelease%variant /usr/src/linux%variant
|
|
|
|
|
|
|
|
%files -n kernel-devel%variant -f devel.files
|
|
|
|
%ghost /usr/src/linux%variant
|
|
|
|
%doc /usr/share/doc/packages/*
|
|
|
|
|
2016-12-13 08:07:16 +01:00
|
|
|
# Note: The kernel-macros package intentionally does not provide
|
|
|
|
# multiversion(kernel) nor is its name decorated with the variant (-rt)
|
2014-09-04 08:03:33 +02:00
|
|
|
%package -n kernel-macros
|
|
|
|
Summary: RPM macros for building Kernel Module Packages
|
|
|
|
Group: Development/Sources
|
2019-03-19 09:08:50 +01:00
|
|
|
Provides: kernel-subpackage-macros
|
2014-09-04 08:03:33 +02:00
|
|
|
|
|
|
|
%description -n kernel-macros
|
2024-02-10 08:06:46 +01:00
|
|
|
This package provides the rpm macros and templates for Kernel Module Packages
|
2010-12-01 11:20:27 +01:00
|
|
|
|
2024-03-13 09:29:45 +01:00
|
|
|
|
2011-10-25 07:02:09 +02:00
|
|
|
%source_timestamp
|
2014-09-04 08:03:33 +02:00
|
|
|
|
2024-03-13 09:29:45 +01:00
|
|
|
%if "%variant" == ""
|
|
|
|
%files -n kernel-macros
|
|
|
|
%{_rpmmacrodir}/macros.kernel-source
|
|
|
|
/usr/lib/rpm/kernel-*-subpackage
|
|
|
|
%dir /usr/lib/rpm/kernel
|
|
|
|
/usr/lib/rpm/kernel/*
|
|
|
|
%endif
|
|
|
|
|
2011-10-05 07:01:45 +02:00
|
|
|
%package vanilla
|
2020-05-29 10:07:22 +02:00
|
|
|
%obsolete_rebuilds %name-vanilla
|
2016-06-26 16:47:43 +02:00
|
|
|
Summary: Vanilla Linux kernel sources with minor build fixes
|
2011-10-05 07:01:45 +02:00
|
|
|
Group: Development/Sources
|
|
|
|
AutoReqProv: off
|
2010-12-01 11:20:27 +01:00
|
|
|
Provides: %name-vanilla = %version-%source_rel
|
2014-02-02 08:01:46 +01:00
|
|
|
Provides: multiversion(kernel)
|
2016-01-26 08:03:18 +01:00
|
|
|
Requires: kernel-macros
|
2022-06-17 10:05:59 +02:00
|
|
|
# dracut no longer carries installkernel
|
|
|
|
%if 0%{?suse_version} > 1500 || 0%{?sle_version} > 150300
|
|
|
|
Recommends: kernel-install-tools
|
|
|
|
%endif
|
2011-10-05 07:01:45 +02:00
|
|
|
|
|
|
|
%description vanilla
|
|
|
|
Vanilla Linux kernel sources with minor build fixes.
|
|
|
|
|
2010-12-01 11:20:27 +01:00
|
|
|
|
2011-10-25 07:02:09 +02:00
|
|
|
%source_timestamp
|
2014-09-04 08:03:33 +02:00
|
|
|
|
2024-03-13 09:29:45 +01:00
|
|
|
%if %do_vanilla
|
|
|
|
%files vanilla
|
|
|
|
/usr/src/linux-%kernelrelease-vanilla
|
|
|
|
%endif
|
|
|
|
|
2011-10-05 07:01:45 +02:00
|
|
|
%prep
|
|
|
|
|
|
|
|
echo "Symbol(s): %symbols"
|
|
|
|
|
|
|
|
# Unpack all sources and patches
|
2023-06-22 05:56:22 +02:00
|
|
|
%setup -q -c -T -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 108 -a 109 -a 110 -a 111 -a 113 -a 114 -a 120 -a 121
|
2011-10-05 07:01:45 +02:00
|
|
|
|
|
|
|
%build
|
2020-11-23 10:11:45 +01:00
|
|
|
%install
|
2021-12-14 12:24:51 +01:00
|
|
|
mkdir -p %{buildroot}/usr/src
|
|
|
|
pushd %{buildroot}/usr/src
|
2011-10-05 07:01:45 +02:00
|
|
|
|
|
|
|
# Unpack the vanilla kernel sources
|
2014-01-23 08:04:33 +01:00
|
|
|
tar -xf %{S:0}
|
2022-09-03 10:15:06 +02:00
|
|
|
find . -xtype l -delete -printf "deleted '%f'\n"
|
2011-01-13 07:02:36 +01:00
|
|
|
if test "%srcversion" != "%kernelrelease%variant"; then
|
|
|
|
mv linux-%srcversion linux-%kernelrelease%variant
|
|
|
|
fi
|
2010-12-01 11:20:27 +01:00
|
|
|
|
2011-10-05 07:01:45 +02:00
|
|
|
%if %do_vanilla
|
2011-02-11 07:03:11 +01:00
|
|
|
cp -al \
|
|
|
|
linux-%kernelrelease%variant linux-%kernelrelease-vanilla
|
2011-10-05 07:01:45 +02:00
|
|
|
cd linux-%kernelrelease-vanilla
|
|
|
|
%_sourcedir/apply-patches --vanilla %_sourcedir/series.conf %my_builddir %symbols
|
|
|
|
rm -f $(find . -name ".gitignore")
|
2022-03-19 09:12:03 +01:00
|
|
|
# Hardlink duplicate files automatically (from package fdupes).
|
|
|
|
%fdupes $PWD
|
2011-10-05 07:01:45 +02:00
|
|
|
cd ..
|
|
|
|
%endif
|
|
|
|
|
2011-02-11 07:03:11 +01:00
|
|
|
cd linux-%kernelrelease%variant
|
2011-10-05 07:01:45 +02:00
|
|
|
%_sourcedir/apply-patches %_sourcedir/series.conf %my_builddir %symbols
|
|
|
|
rm -f $(find . -name ".gitignore")
|
|
|
|
|
|
|
|
if [ -f %_sourcedir/localversion ] ; then
|
|
|
|
cat %_sourcedir/localversion > localversion
|
|
|
|
fi
|
2022-03-19 09:12:03 +01:00
|
|
|
# Hardlink duplicate files automatically (from package fdupes).
|
|
|
|
%fdupes $PWD
|
2020-11-23 10:11:45 +01:00
|
|
|
cd ..
|
|
|
|
popd
|
2011-10-05 07:01:45 +02:00
|
|
|
|
|
|
|
# Install the documentation and example Kernel Module Package.
|
2014-09-04 08:03:33 +02:00
|
|
|
DOC=/usr/share/doc/packages/%name-%kernelrelease
|
|
|
|
mkdir -p %buildroot/$DOC
|
2024-01-06 08:08:15 +01:00
|
|
|
cp %_sourcedir/README.SUSE %buildroot/$DOC
|
2014-09-04 08:03:33 +02:00
|
|
|
ln -s $DOC/README.SUSE %buildroot/%src_install_dir/
|
2011-10-05 07:01:45 +02:00
|
|
|
|
2014-09-04 08:03:33 +02:00
|
|
|
%if "%variant" == ""
|
2021-12-14 12:24:51 +01:00
|
|
|
install -m 755 -d %{buildroot}%{_rpmmacrodir}
|
|
|
|
install -m 644 %_sourcedir/macros.kernel-source %{buildroot}%{_rpmmacrodir}
|
|
|
|
echo "%%kernel_module_directory %{kernel_module_directory}" >> %{buildroot}%{_rpmmacrodir}/macros.kernel-source
|
2021-10-08 06:38:15 +02:00
|
|
|
|
2021-12-14 12:24:51 +01:00
|
|
|
install -m 755 -d %{buildroot}/usr/lib/rpm
|
2013-05-01 08:12:39 +02:00
|
|
|
install -m 644 %_sourcedir/kernel-{module,cert}-subpackage \
|
2021-12-14 12:24:51 +01:00
|
|
|
%{buildroot}/usr/lib/rpm/
|
|
|
|
install -m 755 -d %{buildroot}/usr/lib/rpm/kernel
|
|
|
|
install -m 755 %_sourcedir/{splitflist,mergedep,moddep,modflist,kernel-subpackage-build} %{buildroot}/usr/lib/rpm/kernel
|
|
|
|
install -m 644 %_sourcedir/kernel-subpackage-spec %{buildroot}/usr/lib/rpm/kernel
|
|
|
|
install -m 644 %_sourcedir/kernel-spec-macros %{buildroot}/usr/lib/rpm/kernel
|
|
|
|
install -m 644 -T %_sourcedir/kernel-default-base.spec.txt %{buildroot}/usr/lib/rpm/kernel/kernel-default-base.spec
|
2014-09-04 08:03:33 +02:00
|
|
|
%endif
|
2011-10-05 07:01:45 +02:00
|
|
|
|
|
|
|
pushd "%buildroot"
|
|
|
|
perl "%_sourcedir/group-source-files.pl" \
|
|
|
|
-D "$OLDPWD/devel.files" -N "$OLDPWD/nondevel.files" \
|
|
|
|
-L "%src_install_dir"
|
|
|
|
popd
|
|
|
|
|
2020-07-23 08:17:56 +02:00
|
|
|
find %{buildroot}/usr/src/linux* -type f -name '*.[ch]' -perm /0111 -exec chmod -v a-x {} +
|
2021-02-16 09:05:40 +01:00
|
|
|
# OBS checks don't like /usr/bin/env in script interpreter lines
|
|
|
|
grep -Elr '^#! */usr/bin/env ' %{buildroot}/usr/src/linux* | while read f; do
|
|
|
|
sed -re '1 { s_^#! */usr/bin/env +/_#!/_ ; s_^#! */usr/bin/env +([^/])_#!/usr/bin/\1_ }' -i "$f"
|
|
|
|
done
|
2011-02-11 07:03:11 +01:00
|
|
|
# kernel-source and kernel-$flavor-devel are built independently, but the
|
|
|
|
# shipped sources (/usr/src/linux/) need to be older than generated files
|
|
|
|
# (/usr/src/linux-obj). We rely on the git commit timestamp to not point into
|
|
|
|
# the future and be thus lower than the timestamps of files built from the
|
|
|
|
# source (bnc#669669).
|
|
|
|
ts="$(head -n1 %_sourcedir/source-timestamp)"
|
2024-03-13 09:29:45 +01:00
|
|
|
find %buildroot/usr/src/linux* ! -type l -print0 | xargs -0 touch -d "$ts"
|
2011-10-05 07:01:45 +02:00
|
|
|
|
|
|
|
%changelog
|