Michal Marek 411abb
#
Michal Marek aebe2d
# spec file for package kernel-@FLAVOR@
Michal Marek 411abb
#
Takashi Iwai 39a1fc
# Copyright (c) @YEAR@ SUSE LLC
Michal Marek 411abb
#
Michal Marek 411abb
# All modifications and additions to the file contributed by third parties
Michal Marek 411abb
# remain the property of their copyright owners, unless otherwise agreed
Michal Marek 411abb
# upon. The license for this file, and modifications and additions to the
Michal Marek 411abb
# file, is the same license as for the pristine package itself (unless the
Michal Marek 411abb
# license for the pristine package is not an Open Source License, in which
Michal Marek 411abb
# case the license is the MIT License). An "Open Source License" is a
Michal Marek 411abb
# license that conforms to the Open Source Definition (Version 1.9)
Michal Marek 411abb
# published by the Open Source Initiative.
Michal Marek 411abb
77b5f8
# Please submit bugfixes or comments via https://bugs.opensuse.org/
Michal Marek 411abb
#
Michal Marek 59d2ac
# needssslcertforbuild
Michal Marek 411abb
Michal Marek a3cd25
Michal Marek 411abb
%define srcversion @SRCVERSION@
Michal Marek 411abb
%define patchversion @PATCHVERSION@
Michal Marek 411abb
%define variant @VARIANT@%{nil}
Michal Marek eeaaaf
%define vanilla_only @VANILLA_ONLY@
Takashi Iwai cdf580
%define compress_modules @COMPRESS_MODULES@
Jiri Slaby c8b2d9
%define compress_vmlinux @COMPRESS_VMLINUX@
Michal Suchanek 88241e
%define livepatch @LIVEPATCH@%{nil}
Nicolai Stange 9d4124
%define livepatch_rt @LIVEPATCH_RT@%{nil}
Michal Marek 411abb
Michal Marek 411abb
%include %_sourcedir/kernel-spec-macros
Michal Marek 411abb
Michal Marek 411abb
%define build_flavor	@FLAVOR@
Andreas Schwab 013444
%define build_default	("%build_flavor" == "default")
Andreas Schwab 013444
%define build_vanilla	("%build_flavor" == "vanilla")
Michal Marek 411abb
Michal Marek 2d2ec7
%if ! %build_vanilla
Michal Marek 411abb
%define src_install_dir /usr/src/linux-%kernelrelease%variant
Michal Marek 2d2ec7
%else
Michal Marek 2d2ec7
%define src_install_dir /usr/src/linux-%kernelrelease-vanilla
Michal Marek 2d2ec7
%endif
Michal Marek 2d2ec7
%define obj_install_dir /usr/src/linux-%kernelrelease%variant-obj
Michal Marek 411abb
%define rpm_install_dir %buildroot%obj_install_dir
Michal Marek 2ed0db
%define kernel_build_dir %my_builddir/linux-%srcversion/linux-obj
Michal Marek 411abb
Jiri Slaby 63d707
%if 0%{?_project:1} && ( %(echo %_project | grep -Ex -f %_sourcedir/release-projects | grep -v ^PTF | grep -vc openSUSE) || %(echo %_project | grep -Ec "^(Devel:)?Kernel:") )
Michal Kubecek 708b64
	%define klp_symbols 1
Michal Kubecek 708b64
%endif
Michal Kubecek 708b64
Michal Marek 411abb
%(chmod +x %_sourcedir/{@SCRIPTS@})
Michal Marek 411abb
Michal Marek 411abb
%global cpu_arch %(%_sourcedir/arch-symbols %_target_cpu)
Michal Marek 411abb
%define cpu_arch_flavor %cpu_arch/%build_flavor
Michal Marek 411abb
Michal Suchanek d9a135
%global certs %( for f in %_sourcedir/*.crt; do                                                         \
Michal Suchanek d9a135
    if ! test -e "$f"; then                                                                             \
Michal Suchanek d9a135
        continue                                                                                        \
Michal Suchanek d9a135
    fi                                                                                                  \
Michal Suchanek d9a135
    h=$(openssl x509 -inform PEM -fingerprint -noout -in "$f")                                          \
Michal Suchanek d9a135
    if [ -z "$h" ] ; then                                                                               \
Michal Suchanek d9a135
        echo Cannot parse "$f" >&2                                                                      \
Michal Suchanek d9a135
        confinue                                                                                        \
Michal Suchanek d9a135
    fi                                                                                                  \
Michal Suchanek d9a135
    cert=$(echo "$h" | sed -rn 's/^SHA1 Fingerprint=//; T; s/://g; s/(.{8}).*/\\1/p')                   \
Michal Suchanek d9a135
    echo Found signing certificate "$f" "($cert)" >&2                                                   \
Michal Suchanek d9a135
    cat "$f" >>%_sourcedir/.kernel_signing_key.pem                                                      \
Michal Suchanek d9a135
    mkdir -p %_sourcedir/.kernel_signing_certs                                                          \
Michal Suchanek d9a135
    openssl x509 -inform PEM -in "$f" -outform DER -out %_sourcedir/.kernel_signing_certs/"$cert".crt   \
Michal Suchanek d9a135
    echo -n "$cert" ""                                                                                  \
Michal Suchanek d9a135
done )
Michal Suchanek d9a135
Michal Suchanek e602b0
%ifarch %ix86 x86_64
Michal Suchanek e602b0
%define image vmlinuz
Michal Suchanek e602b0
%endif
Michal Suchanek e602b0
%ifarch ppc ppc64 ppc64le
Michal Suchanek e602b0
%define image vmlinux
Michal Suchanek e602b0
%endif
Michal Suchanek e602b0
%ifarch s390 s390x
Michal Suchanek e602b0
%define image image
Michal Suchanek e602b0
%endif
Michal Suchanek e602b0
%ifarch %arm
Michal Suchanek e602b0
%define image zImage
Michal Suchanek e602b0
%endif
Michal Suchanek e602b0
%ifarch aarch64 riscv64
Michal Suchanek e602b0
%define image Image
Michal Suchanek e602b0
%endif
Michal Suchanek e602b0
Michal Marek 411abb
# Define some CONFIG variables as rpm macros as well. (rpm cannot handle
Michal Marek 411abb
# defining them all at once.)
Michal Suchanek bb988d
%define config_vars CONFIG_MODULES CONFIG_MODULE_SIG CONFIG_MODULE_SIG_HASH CONFIG_KMSG_IDS CONFIG_SUSE_KERNEL_SUPPORTED CONFIG_EFI_STUB CONFIG_LIVEPATCH_IPA_CLONES CONFIG_DEBUG_INFO_BTF_MODULES
Michal Marek 411abb
%{expand:%(eval "$(test -n "%cpu_arch_flavor" && tar -xjf %_sourcedir/config.tar.bz2 --to-stdout config/%cpu_arch_flavor)"; for config in %config_vars; do echo "%%global $config ${!config:-n}"; done)}
Jiri Slaby d9b4c4
%define split_extra ("%CONFIG_MODULES" == "y" && "%CONFIG_SUSE_KERNEL_SUPPORTED" == "y")
Takashi Iwai 1fa25f
Takashi Iwai 1fa25f
# Split Leap-only modules to kernel-*-optional subpackage?
Takashi Iwai 1fa25f
%define split_optional	0
Takashi Iwai 1fa25f
Jiri Slaby 21f820
%if "%CONFIG_MODULES" != "y"
Michal Kubecek a048c4
	%define klp_symbols 0
Michal Kubecek a048c4
%endif
Michal Marek 411abb
Michal Marek 411abb
%ifarch %ix86 x86_64
Michal Marek 411abb
%define install_vdso 1
Jiri Slaby 9c7ade
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150500
Jiri Slaby 9c7ade
%define separate_vdso 1
Jiri Slaby 9c7ade
%endif
Michal Marek 411abb
%else
Michal Marek 411abb
%define install_vdso 0
Michal Marek 411abb
%endif
Michal Marek 411abb
22ec56
%define modules_dir %kernel_module_directory/%kernelrelease-%build_flavor
6f5ed0
Michal Marek 411abb
Name:           kernel-@FLAVOR@
Michal Marek 411abb
Summary:        @SUMMARY@
Michal Kubecek f888e0
License:        GPL-2.0-only
Michal Marek 0b9e9a
Group:          System/Kernel
Michal Marek 411abb
Version:        @RPMVERSION@
Michal Marek a80e5e
%if 0%{?is_kotd}
Michal Marek a80e5e
Release:        <RELEASE>.g@COMMIT@
Michal Marek a80e5e
%else
Michal Marek aebe2d
Release:        @RELEASE@
Michal Marek a80e5e
%endif
77b5f8
URL:            https://www.kernel.org/
Michal Suchanek bb95fe
%if 0%{?suse_version} > 1500 || 0%{?sle_version} > 150300
Michal Suchanek bb95fe
BuildRequires:  bash-sh
Michal Suchanek bb95fe
%endif
Michal Marek 0b9e9a
BuildRequires:  bc
Michal Suchanek f5686d
BuildRequires:  bison
Michal Marek 0b9e9a
BuildRequires:  coreutils
Michal Marek 411abb
BuildRequires:  fdupes
Michal Kubecek 83d831
BuildRequires:  flex
Michal Marek d7ff04
# Cannot test %%CONFIG_GCC_PLUGINS here because the buildservice parser
Michal Marek d7ff04
# does not expand %%(...)
Michal Marek d7ff04
%if "%build_flavor" == "syzkaller"
Michal Marek d57795
# Needed by scripts/gcc-plugin.sh
Michal Suchanek d2ab97
BuildRequires:  gcc-c++
Michal Suchanek d2ab97
BuildRequires:  gcc-devel
Michal Marek d7ff04
%endif
Michal Marek d7a84f
%if 0%{?suse_version} > 1310
Michal Marek 9cca2f
BuildRequires:  hmaccalc
Michal Marek d7a84f
%endif
Michal Marek fbdf0b
BuildRequires:  libopenssl-devel
Michal Marek f65016
BuildRequires:  modutils
Michal Marek 59d2ac
# Used to sign the kernel in the buildservice
Michal Marek 15501f
BuildRequires:  openssl
Michal Marek 15501f
BuildRequires:  pesign-obs-integration
Jeff Mahoney ee19e9
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150300
Jeff Mahoney ee19e9
# pahole for CONFIG_DEBUG_INFO_BTF
Michal Suchanek c88d34
BuildRequires:  dwarves >= 1.22
Jeff Mahoney ee19e9
%endif
David Sterba 16f65f
# for objtool
David Sterba 16f65f
BuildRequires:  libelf-devel
Michal Suchanek 01569b
# required for 50-check-kernel-build-id rpm check
Michal Suchanek 01569b
BuildRequires:  elfutils
aa61db
%if "%{compress_modules}" == "zstd"
aa61db
BuildRequires:  zstd
f36412
# Make sure kmod supports zstd compressed modules
Michal Suchanek 357f09
Requires(post): kmod-zstd
aa61db
%endif
Michal Marek 411abb
Provides:       %name = %version-%source_rel
Michal Marek c9157e
# bnc#901925
Michal Marek c9157e
Provides:       %name-%version-%source_rel
Michal Suchanek b4ec51
Provides:       %{name}_%_target_cpu = %version-%source_rel
Michal Marek 411abb
Provides:       kernel-base = %version-%source_rel
Michal Marek a3cd25
Provides:       multiversion(kernel)
Michal Marek 3f926c
# In SLE11, kernel-$flavor complemented kernel-$flavor-base. With SLE12,
Michal Marek 3f926c
# kernel-$flavor itself contains all the needed files and kernel-$flavor-base
Michal Marek 3f926c
# is a subset that can replace kernel-$flavor in some scenarios. We need to
Michal Marek 3f926c
# obsolete the -base subpackage from SLE11, so that the base files are not
Michal Marek 3f926c
# owned by multiple packages now. The dependency is not correct wrt openSUSE
Michal Marek 3f926c
# 11.2 - 11.4, but we primarily care about the supported upgrade path.
Michal Suchanek a5ee24
Obsoletes:      %name-base < 3.1
Michal Suchanek dbe7b2
%if ("%build_flavor" != "kvmsmall") && ("%build_flavor" != "azure")
Michal Suchanek 955681
Recommends: kernel-firmware
Michal Suchanek dbe7b2
%endif
Michal Marek bf655e
# The following is copied to the -base subpackage as well
Michal Marek bf655e
# BEGIN COMMON DEPS
Michal Suchanek e98096
Requires(pre):  suse-kernel-rpm-scriptlets
Michal Suchanek 56c4db
Requires(post): suse-kernel-rpm-scriptlets
Michal Suchanek 56c4db
Requires:       suse-kernel-rpm-scriptlets
Michal Suchanek 56c4db
Requires(preun): suse-kernel-rpm-scriptlets
Michal Suchanek e082fb
Requires(postun): suse-kernel-rpm-scriptlets
Michal Marek 411abb
Requires(pre):  coreutils awk
Michal Marek 2889ce
# For /usr/lib/module-init-tools/weak-modules2
Michal Marek 2889ce
Requires(post): suse-module-tools
Michal Marek 2889ce
# For depmod (modutils is a dependency provided by both module-init-tools and
Michal Marek 2889ce
# kmod-compat)
Michal Marek 2889ce
Requires(post): modutils
Michal Marek 411abb
# This Requires is wrong, because the post/postun scripts have a
Michal Marek 411abb
# test -x update-bootloader, having perl-Bootloader is not a hard requirement.
Michal Marek 411abb
# But, there is no way to tell rpm or yast to schedule the installation
Michal Marek 411abb
# of perl-Bootloader before kernel-binary.rpm if both are in the list of
Michal Suchanek e356c9
# packages to install/update. Likewise, this is true for dracut.
Michal Marek 411abb
# Need a perl-Bootloader with /usr/lib/bootloader/bootloader_entry
Michal Marek 411abb
Requires(post): perl-Bootloader >= 0.4.15
Michal Suchanek e356c9
Requires(post): dracut
Michal Marek dd227e
# Install the package providing /etc/SuSE-release early enough, so that
Michal Marek dd227e
# the grub entry has correct title (bnc#757565)
Michal Marek dd227e
Requires(post): distribution-release
Michal Suchanek e356c9
# Do not install p-b and dracut for the install check, the %post script is
Michal Suchanek 858b7e
# able to handle this
Michal Suchanek e356c9
#!BuildIgnore: perl-Bootloader dracut distribution-release
Michal Marek 7f4c49
# Remove some packages that are installed automatically by the build system,
Michal Marek 7f4c49
# but are not needed to build the kernel
Michal Kubecek d7695e
#!BuildIgnore: autoconf automake gettext-runtime libtool cvs gettext-tools udev insserv
Michal Marek 411abb
Michal Marek 411abb
%ifarch s390 s390x
Michal Marek 411abb
%if %build_vanilla && 0%{?suse_version} < 1130
Michal Marek 411abb
BuildRequires:  dwarfextract
Michal Marek 411abb
%endif
Michal Marek 411abb
%endif
Alexander Graf 63a7b2
%ifarch %arm
Alexander Graf 63a7b2
BuildRequires:  u-boot-tools
Alexander Graf 63a7b2
%endif
Michal Suchanek 5b5113
%if 0%{?usrmerged}
913f75
# make sure we have a post-usrmerge system
913f75
Conflicts:      filesystem < 16
Michal Suchanek 5b5113
%endif
Michal Marek 411abb
3ba894
Obsoletes:      microcode_ctl < 1.18
Jeff Mahoney 43e5ff
Michal Marek e8f8f5
# Force bzip2 instead of lzma compression to
Michal Marek e8f8f5
# 1) allow install on older dist versions, and
Michal Suchanek 375ec8
# 2) decrease build times (bsc#962356 boo#1175882)
Michal Marek 411abb
%define _binary_payload w9.bzdio
Michal Marek f622d6
# Do not recompute the build-id of vmlinux in find-debuginfo.sh (bsc#964063)
Michal Suchanek 47e91a
%undefine _unique_build_ids
Michal Marek f622d6
%define _no_recompute_build_ids 1
Michal Suchanek 2b90c1
# prevent usr/lib/debug/boot/vmlinux-4.12.14-11.10-default-4.12.14-11.10.ppc64le.debug
Michal Suchanek 2b90c1
%undefine _unique_debug_names
Michal Marek 411abb
# dead network if installed on SLES10, otherwise it will work (mostly)
Michal Marek 411abb
Conflicts:      sysfsutils < 2.0
Michal Marek 411abb
Conflicts:      apparmor-profiles <= 2.1
Michal Marek 411abb
Conflicts:      apparmor-parser < 2.3
Michal Marek 411abb
# root-lvm only works with newer udevs
Michal Marek 411abb
Conflicts:      udev < 118
Michal Marek 411abb
Conflicts:      lvm2 < 2.02.33
Olaf Hering 86f9ba
# Interface to hv_kvp_daemon changed
Olaf Hering 86f9ba
Conflicts:      hyper-v < 4
Michal Marek 411abb
%ifarch %ix86
Michal Marek 411abb
Conflicts:      libc.so.6()(64bit)
Michal Marek 411abb
%endif
Michal Marek 411abb
Provides:       kernel = %version-%source_rel
Michal Suchanek 219bce
Provides:       kernel-%build_flavor-base-srchash-@COMMIT_FULL@
Michal Suchanek 219bce
Provides:       kernel-srchash-@COMMIT_FULL@
Michal Suchanek 955681
# END COMMON DEPS
Michal Suchanek 219bce
Provides:       %name-srchash-@COMMIT_FULL@
Michal Suchanek a5ee24
@PROVIDES_OBSOLETES@
Michal Suchanek 858b7e
@PROVIDES_OBSOLETES_BASE@
Michal Suchanek 858b7e
%obsolete_rebuilds %name
Michal Marek 411abb
@SOURCES@
Michal Suchanek 4b42fb
Michal Marek 411abb
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Michal Marek 411abb
ExclusiveArch:  @ARCHS@
Michal Marek 88a632
%define kmp_target_cpu %_target_cpu
Michal Marek 88a632
%ifarch %ix86
Michal Marek 88a632
# Only i386/default supports i586, mark other flavors' packages as i686
Michal Marek 88a632
%if ! %build_default
Michal Marek 88a632
BuildArch:      i686
Michal Marek 88a632
# KMPs are always built as i586, because rpm does not allow to build
Michal Marek 88a632
# subpackages for different architectures. Therefore, we change the
Michal Marek 88a632
# /usr/src/linux-obj/<arch> symlink to i586.
Michal Marek 88a632
%define kmp_target_cpu i586
Michal Marek 88a632
%endif
Michal Marek 88a632
%endif
Michal Marek 411abb
Michal Marek 411abb
# Will modules not listed in supported.conf abort the kernel build (0/1)?
Michal Marek 411abb
%define supported_modules_check 0
Michal Marek 411abb
Michal Marek 411abb
%description
Michal Marek 411abb
@DESCRIPTION@
Michal Marek 411abb
Michal Marek 411abb
Michal Marek aebe2d
%source_timestamp
Michal Marek 411abb
%prep
Michal Marek d12c88
if ! [ -e %{S:0} ]; then
Michal Marek 411abb
    echo "The %name-%version.nosrc.rpm package does not contain the" \
Michal Marek 411abb
	 "complete sources. Please install kernel-source-%version.src.rpm."
Michal Marek 411abb
    exit 1
Michal Marek 411abb
fi
Michal Marek 411abb
Michal Marek 411abb
SYMBOLS=
Michal Marek 411abb
if test -e %_sourcedir/extra-symbols; then
Michal Marek 411abb
	SYMBOLS=$(cat %_sourcedir/extra-symbols)
Michal Marek 411abb
	echo "extra symbol(s):" $SYMBOLS
Michal Marek 411abb
fi
Michal Marek 411abb
Michal Marek 411abb
# Unpack all sources and patches
Michal Marek 411abb
%setup -q -c -T -a 0 @UNPACK_PATCHES@
Michal Marek 411abb
Michal Marek 411abb
mkdir -p %kernel_build_dir
Michal Marek 411abb
Michal Marek edfdc2
# Generate a list of modules with their support status marking
Takashi Iwai 8f7974
# The first marker is supposed to be either "+external", "-" or "-!optional",
Takashi Iwai 8f7974
# where "+external" is for an externally supported module, "-" is for an
Takashi Iwai 8f7974
# unsuppored module, "-!optional" is for Leap-only unsupported module.
Takashi Iwai 8f7974
# There can be an optional arch-specific second marker with "+arch" (e.g.
Takashi Iwai 8f7974
# +arm64), which enforces the module to be supported on the specific arch.
Michal Marek edfdc2
%_sourcedir/guards --list --with-guards <%_sourcedir/supported.conf | \
Takashi Iwai 8cbdb4
awk '{
Takashi Iwai 8cbdb4
    t = "";
Takashi Iwai 8cbdb4
    for (i = 1; i < NF; i++) {
Takashi Iwai 8cbdb4
	if ($i == "+external") {
Takashi Iwai 8cbdb4
		t = " external";
Takashi Iwai 8cbdb4
	} else if ($i == "+'%cpu_arch'") {
Takashi Iwai 8cbdb4
		t = "";
Takashi Iwai 8cbdb4
	} else if ($i ~ "^-") {
Takashi Iwai 8cbdb4
		t = " no";
Michal Marek edfdc2
	}
Takashi Iwai 8cbdb4
    }
Takashi Iwai 8cbdb4
    print $(NF) t;
Takashi Iwai 8cbdb4
}' >%kernel_build_dir/Module.supported
Michal Marek a259f7
subpackages=(
Michal Marek a259f7
	base
Jiri Slaby 21f820
%if "%CONFIG_SUSE_KERNEL_SUPPORTED" == "y"
Michal Marek a259f7
	@KMPS@
Michal Marek a259f7
%endif
Michal Marek a259f7
)
Michal Marek a259f7
for package in "${subpackages[@]}"; do
Michal Marek 09cb6b
	%_sourcedir/guards --default=0 "$package" \
Michal Marek 09cb6b
		<%_sourcedir/supported.conf | sed 's,.*/,,; s,\.ko$,,' | \
Michal Marek 09cb6b
		sort -u >%kernel_build_dir/Module."$package"
Michal Marek 09cb6b
done
Takashi Iwai 1fa25f
%if %split_extra && %split_optional
Takashi Iwai 1fa25f
# Module.optional is in a special form, containing guard markers for
Takashi Iwai 1fa25f
# both extra and optional modules, which is processed by split-modules
Takashi Iwai 1fa25f
%_sourcedir/guards --list --with-guards <%_sourcedir/supported.conf | \
Takashi Iwai 8cbdb4
awk '{
Takashi Iwai 8cbdb4
    t = "";
Takashi Iwai 8cbdb4
    for (i = 1; i < NF; i++) {
Takashi Iwai 8cbdb4
	if ($i == "+'%cpu_arch'") {
Takashi Iwai 8f7974
		t = "";
Takashi Iwai 8cbdb4
	} else if ($i ~ "^-") {
Takashi Iwai 8cbdb4
		t = $i
Takashi Iwai 8cbdb4
	}
Takashi Iwai 8cbdb4
    }
Takashi Iwai 8cbdb4
    if (t != "") {print t,$(NF);}
Takashi Iwai 8cbdb4
}' >%kernel_build_dir/Module.optional
Takashi Iwai 1fa25f
%endif
Michal Marek 411abb
Michal Marek 411abb
cd linux-%srcversion
Michal Marek 411abb
Michal Marek 411abb
%_sourcedir/apply-patches \
Michal Marek 411abb
%if %{build_vanilla}
Michal Marek 411abb
	--vanilla \
Michal Marek 411abb
%endif
Michal Marek 411abb
	%_sourcedir/series.conf .. $SYMBOLS
Michal Marek 411abb
Michal Marek 411abb
cd %kernel_build_dir
Michal Marek 411abb
Michal Marek e3c78c
# Override the timestamp 'uname -v' reports with the source timestamp and
Michal Marek e3c78c
# the commit hash.
Michal Marek e3c78c
date=$(head -n 1 %_sourcedir/source-timestamp)
Michal Marek e3c78c
commit=$(sed -n 's/GIT Revision: //p' %_sourcedir/source-timestamp)
Michal Marek e3c78c
cat > .kernel-binary.spec.buildenv <
Michal Marek e3c78c
export KBUILD_BUILD_TIMESTAMP="$(LANG=C date -d "$date") (${commit:0:7})"
Michal Marek e3c78c
export KBUILD_VERBOSE=0
Michal Marek e3c78c
export KBUILD_SYMTYPES=1
Michal Marek e3c78c
export KBUILD_OVERRIDE=1
Michal Marek e3c78c
export KBUILD_BUILD_USER=geeko
Michal Marek e3c78c
export KBUILD_BUILD_HOST=buildhost
Michal Marek e3c78c
export HOST_EXTRACFLAGS="-include %_sourcedir/host-memcpy-hack.h"
Michal Marek e3c78c
EOF
Michal Marek e3c78c
source .kernel-binary.spec.buildenv
Michal Marek e3c78c
Michal Marek 411abb
if [ -f %_sourcedir/localversion ] ; then
Michal Marek 411abb
    cat %_sourcedir/localversion > localversion
Michal Marek 411abb
fi
Michal Marek 411abb
Michal Suchanek af3782
config_base="default"
Jeff Mahoney a9a75a
%ifarch %ix86
Michal Suchanek af3782
config_base="pae"
Jeff Mahoney a9a75a
%endif
Michal Suchanek af3782
if ! [ -f %my_builddir/config/%cpu_arch/$config_base ] ; then
Michal Suchanek af3782
    config_base=%variant
Michal Suchanek af3782
    config_base=${config_base#-}
Michal Suchanek af3782
fi
Jeff Mahoney 66c90c
if ! grep -q CONFIG_MMU= "%my_builddir/config/%cpu_arch_flavor"; then
Michal Suchanek af3782
cp "%my_builddir/config/%cpu_arch/$config_base" .config
Jeff Mahoney a9a75a
../scripts/kconfig/merge_config.sh -m .config \
Jeff Mahoney a9a75a
                                   %my_builddir/config/%cpu_arch_flavor
Jeff Mahoney 66c90c
else
Michal Marek e8739f
cp %my_builddir/config/%cpu_arch_flavor .config
Jeff Mahoney 66c90c
fi
Michal Marek 8eb070
if test -e %my_builddir/config.addon/%cpu_arch_flavor; then
Michal Marek 411abb
	# FIXME: config.addon doesn't affect the %CONFIG_ macros defined at
Michal Marek 411abb
	# the top of the specfile
Michal Marek e8739f
	../scripts/kconfig/merge_config.sh -m .config %my_builddir/config.addon/%cpu_arch_flavor
Michal Marek 411abb
fi
Jeff Mahoney 0ca61c
Jeff Mahoney 0ca61c
CONFIG_SUSE_KERNEL_RELEASED="--disable CONFIG_SUSE_KERNEL_RELEASED"
Jeff Mahoney 0ca61c
%if 0%{?_project:1}
Jiri Slaby 63d707
if echo %_project | grep -Eqx -f %_sourcedir/release-projects; then
Jeff Mahoney 0ca61c
	CONFIG_SUSE_KERNEL_RELEASED="--enable CONFIG_SUSE_KERNEL_RELEASED"
Jeff Mahoney 0ca61c
fi
Jeff Mahoney 0ca61c
%endif
Jeff Mahoney 0ca61c
Michal Suchanek 43b5dd
DEBUG_INFO_TYPE="$(grep "CONFIG_DEBUG_INFO_DWARF.*=y" .config)"
Michal Suchanek 43b5dd
DEBUG_INFO_TYPE="${DEBUG_INFO_TYPE%%=y}"
Michal Suchanek 43b5dd
DEBUG_INFO_TYPE="${DEBUG_INFO_TYPE##CONFIG_DEBUG_INFO_}"
Michal Suchanek 43b5dd
echo "Kernel debuginfo type: ${DEBUG_INFO_TYPE}"
Michal Suchanek 43b5dd
Michal Marek 2ed0db
../scripts/config \
Michal Marek b88e78
	--set-str CONFIG_LOCALVERSION -%source_rel-%build_flavor \
Michal Marek 411abb
	--enable  CONFIG_SUSE_KERNEL \
Jeff Mahoney 0ca61c
	$CONFIG_SUSE_KERNEL_RELEASED \
Michal Marek 411abb
%if 0%{?__debug_package:1}
Michal Marek d404ac
	--enable  CONFIG_DEBUG_INFO
Michal Marek 411abb
%else
Michal Suchanek 43b5dd
	--disable CONFIG_DEBUG_INFO \
Michal Suchanek 43b5dd
	--disable CONFIG_DEBUG_INFO_"${DEBUG_INFO_TYPE}" \
Michal Suchanek 43b5dd
	--enable  CONFIG_DEBUG_INFO_NONE
Michal Marek 411abb
%endif
Michal Marek 411abb
Michal Suchanek 6c2453
if [ %CONFIG_MODULE_SIG = "y" ]; then
Michal Suchanek 68b36f
	if [ -n "%certs" ] ; then
Michal Suchanek bb988d
		ln -s %_sourcedir/.kernel_signing_key.pem .
Michal Suchanek 68b36f
	else
Michal Suchanek bb988d
		if ! [ -f .kernel.genkey ] ; then
Michal Suchanek bb988d
			cat > .kernel.genkey <
Michal Suchanek bb988d
[ req ]
Michal Suchanek bb988d
default_bits = 4096
Michal Suchanek bb988d
distinguished_name = req_distinguished_name
Michal Suchanek bb988d
prompt = no
Michal Suchanek bb988d
string_mask = utf8only
Michal Suchanek bb988d
x509_extensions = myexts
Michal Suchanek bb988d
Michal Suchanek bb988d
[ req_distinguished_name ]
Michal Suchanek bb988d
CN = Build time autogenerated kernel key
Michal Suchanek bb988d
Michal Suchanek bb988d
[ myexts ]
Michal Suchanek bb988d
basicConstraints=critical,CA:FALSE
Michal Suchanek bb988d
keyUsage=digitalSignature
Michal Suchanek bb988d
subjectKeyIdentifier=hash
Michal Suchanek bb988d
authorityKeyIdentifier=keyid
Michal Suchanek bb988d
extendedKeyUsage=codeSigning
Michal Suchanek bb988d
EOF
Michal Suchanek bb988d
		fi
Michal Suchanek bb988d
		openssl req -new -nodes -utf8 -%CONFIG_MODULE_SIG_HASH -days 36500 \
Michal Suchanek bb988d
			-batch -x509 -config .kernel.genkey \
Michal Suchanek bb988d
			-outform PEM -out .kernel_signing_key.pem \
Michal Suchanek bb988d
			-keyout .kernel_signing_key.pem
Michal Suchanek 68b36f
	fi
Michal Suchanek bb988d
	../scripts/config --set-str CONFIG_MODULE_SIG_KEY ".kernel_signing_key.pem"
Michal Suchanek 6c2453
fi
Michal Suchanek 6c2453
Michal Suchanek fb21b7
case %cpu_arch in
Michal Suchanek 5f24fb
    x86_64 | i386)
Michal Suchanek 5f24fb
        MAKE_ARGS="$MAKE_ARGS ARCH=x86"
Michal Suchanek 5f24fb
        ;;
Michal Suchanek fb21b7
    ppc*)
Michal Suchanek 5f24fb
        MAKE_ARGS="$MAKE_ARGS ARCH=powerpc"
Michal Suchanek fb21b7
        ;;
Michal Suchanek fb21b7
    s390x)
Michal Suchanek fb21b7
        MAKE_ARGS="$MAKE_ARGS ARCH=s390"
Michal Suchanek fb21b7
        ;;
Michal Suchanek fb21b7
    arm64)
Michal Suchanek fb21b7
        MAKE_ARGS="$MAKE_ARGS ARCH=arm64"
Michal Suchanek fb21b7
        ;;
Michal Suchanek fb21b7
    armv*)
Michal Suchanek fb21b7
        MAKE_ARGS="$MAKE_ARGS ARCH=arm"
Michal Suchanek fb21b7
        ;;
Andreas Schwab c2885e
    riscv*)
Andreas Schwab c2885e
        MAKE_ARGS="$MAKE_ARGS ARCH=riscv"
Andreas Schwab c2885e
        ;;
Michal Suchanek fb21b7
    *)
Michal Suchanek fb21b7
        MAKE_ARGS="$MAKE_ARGS ARCH=%cpu_arch"
Michal Suchanek fb21b7
        ;;
Michal Suchanek fb21b7
esac
Michal Suchanek fb21b7
Michal Suchanek 8c2f46
makeoutputsync=
Michal Suchanek 0bf8e9
if make --output-sync --help >/dev/null 2>&1 ; then
Michal Suchanek 8c2f46
        makeoutputsync=--output-sync
Michal Suchanek 8c2f46
else
Michal Suchanek 8c2f46
        echo make does not support --output-sync flag. Build messages may be mangled. 1>&2
Michal Suchanek 8c2f46
fi
Michal Suchanek 13e40f
MAKE_ARGS="$MAKE_ARGS $makeoutputsync %{?_smp_mflags}"
Michal Suchanek 6171b7
echo export MAKE_ARGS=\""$MAKE_ARGS"\" >> .kernel-binary.spec.buildenv
Michal Suchanek 6171b7
Michal Suchanek 13e40f
KERN_DIRS="-C .. O=$PWD"
Michal Marek 411abb
if test -e %_sourcedir/TOLERATE-UNKNOWN-NEW-CONFIG-OPTIONS; then
Michal Suchanek 13e40f
    yes '' | make oldconfig $MAKE_ARGS $KERN_DIRS
Michal Marek 411abb
else
Michal Marek 411abb
    cp .config .config.orig
Michal Kubecek a239c6
    if test -f ../scripts/kconfig/Makefile && \
Michal Kubecek a239c6
       grep -q syncconfig ../scripts/kconfig/Makefile; then
Michal Kubecek a239c6
        syncconfig="syncconfig"
Michal Kubecek a239c6
    else
Michal Kubecek a239c6
        syncconfig="silentoldconfig"
Michal Kubecek a239c6
    fi
Michal Kubecek a239c6
    make $syncconfig $MAKE_ARGS $KERN_DIRS < /dev/null
Michal Marek 411abb
    %_sourcedir/check-for-config-changes .config.orig .config
Michal Marek 411abb
    rm .config.orig
Michal Marek 411abb
fi
Michal Marek 411abb
Michal Marek 411abb
make prepare $MAKE_ARGS
Michal Marek 411abb
make scripts $MAKE_ARGS
Michal Marek 411abb
krel=$(make -s kernelrelease $MAKE_ARGS)
Michal Marek 411abb
Michal Marek 411abb
if [ "$krel" != "%kernelrelease-%build_flavor" ]; then
Michal Marek 411abb
    echo "Kernel release mismatch: $krel != %kernelrelease-%build_flavor" >&2
Michal Marek 411abb
    exit 1
Michal Marek 411abb
fi
Michal Marek 411abb
Michal Marek 411abb
make clean $MAKE_ARGS
Michal Marek 411abb
Michal Marek 411abb
rm -f source
Takashi Iwai 1fa25f
find . ! -type d ! -name 'Module.base' ! -name 'Module.*-kmp' ! -name 'Module.optional' -printf '%%P\n' \
Michal Marek 4c334f
	> %my_builddir/obj-files
Michal Marek 411abb
Michal Marek 411abb
%build
Michal Marek 411abb
cd %kernel_build_dir
Michal Marek 411abb
source .kernel-binary.spec.buildenv
Michal Marek 411abb
Michal Marek 411abb
# create *.symref files in the tree
Michal Marek 411abb
if test -e %my_builddir/kabi/%cpu_arch/symtypes-%build_flavor; then
Michal Marek 411abb
    %_sourcedir/modversions --unpack . < $_
Michal Marek 411abb
fi
Michal Marek 411abb
Jiri Slaby 21f820
%if "%CONFIG_KMSG_IDS" == "y"
Michal Marek 8eb070
    chmod +x ../scripts/kmsg-doc
Michal Marek d72f6c
    MAKE_ARGS="$MAKE_ARGS D=2"
Michal Marek 411abb
%endif
Michal Marek 411abb
Michal Marek f73822
mkdir -p %_topdir/OTHER
Michal Marek f73822
log=%_topdir/OTHER/make-stderr.log
Michal Marek 819d1f
while true; do
Michal Marek f73822
    make all $MAKE_ARGS 2> >(tee "$log")
Michal Marek 819d1f
    if test "${PIPESTATUS[0]}" -eq 0; then
Michal Marek 819d1f
        break
Michal Marek 819d1f
    fi
Michal Marek eeaaaf
    # In the linux-next and vanilla branches, we try harder to build a
Michal Marek eeaaaf
    # package.
Michal Marek eeaaaf
    if test 0%vanilla_only -gt 0 &&
Michal Marek f73822
			%_sourcedir/try-disable-staging-driver "$log"; then
Michal Marek 819d1f
        echo "Retrying make"
Michal Marek 819d1f
    else
Michal Marek 819d1f
        exit 1
Michal Marek 819d1f
    fi
Michal Marek 819d1f
done
Michal Marek d72f6c
Joao 0b1b4d
# Generate list of symbols that are used to create kernel livepatches
Michal Suchanek e35f14
%if 0%{?klp_symbols}
Joao 0b1b4d
	%_sourcedir/klp-symbols . Symbols.list
Joao 0b1b4d
%endif
Joao 0b1b4d
Michal Marek 411abb
%install
Michal Marek 411abb
6f5ed0
%if 0%{?usrmerged}
6f5ed0
# add symlink for usrmerge so install scripts will just follow the
6f5ed0
# link and end up placing files in /usr/lib. The link will be
6f5ed0
# removed later and is not packaged here.
6f5ed0
mkdir -p %{buildroot}/usr/lib
6f5ed0
ln -s usr/lib %{buildroot}/lib
6f5ed0
%endif
6f5ed0
Michal Marek 411abb
# get rid of /usr/lib/rpm/brp-strip-debug
Michal Marek 411abb
# strip removes too much from the vmlinux ELF binary
Michal Marek 411abb
export NO_BRP_STRIP_DEBUG=true
Jiri Slaby 83af88
export STRIP_KEEP_SYMTAB='*/vmlinux*'
Michal Marek 411abb
Michal Marek e575cc
# /lib/modules/%kernelrelease-%build_flavor/source points to the source
Michal Marek e575cc
# directory installed by kernel-devel. The kernel-%build_flavor-devel package
Michal Marek e575cc
# has a correct dependency on kernel-devel, but the brp check does not see
Michal Marek e575cc
# kernel-devel during build.
Michal Marek 411abb
export NO_BRP_STALE_LINK_ERROR=yes
Michal Marek 411abb
Michal Marek 411abb
cd %kernel_build_dir
Michal Suchanek ce62ae
source .kernel-binary.spec.buildenv
Michal Marek 411abb
Michal Marek 411abb
mkdir -p %buildroot/boot
Michal Marek 411abb
# (Could strip out non-public symbols.)
Michal Marek 411abb
cp -p System.map %buildroot/boot/System.map-%kernelrelease-%build_flavor
Michal Marek 411abb
Michal Marek 411abb
add_vmlinux()
Michal Marek 411abb
{
Michal Marek 26b7a6
    local vmlinux=boot/vmlinux-%kernelrelease-%build_flavor
Michal Marek 411abb
Michal Marek 411abb
    cp vmlinux %buildroot/$vmlinux
Michal Marek 26b7a6
    # make sure that find-debuginfo.sh picks it up. In the filelist, we
Michal Marek 26b7a6
    # mark the file 0644 again
Michal Marek 26b7a6
    chmod +x %buildroot/$vmlinux
Michal Marek 26b7a6
    if test $1 == "--compressed"; then
Michal Marek 381a19
        # avoid using the gzip -n option to make kdump happy (bnc#880848#c20)
Michal Marek 381a19
        ts="$(head -n1 %_sourcedir/source-timestamp)"
Michal Marek 381a19
        touch -d "$ts" %buildroot/$vmlinux
Jiri Slaby c8b2d9
        touch %buildroot/$vmlinux.%{compress_vmlinux}
Michal Marek f928d6
%if 0%{?__debug_package:1}
Michal Marek 381a19
        # compress the vmlinux image after find-debuginfo.sh has processed it
Michal Marek 381a19
%global __debug_install_post %__debug_install_post \
Michal Marek 381a19
%_sourcedir/compress-vmlinux.sh %buildroot/boot/vmlinux-%kernelrelease-%build_flavor
Michal Marek 381a19
%else
Michal Marek 381a19
        %_sourcedir/compress-vmlinux.sh %buildroot/$vmlinux
Michal Marek f928d6
%endif
Michal Marek 26b7a6
        ghost_vmlinux=true
Michal Marek 411abb
    else
Michal Marek 26b7a6
        ghost_vmlinux=false
Michal Marek 411abb
    fi
Michal Marek 411abb
}
Michal Marek 411abb
Michal Marek 411abb
# architecture specifics
Michal Marek 411abb
%ifarch %ix86 x86_64
Michal Marek 411abb
    add_vmlinux --compressed
Michal Suchanek e602b0
    cp -p arch/x86/boot/bzImage %buildroot/boot/%image-%kernelrelease-%build_flavor
Michal Marek 411abb
%endif
Michal Marek c233eb
%ifarch ppc ppc64 ppc64le
Michal Marek 411abb
    add_vmlinux
Michal Marek 411abb
%endif
Michal Marek 411abb
%ifarch s390 s390x
Michal Marek 411abb
    add_vmlinux --compressed
Michal Kubecek 92b52c
    image=image
Michal Kubecek 92b52c
    if test ! -f arch/s390/boot/$image; then
Michal Kubecek 92b52c
        image=bzImage
Michal Kubecek 92b52c
    fi
Michal Suchanek e602b0
    cp -p arch/s390/boot/$image %buildroot/boot/%image-%kernelrelease-%build_flavor
Michal Marek 411abb
    if test -e arch/s390/boot/kerntypes.o; then
Michal Marek 411abb
        cp -p arch/s390/boot/kerntypes.o %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor
Michal Marek 411abb
    elif test -x "$(which dwarfextract 2>/dev/null)"; then
Michal Marek 411abb
	dwarfextract vmlinux %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor || echo "dwarfextract failed ($?)"
Michal Marek 411abb
    fi
Jiri Slaby 21f820
%if "%CONFIG_KMSG_IDS" == "y"
Michal Marek 411abb
    mkdir -p %buildroot/usr/share/man/man9
Michal Marek 411abb
    find man -name '*.9' -exec install -m 644 -D '{}' %buildroot/usr/share/man/man9/ ';'
Michal Marek 411abb
%endif
Michal Suchanek 85a9fc
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150300
Michal Kubecek cd1554
    s390x_vmlinux=arch/s390/boot/compressed/vmlinux
Michal Kubecek cd1554
    if [ ! -f "$s390x_vmlinux" ]; then
Michal Kubecek cd1554
        s390x_vmlinux=arch/s390/boot/vmlinux
Michal Kubecek cd1554
    fi
Michal Kubecek cd1554
    objcopy -R .rodata.compressed "$s390x_vmlinux" %buildroot/boot/zdebug-%kernelrelease-%build_flavor
Michal Suchanek 7f97df
%endif
Michal Marek 411abb
%endif
Alexander Graf 4c08eb
%ifarch %arm
Alexander Graf 4c08eb
    add_vmlinux --compressed
Michal Suchanek e602b0
    cp -p arch/arm/boot/%image %buildroot/boot/%image-%kernelrelease-%build_flavor
Alexander Graf 4c08eb
%endif
Alexander Graf 09220e
%ifarch aarch64
Alexander Graf 09220e
    add_vmlinux --compressed
Michal Suchanek e602b0
    cp -p arch/arm64/boot/%image %buildroot/boot/%image-%kernelrelease-%build_flavor
Alexander Graf 09220e
%endif
Andreas Schwab c2885e
%ifarch riscv64
Andreas Schwab c2885e
    add_vmlinux --compressed
Michal Suchanek e602b0
    cp -p arch/riscv/boot/%image %buildroot/boot/%image-%kernelrelease-%build_flavor
Andreas Schwab c2885e
%endif
Michal Marek 411abb
Guillaume GARDET bac621
# sign the modules, firmware and possibly the kernel in the buildservice
Guillaume GARDET bac621
BRP_PESIGN_FILES=""
Jiri Slaby 21f820
%if "%CONFIG_EFI_STUB" == "y"
6f5ed0
%if 0%{?usrmerged}
Michal Suchanek e602b0
BRP_PESIGN_FILES="%modules_dir/%image"
6f5ed0
%else
Michal Suchanek e602b0
BRP_PESIGN_FILES="/boot/%image-%kernelrelease-%build_flavor"
Guillaume GARDET bac621
%endif
6f5ed0
%endif
Michal Suchanek 971fc3
%ifarch s390x ppc64 ppc64le
6f5ed0
%if 0%{?usrmerged}
Michal Suchanek e602b0
BRP_PESIGN_FILES="%modules_dir/%image"
6f5ed0
%else
Michal Suchanek e602b0
BRP_PESIGN_FILES="/boot/%image-%kernelrelease-%build_flavor"
Marcus Meissner fd52e6
%endif
6f5ed0
%endif
Jiri Slaby 21f820
%if "%CONFIG_MODULE_SIG" == "y"
Guillaume GARDET bac621
BRP_PESIGN_FILES="$BRP_PESIGN_FILES *.ko"
Guillaume GARDET bac621
%endif
Guillaume GARDET bac621
%ifarch %ix86
Guillaume GARDET bac621
# XXX: do not sign on x86, as the repackaging changes kernel-pae
Guillaume GARDET bac621
# from i686 to i586
Guillaume GARDET bac621
BRP_PESIGN_FILES=""
Guillaume GARDET bac621
%endif
Guillaume GARDET bac621
export BRP_PESIGN_FILES
Jiri Slaby 21f820
%if "%{compress_modules}" != "none"
Takashi Iwai cdf580
export BRP_PESIGN_COMPRESS_MODULE=%{compress_modules}
Takashi Iwai cdf580
%endif
Michal Suchanek cee4d8
# Do not sign vanilla kernels released in official projects
Michal Suchanek cee4d8
%if %build_vanilla && ! %vanilla_only
Michal Suchanek cee4d8
BRP_PESIGN_FILES=""
Michal Suchanek cee4d8
%endif
Guillaume GARDET bac621
Michal Marek 2659f6
if test -x /usr/lib/rpm/pesign/gen-hmac; then
Michal Suchanek e602b0
	$_ -r %buildroot /boot/%image-%kernelrelease-%build_flavor
Michal Marek 2659f6
fi
Michal Marek 2659f6
Michal Marek 19b430
# Package the compiled-in certificates as DER files in /etc/uefi/certs
Michal Marek 19b430
# and have mokutil enroll them when the kernel is installed
Michal Suchanek d9a135
echo Signing certificates "%certs"
Michal Suchanek bdc323
if test %CONFIG_MODULE_SIG = "y" -a -d %_sourcedir/.kernel_signing_certs ; then
Michal Suchanek d9a135
    for f in %_sourcedir/.kernel_signing_certs/*.crt; do
Michal Marek 19b430
            mkdir -p %buildroot/etc/uefi/certs
Michal Suchanek d9a135
            cp -v $f %buildroot/etc/uefi/certs
Michal Marek 19b430
    done
Michal Marek 19b430
fi
Michal Marek 19b430
Michal Marek 411abb
cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor
Michal Marek 473f2d
sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor
Michal Marek 473f2d
for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do
Michal Marek 473f2d
	if [ -f "$file" ]; then
Michal Marek 473f2d
		cat "$file"
Michal Marek 473f2d
	fi
Michal Marek 473f2d
done | sed '1i # Generated file - do not edit.' >$sysctl_file
Michal Marek 473f2d
if [ ! -s $sysctl_file ]; then
Michal Marek 473f2d
	rm $sysctl_file
Michal Marek 473f2d
fi
Michal Marek 411abb
Michal Marek 411abb
%if %install_vdso
Michal Marek 411abb
# Install the unstripped vdso's that are linked in the kernel image
Michal Marek 411abb
make vdso_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
Michal Marek ca040a
rm -rf %buildroot/lib/modules/%kernelrelease-%build_flavor/vdso/.build-id
Michal Marek 411abb
%endif
Michal Marek 411abb
Michal Marek 411abb
# Create a dummy initrd with roughly the size the real one will have.
Michal Marek 411abb
# That way, YaST will know that this package requires some additional
Michal Marek 411abb
# space in /boot.
Michal Marek 411abb
dd if=/dev/zero of=%buildroot/boot/initrd-%kernelrelease-%build_flavor \
Michal Marek 411abb
	bs=1024 seek=2047 count=1
Michal Marek ef040f
# Also reserve some space for the kdump initrd
Michal Marek ef040f
cp %buildroot/boot/initrd-%kernelrelease-%build_flavor{,-kdump}
Martin Wilck 9e5e2a
%if 0%{?suse_version} >= 1500
Martin Wilck 9e5e2a
# Use same permissions as dracut
Martin Wilck 9e5e2a
chmod 0600 %buildroot/boot/initrd-%kernelrelease-%build_flavor{,-kdump}
Martin Wilck 9e5e2a
%endif
Michal Marek 411abb
Michal Marek 411abb
if [ %CONFIG_MODULES = y ]; then
Michal Marek 411abb
    mkdir -p %rpm_install_dir/%cpu_arch_flavor
Michal Marek 411abb
    mkdir -p %buildroot/usr/src/linux-obj/%cpu_arch
Michal Suchanek 679f5c
    install -m 755 -D -t %rpm_install_dir/%cpu_arch_flavor/scripts/mod/ scripts/mod/ksym-provides
Michal Marek 411abb
Michal Marek 9a65e4
    gzip -n -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease-%build_flavor.gz
Michal Marek 411abb
Michal Marek 411abb
    make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
Michal Marek 411abb
Michal Marek 411abb
%ifarch s390 s390x
Michal Marek 411abb
    if test -e arch/s390/boot/kerntypes.o; then
Michal Marek 411abb
        :
Michal Marek 411abb
    elif test -x "$(which dwarfextract 2>/dev/null)" -a \
Michal Marek 411abb
	-f %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor; then
Michal Marek 411abb
	find %buildroot -name "*.ko" > kofiles.list
Michal Marek 411abb
	dwarfextract %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor -C kofiles.list || echo "dwarfextract failed ($?)"
Michal Marek 411abb
    fi
Michal Marek 411abb
%endif
Michal Marek 411abb
Michal Marek 411abb
    # Also put the resulting file in %rpm_install_dir/%cpu_arch/%build_flavor
Michal Marek 411abb
    # so that kernel-devel + kernel-%build_flavor is sufficient for building
Michal Marek 411abb
    # modules that have modversions as well.
Michal Marek 411abb
    mkdir -p %rpm_install_dir/%cpu_arch/%build_flavor
Michal Marek 411abb
    cp Module.symvers %rpm_install_dir/%cpu_arch/%build_flavor
Michal Marek 411abb
Joao 0b1b4d
    # List of symbols that are used to generate kernel livepatches
Michal Suchanek e35f14
    %if 0%{?klp_symbols}
Joao 0b1b4d
        cp Symbols.list %rpm_install_dir/%cpu_arch/%build_flavor
Miroslav Benes 98e5a9
        echo %obj_install_dir/%cpu_arch/%build_flavor/Symbols.list > %my_builddir/livepatch-files.no_dir
Miroslav Benes 98e5a9
Jiri Slaby 21f820
        %if "%CONFIG_LIVEPATCH_IPA_CLONES" == "y"
Bernhard M. Wiedemann a898b6
            find %kernel_build_dir -name "*.ipa-clones" ! -size 0 | sed -e 's|^%kernel_build_dir/||' | sort > ipa-clones.list
Miroslav Benes 98e5a9
            cp ipa-clones.list %rpm_install_dir/%cpu_arch/%build_flavor
Miroslav Benes 98e5a9
            echo %obj_install_dir/%cpu_arch/%build_flavor/ipa-clones.list >> %my_builddir/livepatch-files.no_dir
Miroslav Benes 98e5a9
            tar -C %kernel_build_dir --verbatim-files-from -T ipa-clones.list -cf- | tar -C %rpm_install_dir/%cpu_arch/%build_flavor -xvf-
Miroslav Benes 98e5a9
            cat ipa-clones.list | sed -e 's|^|%obj_install_dir/%cpu_arch/%build_flavor/|' >> %my_builddir/livepatch-files.no_dir
Miroslav Benes 98e5a9
        %endif
Joao 0b1b4d
    %endif
Joao 0b1b4d
Michal Marek 411abb
    # Table of types used in exported symbols (for modversion debugging).
Michal Marek 411abb
    %_sourcedir/modversions --pack . > %buildroot/boot/symtypes-%kernelrelease-%build_flavor
Michal Marek 411abb
    if [ -s %buildroot/boot/symtypes-%kernelrelease-%build_flavor ]; then
Michal Marek 9a65e4
	gzip -n -9 %buildroot/boot/symtypes-%kernelrelease-%build_flavor
Michal Marek 411abb
    else
Michal Marek 411abb
	rm -f %buildroot/boot/symtypes-%kernelrelease-%build_flavor
Michal Marek 411abb
    fi
Michal Marek 411abb
Michal Marek 411abb
    # Some architecture's $(uname -m) output is different from the ARCH
Michal Marek 411abb
    # parameter that needs to be passed to kbuild. Create symlinks from
Michal Marek 411abb
    # $(uname -m) to the ARCH directory.
Michal Marek 88a632
    if [ ! -e %rpm_install_dir/%kmp_target_cpu ]; then
Michal Marek 88a632
        ln -sf %cpu_arch %rpm_install_dir/%kmp_target_cpu
Michal Marek 88a632
        ln -sf %cpu_arch %buildroot/usr/src/linux-obj/%kmp_target_cpu
Michal Marek 411abb
    fi
Michal Marek 411abb
Michal Marek 411abb
    # We were building in %my_builddir/linux-%srcversion, but the sources will
Michal Marek 411abb
    # later be installed in /usr/src/linux-%srcversion-%source_rel. Fix up the
Michal Marek 411abb
    # build symlink.
Michal Marek 411abb
    rm -f %buildroot/lib/modules/%kernelrelease-%build_flavor/{source,build}
Michal Marek 411abb
    ln -s %src_install_dir \
Michal Marek 411abb
	%buildroot/lib/modules/%kernelrelease-%build_flavor/source
Michal Marek 411abb
    ln -s %obj_install_dir/%cpu_arch/%build_flavor \
Michal Marek 411abb
	%buildroot/lib/modules/%kernelrelease-%build_flavor/build
Michal Marek 411abb
Michal Marek 411abb
    # Abort if there are any undefined symbols
Michal Marek 411abb
    msg="$(/sbin/depmod -F %buildroot/boot/System.map-%kernelrelease-%build_flavor \
Michal Marek 411abb
			-b %buildroot -ae %kernelrelease-%build_flavor 2>&1)"
Michal Marek 411abb
    if [ $? -ne 0 ] || echo "$msg" | grep  'needs unknown symbol'; then
Michal Marek 411abb
	exit 1
Michal Marek 411abb
    fi
Michal Marek 411abb
Michal Marek 411abb
    %_sourcedir/split-modules -d %buildroot \
Michal Marek 411abb
	-o %my_builddir \
Michal Marek 39da39
	-b %kernel_build_dir \
Jiri Slaby 21f820
%if "%CONFIG_SUSE_KERNEL_SUPPORTED" == "y"
Michal Marek add86b
	-e \
Michal Marek add86b
%endif
Michal Marek 88d5da
%if ! %supported_modules_check
Jiri Slaby 32df88
	-i \
Michal Marek 88d5da
%endif
Jiri Slaby 32df88
	%nil
Michal Marek 411abb
%if ! %split_extra
Michal Marek 411abb
    cat %my_builddir/unsupported-modules >>%my_builddir/main-modules
Michal Marek 411abb
%endif
Michal Marek 411abb
Michal Marek 26e4b7
    # The modules.dep file is sorted randomly which produces strange file
Michal Marek 26e4b7
    # checksums. As the file is not included in the resulting RPM, it's
Michal Marek 26e4b7
    # pointless to rely on its contents. Replacing by zeros to make the
Michal Marek 26e4b7
    # checksums always the same for several builds of the same package.
Michal Suchanek 75691f
    test -s %buildroot/lib/modules/%kernelrelease-%build_flavor/modules.dep && \
87ca1f
    dd if=/dev/zero of=%buildroot/lib/modules/%kernelrelease-%build_flavor/modules.dep ibs=$(stat -c%s %buildroot/lib/modules/%kernelrelease-%build_flavor/modules.dep) count=1
Michal Marek 26e4b7
Michal Marek 411abb
    res=0
Michal Marek 411abb
    if test -e %my_builddir/kabi/%cpu_arch/symvers-%build_flavor; then
Michal Marek 411abb
        # check for kabi changes
Michal Marek 411abb
        %_sourcedir/kabi.pl --rules %my_builddir/kabi/severities \
Michal Marek 411abb
            %my_builddir/kabi/%cpu_arch/symvers-%build_flavor \
Michal Marek 411abb
            Module.symvers || res=$?
Michal Marek 411abb
    fi
Michal Marek 411abb
    if [ $res -ne 0 ]; then
Michal Marek 19e7e5
	# %ignore_kabi_badness is defined in the Kernel:* projects in the
Michal Marek 19e7e5
	# OBS to be able to build the KOTD in spite of kabi errors
Michal Marek 19e7e5
	if [ 0%{?ignore_kabi_badness} -eq 0 -a \
Michal Marek 19e7e5
	     ! -e %my_builddir/kabi/%cpu_arch/ignore-%build_flavor -a \
Michal Marek 19e7e5
	     ! -e %_sourcedir/IGNORE-KABI-BADNESS ]; then
Michal Marek 411abb
	    echo "Create a file IGNORE-KABI-BADNESS in the kernel-source" \
Michal Marek 411abb
		 "directory to build this kernel even though its badness is" \
Michal Marek 411abb
		 "higher than allowed for an official kernel."
Michal Marek 411abb
	   exit 1
Michal Marek 411abb
	fi
Michal Marek 411abb
    fi
Michal Marek 411abb
Takashi Iwai e41de0
    # Check the license in each module
Takashi Iwai e41de0
    if ! sh %_sourcedir/check-module-license %buildroot; then
Takashi Iwai e41de0
	echo "Please fix the missing licenses!"
Jiri Slaby 21f820
%if "%CONFIG_SUSE_KERNEL_SUPPORTED" == "y"
Takashi Iwai e41de0
	exit 1
Takashi Iwai e41de0
%endif
Takashi Iwai e41de0
    fi
Takashi Iwai e41de0
Jiri Slaby 07da11
    # These files are required for building external modules
Michal Kubecek fe37c1
    for FILE in arch/powerpc/lib/crtsavres.o arch/arm64/kernel/ftrace-mod.o \
Michal Kubecek fe37c1
		arch/*/kernel/macros.s scripts/module.lds
Michal Kubecek fe37c1
    do
Jiri Slaby 07da11
	    if [ -f %kernel_build_dir/$FILE ]; then
Jiri Slaby 07da11
		echo $FILE >> %my_builddir/obj-files
Jiri Slaby 07da11
	    fi
Jiri Slaby 07da11
    done
Michal Marek dd227e
Michal Suchanek 939a79
    tar --exclude=\*.ipa-clones --exclude=.config.old --exclude=.kernel-binary.spec.buildenv \
Michal Suchanek 68fa06
        --exclude=.kernel_signing_key.pem --exclude=.kernel.genkey \
Michal Suchanek 939a79
        -cf - -T %my_builddir/obj-files | \
Michal Marek 411abb
	tar -xf - -C %rpm_install_dir/%cpu_arch_flavor
Michal Marek 411abb
    # bnc#507084
Michal Marek 411abb
    find %rpm_install_dir/%cpu_arch_flavor/scripts -type f -perm -111 | \
Michal Marek 411abb
        while read f; do
Michal Marek 411abb
            case "$(file -b "$f")" in
Michal Marek 411abb
            ELF\ *\ executable*)
Michal Marek 411abb
                strip "$f"
Michal Marek 411abb
            esac
Michal Marek 411abb
        done
Michal Suchanek b453c7
Michal Marek 8eb070
    # Recreate the generated Makefile with correct path
Michal Suchanek b453c7
    #
Michal Suchanek d9209e
    # Linux 5.13 no longer has mkmakefile
Michal Suchanek b453c7
    if [ -f ../scripts/mkmakefile ] ; then
Michal Suchanek b453c7
        sh ../scripts/mkmakefile ../../../%{basename:%src_install_dir} \
Michal Suchanek b453c7
            %rpm_install_dir/%cpu_arch_flavor \
Michal Suchanek b453c7
            $(echo %srcversion | sed -r 's/^([0-9]+)\.([0-9]+).*/\1 \2/')
Michal Suchanek 6b30fe
    else
Michal Suchanek 6b30fe
       echo include ../../../%{basename:%src_install_dir}/Makefile > %rpm_install_dir/%cpu_arch_flavor/Makefile
Michal Suchanek b453c7
    fi
Michal Marek 411abb
fi
Michal Marek 411abb
Michal Suchanek 0b0b5c
rm -rf %{buildroot}/lib/firmware
6f5ed0
%if 0%{?usrmerged}
6f5ed0
# remove usrmerge aid
6f5ed0
rm %{buildroot}/lib
6f5ed0
%endif
Michal Suchanek 0b0b5c
Michal Marek 411abb
add_dirs_to_filelist() {
Michal Marek 411abb
    sed -rn '
Michal Marek 411abb
        # print file name
Michal Marek 411abb
        p
Michal Marek 411abb
        # remove filelist macros
Michal Marek 411abb
        s:%%[a-z]+(\([^)]+\))? ?::g
Michal Marek 411abb
        # add %%dir prefix
Michal Marek 411abb
        s:^:%%dir :
Michal Marek 411abb
        # print all parents
Michal Marek 411abb
        :a
Michal Marek 411abb
            # skip directories owned by other packages
6f5ed0
            s:^%%dir (/boot|/etc|(/usr)?/lib/(modules|firmware)|/usr/src)/[^/]+$::
Michal Marek 411abb
            s:/[^/]+$::p
Michal Marek 411abb
        ta
Michal Marek 411abb
    ' "$@" | sort -u
Michal Marek 411abb
}
Michal Marek 411abb
Michal Marek 411abb
# Collect the file lists.
Miroslav Benes 98e5a9
if [ -f %my_builddir/livepatch-files.no_dir ] ; then
Miroslav Benes 98e5a9
    cat %my_builddir/livepatch-files.no_dir | add_dirs_to_filelist > %my_builddir/livepatch-files
Miroslav Benes 98e5a9
fi
Miroslav Benes 98e5a9
Michal Suchanek d718cd
# does not exist for non-modularized kernels
Michal Suchanek d718cd
%if 0%{?usrmerged}
Michal Suchanek d718cd
        mkdir -p %{buildroot}%modules_dir
Michal Suchanek d718cd
%endif
Michal Marek 3375bd
shopt -s nullglob dotglob
Michal Marek 411abb
> %my_builddir/kernel-devel.files
6f5ed0
{
6f5ed0
    echo "%modules_dir/build"
6f5ed0
    echo "%modules_dir/source"
6f5ed0
    cd %buildroot
6f5ed0
    for file in boot/symtypes*; do
6f5ed0
%if 0%{?usrmerged}
6f5ed0
        l="${file##*/}"
6f5ed0
        l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
6f5ed0
        mv "$file" "%{buildroot}$l"
6f5ed0
        ln -s "..$l" $file
6f5ed0
        echo "$l"
6f5ed0
        echo "%%ghost /$file"
6f5ed0
%else
6f5ed0
        echo "/$file"
6f5ed0
%endif
6f5ed0
    done
6f5ed0
} | add_dirs_to_filelist >%my_builddir/kernel-devel.files
Michal Suchanek 558776
( cd %buildroot ; find .%obj_install_dir/%cpu_arch_flavor -type f ; ) | \
Michal Suchanek 558776
sed -e 's/^[.]//' | grep -v -e '[.]ipa-clones$' -e '/Symbols[.]list$' -e '/ipa-clones[.]list$'| \
Michal Suchanek 558776
add_dirs_to_filelist >> %my_builddir/kernel-devel.files
Michal Marek 411abb
Michal Suchanek e2f37d
{   echo %ghost /boot/%image
Michal Suchanek e2f37d
    echo %ghost /boot/initrd
Michal Suchanek 606c9d
    cd %buildroot
Michal Marek ef040f
    for f in boot/*; do
6f5ed0
        l="${f##*/}"
6f5ed0
        l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
Michal Marek ef040f
        if test -L "$f"; then
Michal Marek ef040f
            echo "%%ghost /$f"
Michal Marek ef040f
            continue
Michal Marek ef040f
        elif test ! -f "$f"; then
Michal Marek ef040f
            continue
Michal Marek ef040f
        fi
Michal Marek ef040f
        case "$f" in
Michal Marek ef040f
        boot/initrd-*)
Michal Marek ef040f
            echo "%%ghost /$f"
Michal Marek 26b7a6
            continue
Michal Marek 26b7a6
            ;;
Jiri Slaby c8b2d9
        boot/vmlinux-*.%{compress_vmlinux})
Michal Marek 26b7a6
            ;;
Michal Marek 26b7a6
        boot/vmlinux-*)
Michal Marek 26b7a6
            if $ghost_vmlinux; then
6f5ed0
                # fall through to mark next echo as %ghost
6f5ed0
                echo -n "%%ghost "
Michal Marek 26b7a6
            fi
Michal Marek ef040f
            ;;
6f5ed0
%if 0%{?usrmerged}
6f5ed0
        boot/vmlinuz-*)
6f5ed0
            echo -n "%%attr(0644, root, root) "
6f5ed0
            ;;
6f5ed0
%endif
Michal Marek f1e303
        boot/symtypes*)
6f5ed0
%if 0%{?usrmerged}
6f5ed0
            echo "%exclude $l"
6f5ed0
%endif
Michal Marek f1e303
            continue
Michal Marek f1e303
            ;;
Michal Marek ef040f
        esac
6f5ed0
%if 0%{?usrmerged}
6f5ed0
        mv "$f" "./$l"
6f5ed0
        ln -s "..$l" $f
6f5ed0
        # the find in the CONFIG_MODULES condition below also finds the files
6f5ed0
        # but there's sort -u later, so this is ok
6f5ed0
        echo "$l" # note: must be first after case statement above
6f5ed0
        echo "%%ghost /$f"
6f5ed0
%else
Michal Marek ef040f
        echo "%%attr(0644, root, root) /$f"
6f5ed0
%endif
Michal Marek ef040f
    done
Michal Marek 411abb
Michal Marek 411abb
    if [ %CONFIG_MODULES = y ]; then
Jiri Slaby 9c7ade
	MODULES=%{?usrmerged:usr/}lib/modules/%kernelrelease-%build_flavor
Jiri Slaby 9c7ade
	find "$MODULES" \
Jiri Slaby 9c7ade
%if 0%{?separate_vdso}
Jiri Slaby 9c7ade
	    -path "$MODULES/vdso" -prune -o \
Jiri Slaby 9c7ade
%endif
Michal Marek 411abb
	    -type d -o \
Michal Marek 411abb
	    \( -path '*/modules.*' ! -path '*/modules.order' \
Jiri Slaby eb88df
	     ! -path '*/modules.builtin' \
Jiri Slaby eb88df
	     ! -path '*/modules.builtin.modinfo' \) -printf '%%%%ghost /%%p\n' \
6f5ed0
	       -o -name '*.ko' -prune \
Jiri Slaby 583c9b
	       -o \( -type f \
6f5ed0
%if 0%{?usrmerged}
Jiri Slaby 583c9b
		! -path '*/symtypes*' ! -path '*/vmlinu*' \
6f5ed0
%endif
Jiri Slaby 583c9b
		\) -printf '/%%p\n'
Michal Marek 411abb
	cat %my_builddir/base-modules
Michal Marek 411abb
    fi
Michal Marek ef1b7d
    if test %CONFIG_MODULE_SIG = "y" -a -d etc/uefi/certs; then
Michal Marek 19b430
        find etc/uefi/certs -type f -printf '/%%p\n'
Michal Marek 19b430
    fi
Michal Marek f68583
    if test -d lib/firmware/%kernelrelease-%build_flavor; then
Michal Marek f68583
        echo "%%dir /lib/firmware/%kernelrelease-%build_flavor"
Michal Marek f68583
        cat %my_builddir/base-firmware
Michal Marek f68583
    fi
Michal Marek 411abb
    if [ -e .%_docdir/%name ]; then
Michal Marek 411abb
	echo "%%doc %_docdir/%name"
Michal Marek 411abb
    fi
Michal Marek f1e303
} | sort -u | add_dirs_to_filelist >%my_builddir/kernel-base.files
Michal Marek 411abb
Michal Marek f68583
{
Michal Suchanek d718cd
    add_dirs_to_filelist %my_builddir/kernel-base.files
Michal Suchanek d718cd
    if [ %CONFIG_MODULES = y ]; then
Michal Suchanek d718cd
        add_dirs_to_filelist %my_builddir/main-modules
Michal Suchanek d718cd
    fi
Takashi Iwai c03eb7
    if test -d %buildroot/lib/firmware/%kernelrelease-%build_flavor; then
Takashi Iwai a09ef6
	echo "/lib/firmware/%kernelrelease-%build_flavor"
Takashi Iwai a09ef6
    fi
Michal Marek f68583
} > %my_builddir/kernel-main.files
Takashi Iwai 1fa25f
Michal Marek 411abb
%if %split_extra
Michal Marek 411abb
    add_dirs_to_filelist %my_builddir/unsupported-modules > %my_builddir/kernel-extra.files
Takashi Iwai 1fa25f
%if %split_extra && %split_optional
Takashi Iwai 1fa25f
    add_dirs_to_filelist %my_builddir/optional-modules > %my_builddir/kernel-optional.files
Takashi Iwai 1fa25f
%endif
Martin Wilck 0d585a
Martin Wilck 0d585a
%if 0%{?sle_version} >= 150000
Martin Wilck 0d585a
    # By default, loading unsupported modules is disabled on SLE through
Martin Wilck 0d585a
    # /etc/modprobe.d/10-unsupported-modules.conf from the suse-module-tools
Martin Wilck 0d585a
    # package.
Martin Wilck 0d585a
    # modules in kernel-$flavor-extra don't have the supported flag set,
Martin Wilck 0d585a
    # yet loading them should be possible if the package is installed.
Martin Wilck 0d585a
    # CAUTION PACKAGERS: The file content below must not change between
Martin Wilck 0d585a
    # kernel versions, otherwise file conflicts might arise with
Martin Wilck 0d585a
    # multiversion(kernel).
Martin Wilck 0d585a
Michal Suchanek c80b5d
    modprobe_d_dir=/etc/modprobe.d
Michal Suchanek c80b5d
    %if 0%{?sle_version} > 150300
Michal Suchanek c80b5d
    modprobe_d_dir=/lib/modprobe.d
Michal Suchanek c80b5d
    %endif
Michal Suchanek c80b5d
    %if 0%{?usrmerged}
Michal Suchanek c80b5d
    modprobe_d_dir=/usr/lib/modprobe.d
Michal Suchanek c80b5d
    %endif
Michal Suchanek c80b5d
Michal Suchanek c80b5d
    mkdir -p %buildroot$modprobe_d_dir
Michal Suchanek c80b5d
    cat >%buildroot$modprobe_d_dir/20-kernel-%{build_flavor}-extra.conf <
Martin Wilck 0d585a
# This file overrides the default from 10-unsupported-modules.conf.
Martin Wilck 0d585a
# This is necessary to load kernel modules from the
Martin Wilck 0d585a
# kernel-%{build_flavor}-extra package.
Martin Wilck 0d585a
#
Martin Wilck 0d585a
# WARNING: loading unsupported modules may compromise SLE support.
Martin Wilck 0d585a
# Please read the comments in 10-unsupported-modules.conf.
Martin Wilck 0d585a
allow_unsupported_modules 1
Martin Wilck 0d585a
EOF
Michal Suchanek c80b5d
    echo "%%dir $modprobe_d_dir" >> %my_builddir/kernel-extra.files
Michal Suchanek c80b5d
    echo "%%config(noreplace) $modprobe_d_dir/20-kernel-%{build_flavor}-extra.conf" >> %my_builddir/kernel-extra.files
Martin Wilck 0d585a
%endif
Michal Marek 411abb
%endif
Michal Marek 39da39
for f in %my_builddir/*-kmp-modules; do
Michal Marek 39da39
	f2=${f%%-modules}.files
Michal Marek 39da39
	add_dirs_to_filelist "$f" >"$f2"
Michal Marek 39da39
done
Michal Marek 39da39
Michal Suchanek 2cb2be
if [ %CONFIG_MODULES = y ]; then
6f5ed0
  install -m 644 %_sourcedir/modules.fips %{buildroot}%modules_dir/modules.fips
6f5ed0
  echo %modules_dir/modules.fips >> %my_builddir/kernel-base.files
6f5ed0
  echo %modules_dir/modules.fips >> %my_builddir/kernel-main.files
Michal Suchanek 2cb2be
fi
Michal Suchanek f70bab
Michal Marek 411abb
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
Michal Marek 411abb
# much, but it keeps rpmlint from breaking the package build. Note that we skip
Michal Marek 411abb
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
6f5ed0
%fdupes %buildroot%modules_dir
Michal Marek 411abb
Michal Suchanek e98096
%pre
Michal Suchanek e98096
%if "%build_flavor" != "zfcpdump"
Michal Suchanek e98096
/usr/lib/module-init-tools/kernel-scriptlets/rpm-pre --name "%name" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Michal Suchanek e98096
%endif
Michal Suchanek e98096
%post
Michal Suchanek e98096
%if "%build_flavor" != "zfcpdump"
Michal Suchanek e98096
/usr/lib/module-init-tools/kernel-scriptlets/rpm-post --name "%name" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Michal Suchanek e98096
%endif
Michal Suchanek e98096
%preun
Michal Suchanek e98096
%if "%build_flavor" != "zfcpdump"
Michal Suchanek ab8dd2
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/rpm-preun --name "%name" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Michal Suchanek e98096
%endif
Michal Suchanek e98096
%postun
Michal Suchanek e98096
%if "%build_flavor" != "zfcpdump"
Michal Suchanek ab8dd2
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/rpm-postun --name "%name" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Michal Suchanek e98096
%endif
Michal Suchanek e98096
%posttrans
Michal Suchanek e98096
%if "%build_flavor" != "zfcpdump"
Michal Suchanek e98096
/usr/lib/module-init-tools/kernel-scriptlets/rpm-posttrans --name "%name" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Michal Suchanek e98096
%endif
Michal Marek 411abb
%files -f kernel-main.files
Andreas Jaeger e7e374
%defattr(-, root, root)
Michal Marek aebe2d
Michal Marek 411abb
%package extra
Michal Marek 411abb
Summary:        @SUMMARY@ - Unsupported kernel modules
Michal Marek 411abb
Group:          System/Kernel
77b5f8
URL:            https://www.kernel.org/
Michal Suchanek b4ec51
Provides:       %name-extra_%_target_cpu = %version-%source_rel
Michal Marek 411abb
Provides:       kernel-extra = %version-%source_rel
Michal Marek 0b9e9a
Provides:       multiversion(kernel)
Michal Suchanek b4ec51
Requires:       %{name}_%_target_cpu = %version-%source_rel
Michal Marek 411abb
Requires(pre):  coreutils awk
Michal Marek 91f0a2
Requires(post): modutils
Michal Marek 411abb
Requires(post): perl-Bootloader
Michal Suchanek e356c9
Requires(post): dracut
Michal Marek b6f8d7
@PROVIDES_OBSOLETES_EXTRA@
Michal Marek ffb73e
%obsolete_rebuilds %name-extra
Takashi Iwai 8f05b9
Supplements:    packageand(product(SLED):%{name}_%_target_cpu)
Takashi Iwai 8f05b9
Supplements:    packageand(product(sle-we):%{name}_%_target_cpu)
c60d87
Supplements:    packageand(product(Leap):%{name}_%_target_cpu)
Michal Marek 411abb
%ifarch %ix86
Michal Marek 411abb
Conflicts:      libc.so.6()(64bit)
Michal Marek 411abb
%endif
Michal Marek 411abb
Michal Marek 411abb
%description extra
Michal Marek 411abb
@DESCRIPTION@
Michal Marek 411abb
Cyril Hrubis 8719d6
This package contains additional modules not supported by SUSE.
Michal Marek 411abb
Michal Marek 411abb
Michal Marek aebe2d
%source_timestamp
Michal Marek aebe2d
Michal Suchanek e98096
%pre extra
Michal Suchanek e98096
/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-extra" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Michal Marek aebe2d
Michal Suchanek e98096
%post extra
Michal Suchanek e98096
/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-extra" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Michal Suchanek 5d1f67
Michal Suchanek 5d1f67
%preun extra
Michal Suchanek ab8dd2
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-extra" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Michal Suchanek 5d1f67
Michal Suchanek 5d1f67
%postun extra
Michal Suchanek ab8dd2
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-extra" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Michal Suchanek e98096
Michal Suchanek e98096
%posttrans extra
Michal Suchanek e98096
/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-extra" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Michal Marek 411abb
Michal Marek 411abb
%if %split_extra
Michal Marek aebe2d
Michal Marek 411abb
%files extra -f kernel-extra.files
Michal Marek 411abb
%defattr(-, root, root)
Michal Marek 411abb
%endif
Michal Marek 411abb
Takashi Iwai 1fa25f
%if %split_extra && %split_optional
Takashi Iwai 1fa25f
%package optional
Takashi Iwai 1fa25f
Summary:        @SUMMARY@ - Optional kernel modules
Takashi Iwai 1fa25f
Group:          System/Kernel
77b5f8
URL:            https://www.kernel.org/
Takashi Iwai 1fa25f
Provides:       %name-optional_%_target_cpu = %version-%source_rel
Takashi Iwai 1fa25f
Provides:       kernel-optional = %version-%source_rel
Takashi Iwai 1fa25f
Provides:       multiversion(kernel)
Takashi Iwai 1fa25f
Requires:       %name-extra_%_target_cpu = %version-%source_rel
Takashi Iwai 1fa25f
Requires(pre):  coreutils awk
Takashi Iwai 1fa25f
Requires(post): modutils
Takashi Iwai 1fa25f
Requires(post): perl-Bootloader
Michal Suchanek e356c9
Requires(post): dracut
Takashi Iwai 1fa25f
@PROVIDES_OBSOLETES_OPTIONAL@
Takashi Iwai 1fa25f
%obsolete_rebuilds %name-optional
Takashi Iwai 3cb794
Supplements:    packageand(product(Leap):%{name}_%_target_cpu)
Takashi Iwai 1fa25f
%ifarch %ix86
Takashi Iwai 1fa25f
Conflicts:      libc.so.6()(64bit)
Takashi Iwai 1fa25f
%endif
Takashi Iwai 1fa25f
Takashi Iwai 1fa25f
%description optional
Takashi Iwai 1fa25f
@DESCRIPTION@
Takashi Iwai 1fa25f
Takashi Iwai 1fa25f
This package contains optional modules only for openSUSE Leap.
Takashi Iwai 1fa25f
Takashi Iwai 1fa25f
Takashi Iwai 1fa25f
%source_timestamp
Takashi Iwai 1fa25f
Michal Suchanek e98096
%pre optional
Michal Suchanek e98096
/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-optional" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Michal Suchanek 5d1f67
Michal Suchanek e98096
%post optional
Michal Suchanek e98096
/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-optional" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Michal Suchanek 5d1f67
Michal Suchanek 5d1f67
%preun optional
Michal Suchanek ab8dd2
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-optional" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Michal Suchanek 5d1f67
Michal Suchanek 5d1f67
%postun optional
Michal Suchanek ab8dd2
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-optional" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Michal Suchanek e98096
Michal Suchanek e98096
%posttrans optional
Michal Suchanek e98096
/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-optional" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Takashi Iwai 1fa25f
Takashi Iwai 1fa25f
%files optional -f kernel-optional.files
Takashi Iwai 1fa25f
%defattr(-, root, root)
Takashi Iwai 1fa25f
%endif
Takashi Iwai 1fa25f
Jiri Slaby 21f820
%if "%CONFIG_KMSG_IDS" == "y"
Michal Marek aebe2d
Michal Marek 411abb
%package man
David Sterba 9050a3
Summary:        The collection of man pages generated by the kmsg script
Michal Marek 411abb
Group:          System/Kernel
Michal Marek 411abb
Michal Marek 411abb
%description man
Michal Marek 411abb
This package includes the man pages that have been generated from the
Michal Marek 411abb
kmsg message documentation comments.
Michal Marek 411abb
Michal Marek 411abb
Michal Marek aebe2d
%source_timestamp
Michal Marek 411abb
%files man
Michal Marek 411abb
%defattr(-,root,root)
Michal Marek 411abb
/usr/share/man/man9/*
Michal Marek 411abb
%endif
Michal Marek 411abb
Jiri Slaby 9c7ade
%if 0%{?separate_vdso}
Jiri Slaby 9c7ade
%package vdso
Jiri Slaby 9c7ade
Summary:        vdso binaries for debugging purposes
Jiri Slaby 9c7ade
Group:          System/Kernel
Jiri Slaby 9c7ade
Jiri Slaby 9c7ade
%description vdso
Jiri Slaby 9c7ade
This package includes the vdso binaries. They can be used for debugging. The
Jiri Slaby 9c7ade
actual binary linked to the programs is loaded from the in-memory image, not
Jiri Slaby 9c7ade
from this package.
Jiri Slaby 9c7ade
Jiri Slaby 9c7ade
Jiri Slaby 9c7ade
%source_timestamp
Jiri Slaby 9c7ade
%files vdso
Jiri Slaby 9c7ade
%defattr(-,root,root)
Jiri Slaby 9c7ade
/%{?usrmerged:usr/}lib/modules/%kernelrelease-%build_flavor/vdso/
Jiri Slaby 9c7ade
%endif
Jiri Slaby 9c7ade
Michal Marek 411abb
%package devel
Michal Marek 411abb
Summary:        Development files necessary for building kernel modules
Michal Marek 411abb
Group:          Development/Sources
Michal Marek 411abb
Provides:       %name-devel = %version-%source_rel
Michal Marek 0b9e9a
Provides:       multiversion(kernel)
Michal Marek fbbc98
%if ! %build_vanilla
Michal Marek 411abb
Requires:       kernel-devel%variant = %version-%source_rel
Michal Marek a3cd25
Recommends:     make
Michal Marek a3cd25
Recommends:     gcc
Michal Marek a3cd25
Recommends:     perl
Jiri Kosina cad1ef
# for objtool
Jiri Kosina cad1ef
Requires:	libelf-devel
Michal Marek 411abb
Supplements:    packageand(%name:kernel-devel%variant)
Michal Marek fbbc98
%else
Michal Marek fbbc98
Requires:       kernel-source-vanilla = %version-%source_rel
Michal Marek fbbc98
Supplements:    packageand(%name:kernel-source-vanilla)
Michal Marek fbbc98
%endif
Michal Suchanek 8ba338
%if "%CONFIG_DEBUG_INFO_BTF_MODULES" == "y"
Michal Suchanek c88d34
Requires:       dwarves >= 1.22
Michal Suchanek 8ba338
%endif
Michal Marek b6f8d7
@PROVIDES_OBSOLETES_DEVEL@
Michal Marek ffb73e
%obsolete_rebuilds %name-devel
Michal Marek 252056
PreReq:         coreutils
Michal Marek 411abb
Michal Marek 411abb
%description devel
Michal Marek 411abb
This package contains files necessary for building kernel modules (and
Michal Marek 411abb
kernel module packages) against the %build_flavor flavor of the kernel.
Michal Marek 411abb
Michal Marek 411abb
Michal Marek aebe2d
%source_timestamp
Michal Marek 1cf983
Jiri Slaby 21f820
%if "%CONFIG_MODULES" == "y"
Michal Marek aebe2d
Michal Suchanek 692d38
%pre devel
Michal Marek aebe2d
Michal Suchanek 692d38
# handle update from an older kernel-source with linux-obj as symlink
Michal Suchanek 692d38
if [ -h /usr/src/linux-obj ]; then
Michal Suchanek 692d38
    rm -vf /usr/src/linux-obj
Michal Suchanek 692d38
fi
Michal Suchanek 692d38
Michal Suchanek 692d38
%post devel
Michal Suchanek 692d38
%relink_function
Michal Marek aebe2d
Michal Suchanek 692d38
relink ../../linux-%{kernelrelease}%{variant}-obj/"%cpu_arch_flavor" /usr/src/linux-obj/"%cpu_arch_flavor"
Michal Marek aebe2d
Michal Marek 411abb
%files devel -f kernel-devel.files
Michal Marek 411abb
%defattr(-,root,root)
Michal Marek 411abb
%dir /usr/src/linux-obj
Michal Marek 411abb
%dir /usr/src/linux-obj/%cpu_arch
Michal Marek 411abb
%ghost /usr/src/linux-obj/%cpu_arch_flavor
Michal Suchanek a1728f
%exclude %obj_install_dir/%cpu_arch_flavor/Symbols.list
Jiri Slaby 21f820
%if "%kmp_target_cpu" != "%cpu_arch"
Michal Marek 88a632
%obj_install_dir/%kmp_target_cpu
Michal Marek 88a632
/usr/src/linux-obj/%kmp_target_cpu
Michal Marek 411abb
%endif
Michal Marek 411abb
Nicolai Stange 9d4124
%if "%livepatch" != "" && "%CONFIG_SUSE_KERNEL_SUPPORTED" == "y" && (("%variant" == "" && %build_default) || ("%variant" == "-rt" && 0%livepatch_rt))
Jiri Slaby 21f820
%if "%livepatch" == "kgraft"
Michal Suchanek 88241e
%define patch_package %{livepatch}-patch
Michal Suchanek 88241e
%else
Michal Suchanek 88241e
%define patch_package kernel-%{livepatch}
Michal Suchanek 88241e
%endif
Michal Suchanek 88241e
%package %{livepatch}
Michal Suchanek 88241e
Summary:        Metapackage to pull in matching %patch_package package
Michal Marek 0439a4
Group:          System/Kernel
Michal Suchanek 16f681
Requires:       %{patch_package}-%(echo %{version}-%{source_rel} | sed 'y/\./_/')-%{build_flavor}
Nicolai Stange 9d4124
Provides:       multiversion(kernel)
Nicolai Stange 9d4124
%if "%variant" != "-rt"
Libor Pechacek 050081
Provides:	kernel-default-kgraft = %version
Libor Pechacek 050081
Provides:	kernel-xen-kgraft = %version
Michal Suchanek 25f769
%if "%livepatch" != "kgraft"
Libor Pechacek 050081
Obsoletes:	kernel-default-kgraft < %version
Libor Pechacek 050081
Obsoletes:	kernel-xen-kgraft < %version
Michal Suchanek 25f769
%endif
Nicolai Stange 9d4124
%endif
Michal Marek 0439a4
Michal Suchanek 88241e
%description %{livepatch}
Michal Suchanek 88241e
This is a metapackage that pulls in the matching %patch_package package for a
Michal Marek 0439a4
given kernel version. The advantage of the metapackage is that its name is
Michal Suchanek 36acf9
static, unlike the %{patch_package}-<kernel-version>-flavor package names.
Michal Marek 0439a4
Michal Suchanek 88241e
%files %{livepatch}
Michal Marek 0439a4
# rpmlint complains about empty packages, so lets own something
Michal Marek 0439a4
%defattr(-, root, root)
6f5ed0
%dir %modules_dir
Michal Marek 9bab96
%endif
Michal Marek 0439a4
Michal Suchanek 16f681
%if 0%{?klp_symbols} && "%livepatch" != ""
Michal Suchanek 88241e
%package %{livepatch}-devel
Michal Suchanek 88241e
Summary:	Kernel symbols file used during kGraft patch development
Joao 0b1b4d
Group:		System/Kernel
Joao 0b1b4d
Provides:	klp-symbols = %version
Joao 0b1b4d
Michal Suchanek 88241e
%description %{livepatch}-devel
Joao 0b1b4d
This package brings a file named Symbols.list, which contains a list of all
Joao 0b1b4d
kernel symbols and its respective kernel object . This list is to be used by
Joao 0b1b4d
the klp-convert tool, which helps livepatch developers by enabling automatic
Joao 0b1b4d
symbol resolution.
Joao 0b1b4d
Miroslav Benes 98e5a9
%files %{livepatch}-devel -f livepatch-files
Joao 0b1b4d
%endif
Joao 0b1b4d
Jiri Slaby 21f820
%if "%CONFIG_SUSE_KERNEL_SUPPORTED" == "y"
Michal Marek 09cb6b
# BEGIN KMP
Michal Marek 09cb6b
%package -n @KMP_NAME@-%build_flavor
Michal Marek 09cb6b
Summary:        @KMP_SUMMARY@
Michal Marek 09cb6b
Group:          System/Kernel
Michal Suchanek b4ec51
Requires:       %name = %version-%source_rel
Michal Suchanek b4ec51
Provides:       @KMP_NAME@ = %version-%source_rel
Michal Marek a3cd25
Provides:       multiversion(kernel)
Michal Marek 58d21f
# tell weak-modules2 to ignore this package
Michal Marek 58d21f
Provides:       kmp_in_kernel
Michal Marek 58d21f
Requires(post): suse-module-tools >= 12.4
Jeff Mahoney 02b773
Enhances:	%name
Jeff Mahoney 02b773
Supplements:	packageand(%name:%@KMP_NAME@-%build_flavor)
Michal Marek 88d612
@KMP_DEPS@
Michal Marek 09cb6b
Michal Marek 09cb6b
%description -n @KMP_NAME@-%build_flavor
Michal Marek 09cb6b
@KMP_DESCRIPTION@
Michal Marek 09cb6b
Michal Suchanek e98096
%pre -n @KMP_NAME@-%build_flavor
Michal Suchanek e98096
/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "@KMP_NAME@-%build_flavor" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Michal Marek 95f8b9
Michal Suchanek e98096
%post -n @KMP_NAME@-%build_flavor
Michal Suchanek e98096
/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "@KMP_NAME@-%build_flavor" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Michal Marek 95f8b9
Michal Marek 95f8b9
%preun -n @KMP_NAME@-%build_flavor
Michal Suchanek ab8dd2
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "@KMP_NAME@-%build_flavor" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Michal Marek 95f8b9
Michal Marek 95f8b9
%postun -n @KMP_NAME@-%build_flavor
Michal Suchanek ab8dd2
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "@KMP_NAME@-%build_flavor" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Michal Suchanek e98096
Michal Suchanek e98096
%posttrans -n @KMP_NAME@-%build_flavor
Michal Suchanek e98096
/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "@KMP_NAME@-%build_flavor" \
Michal Suchanek e98096
  --version "%version" --release "%release" --kernelrelease "%kernelrelease" \
Michal Suchanek e98096
  --image "%image" --flavor "%build_flavor" --variant "%variant" \
Michal Suchanek e98096
  --usrmerged "0%{?usrmerged}" --certs "%certs" "$@"
Michal Marek 95f8b9
Michal Marek 09cb6b
%files -n @KMP_NAME@-%build_flavor -f @KMP_NAME@.files
Michal Marek 09cb6b
%defattr(-, root, root)
Michal Marek 09cb6b
# END KMP
Michal Marek a259f7
%endif # %CONFIG_SUSE_KERNEL_SUPPORTED
Michal Marek 1cf983
%endif # %CONFIG_MODULES
Michal Marek 1cf983
Michal Marek 411abb
%changelog