# # This file is not needed for review, and is only used for the # shell API plugin. No need to modify it or anything. # declare -f +x module PATH=/bin:/usr/bin:/sbin/:/usr/sbin declare -A FR_FLAGS FR_FLAGS[EXARCH]='' FR_FLAGS[EPEL6]='' FR_FLAGS[EPEL7]='' FR_FLAGS[DISTTAG]='' FR_FLAGS[BATCH]='' declare -A FR_SETTINGS FR_SETTINGS[bz_url]="https://bugzilla.redhat.com" FR_SETTINGS[log]="" FR_SETTINGS[cache]="" FR_SETTINGS[resultdir]="" FR_SETTINGS[init_done]="True" FR_SETTINGS[uniqueext]="" FR_SETTINGS[configdir]="" FR_SETTINGS[log_level]="20" FR_SETTINGS[prebuilt]="True" FR_SETTINGS[verbose]="" FR_SETTINGS[name]="kernel" FR_SETTINGS[use_colors]="" FR_SETTINGS[session_log]="/var/lib/copr-rpmbuild/results/cache/fedora-review.log" FR_SETTINGS[bug]="" FR_SETTINGS[url]="" FR_SETTINGS[copr_build_descriptor]="" FR_SETTINGS[list_checks]="" FR_SETTINGS[list_flags]="" FR_SETTINGS[list_plugins]="" FR_SETTINGS[version]="" FR_SETTINGS[flags]="" FR_SETTINGS[repo]="" FR_SETTINGS[mock_config]="/var/lib/copr-rpmbuild/results/configs/child.cfg" FR_SETTINGS[no_report]="" FR_SETTINGS[nobuild]="" FR_SETTINGS[mock_options]="--no-cleanup-after --no-clean --plugin-option=tmpfs:keep_mounted=True " FR_SETTINGS[other_bz]="" FR_SETTINGS[plugins_arg]="" FR_SETTINGS[single]="" FR_SETTINGS[rpm_spec]="True" FR_SETTINGS[exclude]="" FR_SETTINGS[checksum]="sha256" FR_SETTINGS[plugins]="" export FR_REVIEWDIR='/var/lib/copr-rpmbuild/results/kernel' export HOME=$FR_REVIEWDIR cd $HOME export FR_NAME='kernel' export FR_VERSION='6.17.8' export FR_RELEASE='300.zen1.fc43' export FR_GROUP='Unspecified' export FR_LICENSE='((GPL-2.0-only WITH Linux-syscall-note) OR BSD-2-Clause) AND ((GPL-2.0-only WITH Linux-syscall-note) OR BSD-3-Clause) AND ((GPL-2.0-only WITH Linux-syscall-note) OR CDDL-1.0) AND ((GPL-2.0-only WITH Linux-syscall-note) OR Linux-OpenIB) AND ((GPL-2.0-only WITH Linux-syscall-note) OR MIT) AND ((GPL-2.0-or-later WITH Linux-syscall-note) OR BSD-3-Clause) AND ((GPL-2.0-or-later WITH Linux-syscall-note) OR MIT) AND 0BSD AND BSD-2-Clause AND (BSD-2-Clause OR Apache-2.0) AND BSD-3-Clause AND BSD-3-Clause-Clear AND CC0-1.0 AND GFDL-1.1-no-invariants-or-later AND GPL-1.0-or-later AND (GPL-1.0-or-later OR BSD-3-Clause) AND (GPL-1.0-or-later WITH Linux-syscall-note) AND GPL-2.0-only AND (GPL-2.0-only OR Apache-2.0) AND (GPL-2.0-only OR BSD-2-Clause) AND (GPL-2.0-only OR BSD-3-Clause) AND (GPL-2.0-only OR CDDL-1.0) AND (GPL-2.0-only OR GFDL-1.1-no-invariants-or-later) AND (GPL-2.0-only OR GFDL-1.2-no-invariants-only) AND (GPL-2.0-only OR GFDL-1.2-no-invariants-or-later) AND (GPL-2.0-only WITH Linux-syscall-note) AND GPL-2.0-or-later AND (GPL-2.0-or-later OR BSD-2-Clause) AND (GPL-2.0-or-later OR BSD-3-Clause) AND (GPL-2.0-or-later OR CC-BY-4.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH Linux-syscall-note) AND ISC AND LGPL-2.0-or-later AND (LGPL-2.0-or-later OR BSD-2-Clause) AND (LGPL-2.0-or-later WITH Linux-syscall-note) AND LGPL-2.1-only AND (LGPL-2.1-only OR BSD-2-Clause) AND (LGPL-2.1-only WITH Linux-syscall-note) AND LGPL-2.1-or-later AND (LGPL-2.1-or-later WITH Linux-syscall-note) AND (Linux-OpenIB OR GPL-2.0-only) AND (Linux-OpenIB OR GPL-2.0-only OR BSD-2-Clause) AND Linux-man-pages-copyleft AND MIT AND (MIT OR Apache-2.0) AND (MIT OR GPL-2.0-only) AND (MIT OR GPL-2.0-or-later) AND (MIT OR LGPL-2.1-only) AND (MPL-1.1 OR GPL-2.0-only) AND (X11 OR GPL-2.0-only) AND (X11 OR GPL-2.0-or-later) AND Zlib AND (copyleft-next-0.3.1 OR GPL-2.0-or-later)' export FR_URL='https://www.kernel.org/' export Source4002="gating.yaml" export Source4001="rpminspect.yaml" export Source4000="README.rst" export Source3002="Patchlist.changelog" export Source3001="kernel-local" export Source3000="merge.py" export Source2002="kvm_stat.logrotate" export Source487="kernel-riscv64-rt-debug-fedora.config" export Source486="kernel-riscv64-rt-fedora.config" export Source485="kernel-x86_64-rt-debug-fedora.config" export Source484="kernel-x86_64-rt-fedora.config" export Source483="kernel-aarch64-rt-64k-debug-fedora.config" export Source482="kernel-aarch64-rt-64k-fedora.config" export Source481="kernel-aarch64-rt-debug-fedora.config" export Source480="kernel-aarch64-rt-fedora.config" export Source479="kernel-x86_64-rt-debug-rhel.config" export Source478="kernel-x86_64-rt-rhel.config" export Source477="kernel-aarch64-rt-64k-debug-rhel.config" export Source476="kernel-aarch64-rt-64k-rhel.config" export Source475="kernel-aarch64-rt-debug-rhel.config" export Source474="kernel-aarch64-rt-rhel.config" export Source301="kernel-kabi-dw-6.17.8.tar.xz" export Source300="kernel-abi-stablelists-6.17.8.tar.xz" export Source214="Module.kabi_dup_riscv64" export Source213="Module.kabi_dup_x86_64" export Source212="Module.kabi_dup_s390x" export Source211="Module.kabi_dup_ppc64le" export Source210="Module.kabi_dup_aarch64" export Source205="Module.kabi_riscv64" export Source204="Module.kabi_x86_64" export Source203="Module.kabi_s390x" export Source202="Module.kabi_ppc64le" export Source201="Module.kabi_aarch64" export Source200="check-kabi" export Source106="fedoraimaca.x509" export Source105="rhelima_centos.x509" export Source104="rhelima.x509" export Source103="rhelimaca1.x509" export Source102="nvidiagpuoot001.x509" export Source101="rhelkpatch1.x509" export Source100="rheldup3.x509" export Source152="uki_addons.json" export Source151="uki_create_addons.py" export Source87="flavors" export Source86="dracut-virt.conf" export Source85="kernel.sbat.template" export Source84="uki-addons.sbat.template" export Source83="uki.sbat.template" export Source81="process_configs.sh" export Source80="generate_all_configs.sh" export Source77="partial-clang_lto-aarch64-debug-snip.config" export Source76="partial-clang_lto-aarch64-snip.config" export Source75="partial-clang_lto-x86_64-debug-snip.config" export Source74="partial-clang_lto-x86_64-snip.config" export Source73="partial-clang-debug-snip.config" export Source72="partial-clang-snip.config" export Source71="partial-kgcov-debug-snip.config" export Source70="partial-kgcov-snip.config" export Source62="def_variants.yaml.fedora" export Source701="kernel-riscv64-debug-fedora.config" export Source700="kernel-riscv64-fedora.config" export Source61="kernel-x86_64-debug-fedora.config" export Source60="kernel-x86_64-fedora.config" export Source59="kernel-s390x-debug-fedora.config" export Source58="kernel-s390x-fedora.config" export Source57="kernel-ppc64le-debug-fedora.config" export Source56="kernel-ppc64le-fedora.config" export Source55="kernel-aarch64-16k-debug-fedora.config" export Source54="kernel-aarch64-16k-fedora.config" export Source53="kernel-aarch64-debug-fedora.config" export Source52="kernel-aarch64-fedora.config" export Source50="x509.genkey.fedora" export Source41="x509.genkey.centos" export Source34="def_variants.yaml.rhel" export Source23="x509.genkey.rhel" export Source45="kernel-riscv64-debug-rhel.config" export Source44="kernel-riscv64-rhel.config" export Source43="kernel-aarch64-64k-debug-rhel.config" export Source42="kernel-aarch64-64k-rhel.config" export Source33="kernel-x86_64-debug-rhel.config" export Source32="kernel-x86_64-rhel.config" export Source31="kernel-s390x-zfcpdump-rhel.config" export Source30="kernel-s390x-debug-rhel.config" export Source29="kernel-s390x-rhel.config" export Source28="kernel-ppc64le-debug-rhel.config" export Source27="kernel-ppc64le-rhel.config" export Source25="kernel-aarch64-debug-rhel.config" export Source24="kernel-aarch64-rhel.config" export Source22="filtermods.py" export Source21="mod-sign.sh" export Source20="mod-denylist.sh" export Source13="redhatsecureboot501.cer" export Source10="redhatsecurebootca5.cer" export Source2="kernel.changelog" export Source1="Makefile.rhelver" export Source0="linux-6.17.8.tar.xz" export Patch999999="linux-kernel-test.patch" export Patch2025="linux-v6.17.8-zen1.patch" export Patch1="patch-6.17-redhat.patch" export FR_PREP='{ set +x; } 2>/dev/null _log_msglineno=$(grep -n "Start of prep stage" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Start of prep stage"" set -x { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Sanity checks" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Sanity checks"" set -x # do a few sanity-checks for --with *only builds # more sanity checking; do it quietly if [ "'\''/rpmbuild/SOURCES/patch-6.17-redhat.patch'\'' '\''/rpmbuild/SOURCES/linux-v6.17.8-zen1.patch'\'' '\''/rpmbuild/SOURCES/linux-kernel-test.patch'\'' " != "%{patches}" ] ; then for patch in '\''/rpmbuild/SOURCES/patch-6.17-redhat.patch'\'' '\''/rpmbuild/SOURCES/linux-v6.17.8-zen1.patch'\'' '\''/rpmbuild/SOURCES/linux-kernel-test.patch'\'' ; do if [ ! -f $patch ] ; then { set +x; } 2>/dev/null _log_msglineno=$(grep -n "ERROR: Patch ${patch##/*/} listed in specfile but is missing" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "ERROR: Patch ${patch##/*/} listed in specfile but is missing"" set -x exit 1 fi done fi 2>/dev/null patch_command='\''git --work-tree=. apply'\'' ApplyPatch() { local patch=$1 shift if [ ! -f $RPM_SOURCE_DIR/$patch ]; then exit 1 fi if ! grep -E "^Patch[0-9]+: $patch\$" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec ; then if [ "${patch:0:8}" != "patch-6." ] ; then { set +x; } 2>/dev/null _log_msglineno=$(grep -n "ERROR: Patch $patch not listed as a source patch in specfile" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "ERROR: Patch $patch not listed as a source patch in specfile"" set -x exit 1 fi fi 2>/dev/null case "$patch" in *.bz2) bunzip2 < "$RPM_SOURCE_DIR/$patch" | $patch_command ${1+"$@"} ;; *.gz) gunzip < "$RPM_SOURCE_DIR/$patch" | $patch_command ${1+"$@"} ;; *.xz) unxz < "$RPM_SOURCE_DIR/$patch" | $patch_command ${1+"$@"} ;; *) $patch_command ${1+"$@"} < "$RPM_SOURCE_DIR/$patch" ;; esac } # don'\''t apply patch if it'\''s empty ApplyOptionalPatch() { local patch=$1 shift { set +x; } 2>/dev/null _log_msglineno=$(grep -n "ApplyOptionalPatch: $1" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "ApplyOptionalPatch: $1"" set -x if [ ! -f $RPM_SOURCE_DIR/$patch ]; then exit 1 fi local C=$(wc -l $RPM_SOURCE_DIR/$patch | awk '\''{print $1}'\'') if [ "$C" -gt 9 ]; then ApplyPatch $patch ${1+"$@"} fi } { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Untar kernel tarball" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Untar kernel tarball"" set -x cd '\''/rpmbuild/BUILD/kernel-6.17.8-build'\'' rm -rf '\''kernel-6.17.8'\'' /usr/bin/mkdir -p '\''kernel-6.17.8'\'' cd '\''kernel-6.17.8'\'' /usr/lib/rpm/rpmuncompress -x '\''/rpmbuild/SOURCES/linux-6.17.8.tar.xz'\'' STATUS=$? if [ $STATUS -ne 0 ]; then exit $STATUS fi /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . mv linux-6.17.8 linux-6.17.8-300.zen1.fc43.x86_64 cd linux-6.17.8-300.zen1.fc43.x86_64 cp -a /rpmbuild/SOURCES/Makefile.rhelver . { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Start of patch applications" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Start of patch applications"" set -x ApplyOptionalPatch patch-6.17-redhat.patch ApplyOptionalPatch linux-v6.17.8-zen1.patch ApplyOptionalPatch linux-kernel-test.patch { set +x; } 2>/dev/null _log_msglineno=$(grep -n "End of patch applications" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "End of patch applications"" set -x # END OF PATCH APPLICATIONS # Any further pre-build tree manipulations happen here. { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Pre-build tree manipulations" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Pre-build tree manipulations"" set -x chmod +x scripts/checkpatch.pl mv COPYING COPYING-6.17.8-300.zen1.fc43 # on linux-next prevent scripts/setlocalversion from mucking with our version numbers rm -f localversion-next localversion-rt # Mangle /usr/bin/python shebangs to /usr/bin/python3 # Mangle all Python shebangs to be Python 3 explicitly # -p preserves timestamps # -n prevents creating ~backup files # -i specifies the interpreter for the shebang # This fixes errors such as # *** ERROR: ambiguous python shebang in /usr/bin/kvm_stat: #!/usr/bin/python. Change it to python3 (or python2) explicitly. # We patch all sources below for which we got a report/error. { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Fixing Python shebangs..." /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Fixing Python shebangs..."" set -x %py3_shebang_fix \ tools/kvm/kvm_stat/kvm_stat \ scripts/show_delta \ scripts/diffconfig \ scripts/bloat-o-meter \ scripts/jobserver-exec \ tools \ Documentation \ scripts/clang-tools 2> /dev/null # SBAT data sed -e s,@KVER,6.17.8-300.zen1.fc43.x86_64, -e s,@SBAT_SUFFIX,fedora, /rpmbuild/SOURCES/uki.sbat.template > uki.sbat sed -e s,@KVER,6.17.8-300.zen1.fc43.x86_64, -e s,@SBAT_SUFFIX,fedora, /rpmbuild/SOURCES/uki-addons.sbat.template > uki-addons.sbat sed -e s,@KVER,6.17.8-300.zen1.fc43.x86_64, -e s,@SBAT_SUFFIX,fedora, /rpmbuild/SOURCES/kernel.sbat.template > kernel.sbat # only deal with configs if we are going to build for the arch if [ -L configs ]; then rm -f configs fi mkdir configs cd configs { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Copy additional source files into buildroot" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Copy additional source files into buildroot"" set -x # Drop some necessary files from the source dir into the buildroot cp $RPM_SOURCE_DIR/kernel-*.config . cp /rpmbuild/SOURCES/generate_all_configs.sh . # merge.py cp /rpmbuild/SOURCES/merge.py . # kernel-local - rename and copy for partial snippet config process cp /rpmbuild/SOURCES/kernel-local partial-kernel-local-snip.config cp /rpmbuild/SOURCES/kernel-local partial-kernel-local-debug-snip.config FLAVOR=fedora SPECPACKAGE_NAME=kernel SPECVERSION=6.17.8 SPECRPMVERSION=6.17.8 ./generate_all_configs.sh 1 # Collect custom defined config options { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Collect custom defined config options" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Collect custom defined config options"" set -x PARTIAL_CONFIGS="" PARTIAL_CONFIGS="$PARTIAL_CONFIGS partial-kernel-local-snip.config partial-kernel-local-debug-snip.config" GetArch() { case "$1" in *aarch64*) echo "aarch64" ;; *ppc64le*) echo "ppc64le" ;; *s390x*) echo "s390x" ;; *x86_64*) echo "x86_64" ;; *riscv64*) echo "riscv64" ;; # no arch, apply everywhere *) echo "" ;; esac } # Merge in any user-provided local config option changes { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Merge in any user-provided local config option changes" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Merge in any user-provided local config option changes"" set -x for i in kernel-6.17.8-*.config do kern_arch="$(GetArch $i)" kern_debug="$(echo $i | grep -q debug && echo "debug" || echo "")" for j in $PARTIAL_CONFIGS do part_arch="$(GetArch $j)" part_debug="$(echo $j | grep -q debug && echo "debug" || echo "")" # empty arch means apply to all arches if [ "$part_arch" == "" -o "$part_arch" == "$kern_arch" ] && [ "$part_debug" == "$kern_debug" ] then mv $i $i.tmp ./merge.py $j $i.tmp > $i fi done rm -f $i.tmp done # Add DUP and kpatch certificates to system trusted keys for RHEL truncate -s0 ../certs/rhel.pem openssl x509 -inform der -in /rpmbuild/SOURCES/fedoraimaca.x509 -out imaca.pem cat imaca.pem >> ../certs/rhel.pem for i in *.config; do sed -i '\''s@CONFIG_SYSTEM_TRUSTED_KEYS=""@CONFIG_SYSTEM_TRUSTED_KEYS="certs/rhel.pem"@'\'' $i sed -i '\''s@CONFIG_EFI_SBAT_FILE=""@CONFIG_EFI_SBAT_FILE="kernel.sbat"@'\'' $i done { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Set process_configs.sh $OPTS" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Set process_configs.sh $OPTS"" set -x cp /rpmbuild/SOURCES/process_configs.sh . OPTS="-w -n -c" { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Generate redhat configs" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Generate redhat configs"" set -x RHJOBS=$RPM_BUILD_NCPUS SPECPACKAGE_NAME=kernel ./process_configs.sh $OPTS 6.17.8 # We may want to override files from the primary target in case of building # against a flavour of it (eg. centos not rhel), thus override it here if # necessary update_scripts() { TARGET="$1" for i in "$RPM_SOURCE_DIR"/*."$TARGET"; do NEW=${i%."$TARGET"} cp "$i" "$(basename "$NEW")" done } { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Set scripts/SOURCES targets" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Set scripts/SOURCES targets"" set -x update_target=fedora if [ "fedora" == "rhel" ]; then : # no-op to avoid empty if-fi error fi update_scripts $update_target { set +x; } 2>/dev/null _log_msglineno=$(grep -n "End of kernel config" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "End of kernel config"" set -x cd .. # # End of Configs stuff # get rid of unwanted files resulting from patch fuzz find . \( -name "*.orig" -o -name "*~" \) -delete >/dev/null # remove unnecessary SCM files find . -name .gitignore -delete >/dev/null cd .. ### ### build ###' export FR_BUILD='{ set +x; } 2>/dev/null _log_msglineno=$(grep -n "Start of build stage" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Start of build stage"" set -x { set +x; } 2>/dev/null _log_msglineno=$(grep -n "General arch build configuration" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "General arch build configuration"" set -x rm -rf /rpmbuild/BUILD/kernel-6.17.8-build/root_unstripped || true mkdir -p /rpmbuild/BUILD/kernel-6.17.8-build/root_unstripped cp_vmlinux() { eu-strip --remove-comment -o "$2" "$1" } # Note we need to disable these flags for cross builds because the flags # from redhat-rpm-config assume that host == target so target arch # flags cause issues with the host compiler. InitBuildVars() { { set +x; } 2>/dev/null _log_msglineno=$(grep -n "InitBuildVars for $1" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "InitBuildVars for $1"" set -x { set +x; } 2>/dev/null _log_msglineno=$(grep -n "InitBuildVars: Initialize build variables" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "InitBuildVars: Initialize build variables"" set -x # Initialize the kernel .config file and create some variables that are # needed for the actual build process. Variant=$1 # Pick the right kernel config file Config=kernel-6.17.8-x86_64${Variant:+-${Variant}}.config DevelDir=/usr/src/kernels/6.17.8-300.zen1.fc43.x86_64${Variant:++${Variant}} KernelVer=6.17.8-300.zen1.fc43.x86_64${Variant:++${Variant}} { set +x; } 2>/dev/null _log_msglineno=$(grep -n "InitBuildVars: Update Makefile" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "InitBuildVars: Update Makefile"" set -x # make sure EXTRAVERSION says what we want it to say # Trim the release if this is a CI build, since KERNELVERSION is limited to 64 characters ShortRel=$(perl -e "print \"300.zen1.fc43\" =~ s/\.pr\.[0-9A-Fa-f]{32}//r") perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -${ShortRel}.x86_64${Variant:++${Variant}}/" Makefile # if pre-rc1 devel kernel, must fix up PATCHLEVEL for our versioning scheme # if we are post rc1 this should match anyway so this won'\''t matter perl -p -i -e '\''s/^PATCHLEVEL.*/PATCHLEVEL = 17/'\'' Makefile { set +x; } 2>/dev/null _log_msglineno=$(grep -n "InitBuildVars: Copy files" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "InitBuildVars: Copy files"" set -x /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -j${RPM_BUILD_NCPUS} mrproper cp configs/$Config .config cp configs/x509.genkey certs/. Arch=`head -1 .config | cut -b 3-` { set +x; } 2>/dev/null _log_msglineno=$(grep -n "InitBuildVars: USING ARCH=$Arch" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "InitBuildVars: USING ARCH=$Arch"" set -x KCFLAGS="" } #Build bootstrap bpftool BuildBpftool(){ export BPFBOOTSTRAP_CFLAGS=$(echo "-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 " | sed -r "s/\-specs=[^\ ]+\/redhat-annobin-cc1//") export BPFBOOTSTRAP_LDFLAGS=$(echo "-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " | sed -r "s/\-specs=[^\ ]+\/redhat-annobin-cc1//") CFLAGS="" LDFLAGS="" make EXTRA_CFLAGS="${BPFBOOTSTRAP_CFLAGS}" EXTRA_CXXFLAGS="${BPFBOOTSTRAP_CFLAGS}" EXTRA_LDFLAGS="${BPFBOOTSTRAP_LDFLAGS}" -s V=1 -C tools/bpf/bpftool bootstrap } BuildKernel() { { set +x; } 2>/dev/null _log_msglineno=$(grep -n "BuildKernel for $4" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "BuildKernel for $4"" set -x MakeTarget=$1 KernelImage=$2 DoVDSO=$3 Variant=$4 InstallName=${5:-vmlinuz} { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Setup variables" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Setup variables"" set -x DoModules=1 if [ "$Variant" = "zfcpdump" ]; then DoModules=0 fi # When the bootable image is just the ELF kernel, strip it. # We already copy the unstripped file into the debuginfo package. if [ "$KernelImage" = vmlinux ]; then CopyKernel=cp_vmlinux else CopyKernel=cp fi { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Calling InitBuildVars for $Variant" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Calling InitBuildVars for $Variant"" set -x InitBuildVars $Variant { set +x; } 2>/dev/null _log_msglineno=$(grep -n "BUILDING A KERNEL FOR ${Variant} x86_64..." /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "BUILDING A KERNEL FOR ${Variant} x86_64..."" set -x /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " ARCH=$Arch olddefconfig >/dev/null { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Setup build-ids" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Setup build-ids"" set -x # This ensures build-ids are unique to allow parallel debuginfo perl -p -i -e "s/^CONFIG_BUILD_SALT.*/CONFIG_BUILD_SALT=\"6.17.8-300.zen1.fc43.x86_64\"/" .config /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " ARCH=$Arch KCFLAGS="$KCFLAGS" WITH_GCOV="0" -j${RPM_BUILD_NCPUS} $MakeTarget if [ $DoModules -eq 1 ]; then /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " ARCH=$Arch KCFLAGS="$KCFLAGS" WITH_GCOV="0" -j${RPM_BUILD_NCPUS} modules || exit 1 fi { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Setup RPM_BUILD_ROOT directories" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Setup RPM_BUILD_ROOT directories"" set -x mkdir -p $RPM_BUILD_ROOT/boot mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/systemtap mkdir -p $RPM_BUILD_ROOT/usr/lib/debug/boot { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Cleanup temp btf files" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Cleanup temp btf files"" set -x # Remove large intermediate files we no longer need to save space # (-f required for zfcpdump builds that do not enable BTF) rm -f vmlinux.o .tmp_vmlinux.btf { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Install files to RPM_BUILD_ROOT" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Install files to RPM_BUILD_ROOT"" set -x # Comment out specific config settings that may use resources not available # to the end user so that the packaged config file can be easily reused with # upstream make targets sed -i -e '\''/^CONFIG_SYSTEM_TRUSTED_KEYS/{ i\# The kernel was built with s/^/# / a\# We are resetting this value to facilitate local builds a\CONFIG_SYSTEM_TRUSTED_KEYS="" }'\'' .config # Start installing the results install -m 644 .config $RPM_BUILD_ROOT/boot/config-$KernelVer install -m 644 .config $RPM_BUILD_ROOT/lib/modules/$KernelVer/config install -m 644 System.map $RPM_BUILD_ROOT/boot/System.map-$KernelVer install -m 644 System.map $RPM_BUILD_ROOT/lib/modules/$KernelVer/System.map { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Reserving 40MB in boot for initramfs" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Reserving 40MB in boot for initramfs"" set -x # We estimate the size of the initramfs because rpm needs to take this size # into consideration when performing disk space calculations. (See bz #530778) dd if=/dev/zero of=$RPM_BUILD_ROOT/boot/initramfs-$KernelVer.img bs=1M count=40 if [ -f arch/$Arch/boot/zImage.stub ]; then { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Copy zImage.stub to RPM_BUILD_ROOT" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Copy zImage.stub to RPM_BUILD_ROOT"" set -x cp arch/$Arch/boot/zImage.stub $RPM_BUILD_ROOT/boot/zImage.stub-$KernelVer || : cp arch/$Arch/boot/zImage.stub $RPM_BUILD_ROOT/lib/modules/$KernelVer/zImage.stub-$KernelVer || : fi { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Copy kernel for signing" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Copy kernel for signing"" set -x if [ "$KernelImage" = vmlinux ]; then # We can'\''t strip and sign $KernelImage in place, because # we need to preserve original vmlinux for debuginfo. # Use a copy for signing. $CopyKernel $KernelImage $KernelImage.tosign KernelImage=$KernelImage.tosign CopyKernel=cp fi SignImage=$KernelImage { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Sign kernel image" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Sign kernel image"" set -x %pesign -s -i $SignImage -o vmlinuz.signed -a /rpmbuild/SOURCES/redhatsecurebootca5.cer -c /rpmbuild/SOURCES/redhatsecureboot501.cer -n redhatsecureboot501 if [ ! -s vmlinuz.signed ]; then { set +x; } 2>/dev/null _log_msglineno=$(grep -n "pesigning failed" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "pesigning failed"" set -x exit 1 fi mv vmlinuz.signed $SignImage # signkernel { set +x; } 2>/dev/null _log_msglineno=$(grep -n "copy signed kernel" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "copy signed kernel"" set -x $CopyKernel $KernelImage \ $RPM_BUILD_ROOT/boot/$InstallName-$KernelVer chmod 755 $RPM_BUILD_ROOT/boot/$InstallName-$KernelVer cp $RPM_BUILD_ROOT/boot/$InstallName-$KernelVer $RPM_BUILD_ROOT/lib/modules/$KernelVer/$InstallName # hmac sign the kernel for FIPS { set +x; } 2>/dev/null _log_msglineno=$(grep -n "hmac sign the kernel for FIPS" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "hmac sign the kernel for FIPS"" set -x { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Creating hmac file: $RPM_BUILD_ROOT/boot/.vmlinuz-$KernelVer.hmac" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Creating hmac file: $RPM_BUILD_ROOT/boot/.vmlinuz-$KernelVer.hmac"" set -x ls -l $RPM_BUILD_ROOT/boot/$InstallName-$KernelVer (cd $RPM_BUILD_ROOT/boot && sha512hmac $InstallName-$KernelVer) > $RPM_BUILD_ROOT/boot/.vmlinuz-$KernelVer.hmac; cp $RPM_BUILD_ROOT/boot/.vmlinuz-$KernelVer.hmac $RPM_BUILD_ROOT/lib/modules/$KernelVer/.vmlinuz.hmac if [ $DoModules -eq 1 ]; then { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Install modules in RPM_BUILD_ROOT" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Install modules in RPM_BUILD_ROOT"" set -x # Override $(mod-fw) because we don'\''t want it to install any firmware # we'\''ll get it from the linux-firmware package and we don'\''t want conflicts /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -j${RPM_BUILD_NCPUS} ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT -j${RPM_BUILD_NCPUS} modules_install KERNELRELEASE=$KernelVer mod-fw= fi { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Add VDSO files" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Add VDSO files"" set -x # add an a noop %defattr statement '\''cause rpm doesn'\''t like empty file list files echo '\''%defattr(-,-,-)'\'' > ../kernel${Variant:+-${Variant}}-ldsoconf.list if [ $DoVDSO -ne 0 ]; then /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT vdso_install KERNELRELEASE=$KernelVer if [ -s ldconfig-kernel.conf ]; then install -D -m 444 ldconfig-kernel.conf \ $RPM_BUILD_ROOT/etc/ld.so.conf.d/kernel-$KernelVer.conf echo /etc/ld.so.conf.d/kernel-$KernelVer.conf >> ../kernel${Variant:+-${Variant}}-ldsoconf.list fi rm -rf $RPM_BUILD_ROOT/lib/modules/$KernelVer/vdso/.build-id fi { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Save headers/makefiles, etc. for kernel-headers" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Save headers/makefiles, etc. for kernel-headers"" set -x # And save the headers/makefiles etc for building modules against # # This all looks scary, but the end result is supposed to be: # * all arch relevant include/ files # * all Makefile/Kconfig files # * all script/ files rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/build rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/source mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/build (cd $RPM_BUILD_ROOT/lib/modules/$KernelVer ; ln -s build source) # dirs for additional modules per module-init-tools, kbuild/modules.txt mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/updates mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/weak-updates # CONFIG_KERNEL_HEADER_TEST generates some extra files in the process of # testing so just delete find . -name *.h.s -delete # first copy everything cp --parents `find -type f -name "Makefile*" -o -name "Kconfig*"` $RPM_BUILD_ROOT/lib/modules/$KernelVer/build if [ ! -e Module.symvers ]; then touch Module.symvers fi cp Module.symvers $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp System.map $RPM_BUILD_ROOT/lib/modules/$KernelVer/build if [ -s Module.markers ]; then cp Module.markers $RPM_BUILD_ROOT/lib/modules/$KernelVer/build fi # create the kABI metadata for use in packaging # NOTENOTE: the name symvers is used by the rpm backend # NOTENOTE: to discover and run the /usr/lib/rpm/fileattrs/kabi.attr # NOTENOTE: script which dynamically adds exported kernel symbol # NOTENOTE: checksums to the rpm metadata provides list. # NOTENOTE: if you change the symvers name, update the backend too { set +x; } 2>/dev/null _log_msglineno=$(grep -n "GENERATING kernel ABI metadata" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "GENERATING kernel ABI metadata"" set -x xz --stdout --compress --check=crc32 --lzma2=dict=1MiB < Module.symvers > $RPM_BUILD_ROOT/boot/symvers-$KernelVer.xz cp $RPM_BUILD_ROOT/boot/symvers-$KernelVer.xz $RPM_BUILD_ROOT/lib/modules/$KernelVer/symvers.xz { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Cleanup Makefiles/Kconfig files" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Cleanup Makefiles/Kconfig files"" set -x # then drop all but the needed Makefiles/Kconfig files rm -rf $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts rm -rf $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include cp .config $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a scripts $RPM_BUILD_ROOT/lib/modules/$KernelVer/build rm -rf $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/tracing rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/spdxcheck.py { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Copy additional files for make targets" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Copy additional files for make targets"" set -x # Files for '\''make scripts'\'' to succeed with kernel-devel. mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/security/selinux/include cp -a --parents security/selinux/include/classmap.h $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a --parents security/selinux/include/initial_sid_to_string.h $RPM_BUILD_ROOT/lib/modules/$KernelVer/build mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/tools/include/tools cp -a --parents tools/include/tools/be_byteshift.h $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a --parents tools/include/tools/le_byteshift.h $RPM_BUILD_ROOT/lib/modules/$KernelVer/build # Files for '\''make prepare'\'' to succeed with kernel-devel. cp -a --parents tools/include/linux/compiler* $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a --parents tools/include/linux/types.h $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a --parents tools/build/Build.include $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp --parents tools/build/fixdep.c $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp --parents tools/objtool/sync-check.sh $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a --parents tools/bpf/resolve_btfids $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp --parents security/selinux/include/policycap_names.h $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp --parents security/selinux/include/policycap.h $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a --parents tools/include/asm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a --parents tools/include/asm-generic $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a --parents tools/include/linux $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a --parents tools/include/uapi/asm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a --parents tools/include/uapi/asm-generic $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a --parents tools/include/uapi/linux $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a --parents tools/include/vdso $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp --parents tools/scripts/utilities.mak $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a --parents tools/lib/subcmd $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp --parents tools/lib/*.c $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp --parents tools/objtool/*.[ch] $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp --parents tools/objtool/Build $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp --parents tools/objtool/include/objtool/*.h $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a --parents tools/lib/bpf $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp --parents tools/lib/bpf/Build $RPM_BUILD_ROOT/lib/modules/$KernelVer/build if [ -f tools/objtool/objtool ]; then cp -a tools/objtool/objtool $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/tools/objtool/ || : fi if [ -f tools/objtool/fixdep ]; then cp -a tools/objtool/fixdep $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/tools/objtool/ || : fi if [ -d arch/$Arch/scripts ]; then cp -a arch/$Arch/scripts $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/arch/x86_64 || : fi if [ -f arch/$Arch/*lds ]; then cp -a arch/$Arch/*lds $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/arch/x86_64/ || : fi if [ -f arch/x86/kernel/module.lds ]; then cp -a --parents arch/x86/kernel/module.lds $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ fi find $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts \( -iname "*.o" -o -iname "*.cmd" \) -exec rm -f {} + if [ -d arch/x86/include ]; then cp -a --parents arch/x86/include $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ fi if [ -d tools/arch/x86/include ]; then cp -a --parents tools/arch/x86/include $RPM_BUILD_ROOT/lib/modules/$KernelVer/build fi cp -a include $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include # Cross-reference from include/perf/events/sof.h cp -a sound/soc/sof/sof-audio.h $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/sound/soc/sof # files for '\''make prepare'\'' to succeed with kernel-devel cp -a --parents arch/x86/entry/syscalls/syscall_32.tbl $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a --parents arch/x86/entry/syscalls/syscall_64.tbl $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a --parents arch/x86/tools/relocs_32.c $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a --parents arch/x86/tools/relocs_64.c $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a --parents arch/x86/tools/relocs.c $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a --parents arch/x86/tools/relocs_common.c $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a --parents arch/x86/tools/relocs.h $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a --parents arch/x86/purgatory/purgatory.c $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a --parents arch/x86/purgatory/stack.S $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a --parents arch/x86/purgatory/setup-x86_64.S $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a --parents arch/x86/purgatory/entry64.S $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a --parents arch/x86/boot/string.h $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a --parents arch/x86/boot/string.c $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a --parents arch/x86/boot/ctype.h $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a --parents scripts/syscalltbl.sh $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a --parents scripts/syscallhdr.sh $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a --parents tools/arch/x86/include/asm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a --parents tools/arch/x86/include/uapi/asm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a --parents tools/objtool/arch/x86/lib $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a --parents tools/arch/x86/lib/ $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a --parents tools/arch/x86/tools/gen-insn-attr-x86.awk $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a --parents tools/objtool/arch/x86/ $RPM_BUILD_ROOT/lib/modules/$KernelVer/build { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Clean up intermediate tools files" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Clean up intermediate tools files"" set -x # Clean up intermediate tools files find $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/tools \( -iname "*.o" -o -iname "*.cmd" \) -exec rm -f {} + # Make sure the Makefile, version.h, and auto.conf have a matching # timestamp so that external modules can be built touch -r $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/Makefile \ $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/generated/uapi/linux/version.h \ $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/config/auto.conf eu-readelf -n vmlinux | grep "Build ID" | awk '\''{print $NF}'\'' > vmlinux.id cp vmlinux.id $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/vmlinux.id { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Copy additional files for kernel-debuginfo rpm" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Copy additional files for kernel-debuginfo rpm"" set -x # # save the vmlinux file for kernel debugging into the kernel-debuginfo rpm # (use mv + symlink instead of cp to reduce disk space requirements) # mkdir -p $RPM_BUILD_ROOT/usr/lib/debug/lib/modules/$KernelVer mv vmlinux $RPM_BUILD_ROOT/usr/lib/debug/lib/modules/$KernelVer ln -s $RPM_BUILD_ROOT/usr/lib/debug/lib/modules/$KernelVer/vmlinux vmlinux if [ -n "" ]; then eu-readelf -n %{vmlinux_decompressor} | grep "Build ID" | awk '\''{print $NF}'\'' > vmlinux.decompressor.id # Without build-id the build will fail. But for s390 the build-id # wasn'\''t added before 5.11. In case it is missing prefer not # packaging the debuginfo over a build failure. if [ -s vmlinux.decompressor.id ]; then cp vmlinux.decompressor.id $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/vmlinux.decompressor.id cp %{vmlinux_decompressor} $RPM_BUILD_ROOT/usr/lib/debug/lib/modules/$KernelVer/vmlinux.decompressor fi fi # build and copy the vmlinux-gdb plugin files into kernel-debuginfo /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " ARCH=$Arch -j${RPM_BUILD_NCPUS} scripts_gdb cp -a --parents scripts/gdb/{,linux/}*.py $RPM_BUILD_ROOT/usr/lib/debug/lib/modules/$KernelVer # this should be a relative symlink (Kbuild creates an absolute one) ln -s scripts/gdb/vmlinux-gdb.py $RPM_BUILD_ROOT/usr/lib/debug/lib/modules/$KernelVer/vmlinux-gdb.py %py_byte_compile /usr/bin/python3 $RPM_BUILD_ROOT/usr/lib/debug/lib/modules/$KernelVer/scripts/gdb { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Create modnames" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Create modnames"" set -x find $RPM_BUILD_ROOT/lib/modules/$KernelVer -name "*.ko" -type f >modnames # mark modules executable so that strip-to-file can strip them xargs --no-run-if-empty chmod u+x < modnames # Generate a list of modules for block and networking. { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Generate a list of modules for block and networking" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Generate a list of modules for block and networking"" set -x grep -F /drivers/ modnames | xargs --no-run-if-empty nm -upA | sed -n '\''s,^.*/\([^/]*\.ko\): *U \(.*\)$,\1 \2,p'\'' > drivers.undef collect_modules_list() { sed -r -n -e "s/^([^ ]+) \\.?($2)\$/\\1/p" drivers.undef | LC_ALL=C sort -u > $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.$1 if [ ! -z "$3" ]; then sed -r -e "/^($3)\$/d" -i $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.$1 fi } collect_modules_list networking \ '\''register_netdev|ieee80211_register_hw|usbnet_probe|phy_driver_register|rt(l_|2x00)(pci|usb)_probe|register_netdevice'\'' collect_modules_list block \ '\''ata_scsi_ioctl|scsi_add_host|scsi_add_host_with_dma|blk_alloc_queue|blk_init_queue|register_mtd_blktrans|scsi_esp_register|scsi_register_device_handler|blk_queue_physical_block_size'\'' '\''pktcdvd.ko|dm-mod.ko'\'' collect_modules_list drm \ '\''drm_open|drm_init'\'' collect_modules_list modesetting \ '\''drm_crtc_init'\'' { set +x; } 2>/dev/null _log_msglineno=$(grep -n "detect missing or incorrect license tags" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "detect missing or incorrect license tags"" set -x # detect missing or incorrect license tags ( find $RPM_BUILD_ROOT/lib/modules/$KernelVer -name '\''*.ko'\'' | xargs /sbin/modinfo -l | \ grep -E -v '\''GPL( v2)?$|Dual BSD/GPL$|Dual MPL/GPL$|GPL and additional rights$'\'' ) && exit 1 if [ $DoModules -eq 0 ]; then { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Create empty files for RPM packaging" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Create empty files for RPM packaging"" set -x # Ensure important files/directories exist to let the packaging succeed echo '\''%defattr(-,-,-)'\'' > ../kernel${Variant:+-${Variant}}-modules-core.list echo '\''%defattr(-,-,-)'\'' > ../kernel${Variant:+-${Variant}}-modules.list echo '\''%defattr(-,-,-)'\'' > ../kernel${Variant:+-${Variant}}-modules-extra.list echo '\''%defattr(-,-,-)'\'' > ../kernel${Variant:+-${Variant}}-modules-internal.list echo '\''%defattr(-,-,-)'\'' > ../kernel${Variant:+-${Variant}}-modules-partner.list mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/kernel # Add files usually created by make modules, needed to prevent errors # thrown by depmod during package installation touch $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.order touch $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.builtin fi # Copy the System.map file for depmod to use cp System.map $RPM_BUILD_ROOT/. if [[ "$Variant" == "rt" || "$Variant" == "rt-debug" || "$Variant" == "rt-64k" || "$Variant" == "rt-64k-debug" || "$Variant" == "automotive" || "$Variant" == "automotive-debug" ]]; then { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Skipping efiuki build" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Skipping efiuki build"" set -x else { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Setup the EFI UKI kernel" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Setup the EFI UKI kernel"" set -x KernelUnifiedImageDir="$RPM_BUILD_ROOT/lib/modules/$KernelVer" KernelUnifiedImage="$KernelUnifiedImageDir/$InstallName-virt.efi" KernelUnifiedInitrd="$KernelUnifiedImageDir/$InstallName-virt.img" mkdir -p $KernelUnifiedImageDir dracut --conf=/rpmbuild/SOURCES/dracut-virt.conf \ --confdir=$(mktemp -d) \ --no-hostonly \ --verbose \ --kver "$KernelVer" \ --kmoddir "$RPM_BUILD_ROOT/lib/modules/$KernelVer/" \ --logfile=$(mktemp) \ $KernelUnifiedInitrd ukify build --linux $(realpath $KernelImage) --initrd $KernelUnifiedInitrd \ --sbat @uki.sbat --os-release @/etc/os-release --uname $KernelVer \ --cmdline '\''console=tty0 console=ttyS0'\'' --output $KernelUnifiedImage rm -f $KernelUnifiedInitrd KernelAddonsDirOut="$KernelUnifiedImage.extra.d" mkdir -p $KernelAddonsDirOut python3 /rpmbuild/SOURCES/uki_create_addons.py /rpmbuild/SOURCES/uki_addons.json $KernelAddonsDirOut virt fedora x86_64 @uki-addons.sbat { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Sign the EFI UKI kernel" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Sign the EFI UKI kernel"" set -x %pesign -s -i $KernelUnifiedImage -o $KernelUnifiedImage.signed -a /rpmbuild/SOURCES/redhatsecurebootca5.cer -c /rpmbuild/SOURCES/redhatsecureboot501.cer -n redhatsecureboot501 if [ ! -s $KernelUnifiedImage.signed ]; then echo "pesigning failed" exit 1 fi mv $KernelUnifiedImage.signed $KernelUnifiedImage for addon in "$KernelAddonsDirOut"/*; do %pesign -s -i $addon -o $addon.signed -a /rpmbuild/SOURCES/redhatsecurebootca5.cer -c /rpmbuild/SOURCES/redhatsecureboot501.cer -n redhatsecureboot501 rm -f $addon mv $addon.signed $addon done # signkernel # hmac sign the UKI for FIPS KernelUnifiedImageHMAC="$KernelUnifiedImageDir/.$InstallName-virt.efi.hmac" { set +x; } 2>/dev/null _log_msglineno=$(grep -n "hmac sign the UKI for FIPS" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "hmac sign the UKI for FIPS"" set -x { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Creating hmac file: $KernelUnifiedImageHMAC" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Creating hmac file: $KernelUnifiedImageHMAC"" set -x (cd $KernelUnifiedImageDir && sha512hmac $InstallName-virt.efi) > $KernelUnifiedImageHMAC; # with_efiuki : # in case of empty block fi # "$Variant" == "rt" || "$Variant" == "rt-debug" || "$Variant" == "automotive" || "$Variant" == "automotive-debug" # # Generate the modules files lists # move_kmod_list() { local module_list="$1" local subdir_name="$2" mkdir -p "$RPM_BUILD_ROOT/lib/modules/$KernelVer/$subdir_name" set +x while read -r kmod; do local target_file="$RPM_BUILD_ROOT/lib/modules/$KernelVer/$subdir_name/$kmod" local target_dir="${target_file%/*}" mkdir -p "$target_dir" mv "$RPM_BUILD_ROOT/lib/modules/$KernelVer/kernel/$kmod" "$target_dir" done < <(sed -e '\''s|^kernel/||'\'' "$module_list") set -x } create_module_file_list() { # subdirectory within /lib/modules/$KernelVer where kmods should go local module_subdir="$1" # kmod list with relative paths produced by filtermods.py local relative_kmod_list="$2" # list with absolute paths to kmods and other files to be included local absolute_file_list="$3" # if 1, this adds also all kmod directories to absolute_file_list local add_all_dirs="$4" local run_mod_deny="$5" if [ "$module_subdir" != "kernel" ]; then # move kmods into subdirs if needed (internal, partner, extra,..) move_kmod_list $relative_kmod_list $module_subdir fi # make kmod paths absolute sed -e '\''s|^kernel/|/lib/modules/'\''$KernelVer'\''/'\''$module_subdir'\''/|'\'' $relative_kmod_list > $absolute_file_list if [ "$run_mod_deny" -eq 1 ]; then # run deny-mod script, this adds blacklist-* files to absolute_file_list /rpmbuild/SOURCES/mod-denylist.sh "$RPM_BUILD_ROOT" lib/modules/$KernelVer $absolute_file_list fi # deny-mod script works with kmods as they are now (not compressed), # but if they will be we need to add compext to all sed -i -e '\''s/.ko$/.ko.xz/'\'' $absolute_file_list # add also dir for the case when there are no kmods # "kernel" subdir is covered in %files section, skip it here if [ "$module_subdir" != "kernel" ]; then echo "%dir /lib/modules/$KernelVer/$module_subdir" >> $absolute_file_list fi if [ "$add_all_dirs" -eq 1 ]; then (cd $RPM_BUILD_ROOT; find lib/modules/$KernelVer/kernel -mindepth 1 -type d | sort -n) > ../module-dirs.list sed -e '\''s|^lib|%dir /lib|'\'' ../module-dirs.list >> $absolute_file_list fi } if [ $DoModules -eq 1 ]; then # save modules.dep for debugging cp $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.dep ../ { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Create module list files for all kernel variants" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Create module list files for all kernel variants"" set -x variants_param="" if [[ "$Variant" == "rt" || "$Variant" == "rt-debug" ]]; then variants_param="-r rt" fi if [[ "$Variant" == "rt-64k" || "$Variant" == "rt-64k-debug" ]]; then variants_param="-r rt-64k" fi if [[ "$Variant" == "automotive" || "$Variant" == "automotive-debug" ]]; then variants_param="-r automotive" fi # this creates ../modules-*.list output, where each kmod path is as it # appears in modules.dep (relative to lib/modules/$KernelVer) ret=0 /rpmbuild/SOURCES/filtermods.py -l "../filtermods-$KernelVer.log" sort -d $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.dep -c configs/def_variants.yaml $variants_param -o .. || ret=$? if [ $ret -ne 0 ]; then echo "8< --- filtermods-$KernelVer.log ---" cat "../filtermods-$KernelVer.log" echo "--- filtermods-$KernelVer.log --- >8" echo "8< --- modules.dep ---" cat $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.dep echo "--- modules.dep --- >8" exit 1 fi create_module_file_list "kernel" ../modules-core.list ../kernel${Variant:+-${Variant}}-modules-core.list 1 0 create_module_file_list "kernel" ../modules.list ../kernel${Variant:+-${Variant}}-modules.list 0 0 create_module_file_list "internal" ../modules-internal.list ../kernel${Variant:+-${Variant}}-modules-internal.list 0 1 create_module_file_list "kernel" ../modules-extra.list ../kernel${Variant:+-${Variant}}-modules-extra.list 0 1 fi # $DoModules -eq 1 remove_depmod_files() { # remove files that will be auto generated by depmod at rpm -i time pushd $RPM_BUILD_ROOT/lib/modules/$KernelVer/ # in case below list needs to be extended, remember to add a # matching ghost entry in the files section as well rm -f modules.{alias,alias.bin,builtin.alias.bin,builtin.bin} \ modules.{dep,dep.bin,devname,softdep,symbols,symbols.bin,weakdep} popd } # Cleanup { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Cleanup build files" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Cleanup build files"" set -x rm -f $RPM_BUILD_ROOT/System.map { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Remove depmod files" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Remove depmod files"" set -x remove_depmod_files # Move the devel headers out of the root file system { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Move the devel headers to RPM_BUILD_ROOT" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Move the devel headers to RPM_BUILD_ROOT"" set -x mkdir -p $RPM_BUILD_ROOT/usr/src/kernels mv $RPM_BUILD_ROOT/lib/modules/$KernelVer/build $RPM_BUILD_ROOT/$DevelDir # This is going to create a broken link during the build, but we don'\''t use # it after this point. We need the link to actually point to something # when kernel-devel is installed, and a relative link doesn'\''t work across # the F17 UsrMove feature. ln -sf $DevelDir $RPM_BUILD_ROOT/lib/modules/$KernelVer/build # Generate vmlinux.h and put it to kernel-devel path # zfcpdump build does not have btf anymore if [ "$Variant" != "zfcpdump" ]; then { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Build the bootstrap bpftool to generate vmlinux.h" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Build the bootstrap bpftool to generate vmlinux.h"" set -x # Build the bootstrap bpftool to generate vmlinux.h BuildBpftool tools/bpf/bpftool/bootstrap/bpftool btf dump file vmlinux format c > $RPM_BUILD_ROOT/$DevelDir/vmlinux.h fi { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Cleanup kernel-devel and kernel-debuginfo files" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Cleanup kernel-devel and kernel-debuginfo files"" set -x # prune junk from kernel-devel find $RPM_BUILD_ROOT/usr/src/kernels -name ".*.cmd" -delete # prune junk from kernel-debuginfo find $RPM_BUILD_ROOT/usr/src/kernels -name "*.mod.c" -delete # Red Hat UEFI Secure Boot CA cert, which can be used to authenticate the kernel { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Install certs" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Install certs"" set -x mkdir -p $RPM_BUILD_ROOT/usr/share/doc/kernel-keys/$KernelVer install -m 0644 /rpmbuild/SOURCES/redhatsecurebootca5.cer $RPM_BUILD_ROOT/usr/share/doc/kernel-keys/$KernelVer/kernel-signing-ca.cer if [ $DoModules -eq 1 ]; then # Save the signing keys so we can sign the modules in __modsign_install_post cp certs/signing_key.pem certs/signing_key.pem.sign${Variant:++${Variant}} cp certs/signing_key.x509 certs/signing_key.x509.sign${Variant:++${Variant}} fi } ### # DO it... ### # prepare directories rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/boot mkdir -p $RPM_BUILD_ROOT/usr/libexec cd linux-6.17.8-300.zen1.fc43.x86_64 BuildKernel bzImage arch/x86/boot/bzImage 1 debug BuildKernel bzImage arch/x86/boot/bzImage 1 { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Build perf" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Build perf"" set -x # perf # make sure check-headers.sh is executable chmod +x tools/perf/check-headers.sh /usr/bin/make -s EXTRA_CFLAGS="${RPM_OPT_FLAGS}" EXTRA_CXXFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes -Wl,-E" -C tools/perf V=1 NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_STRLCPY=1 NO_BIONIC=1 LIBTRACEEVENT_DYNAMIC=1 prefix=/usr PYTHON=/usr/bin/python3 DESTDIR=$RPM_BUILD_ROOT all { set +x; } 2>/dev/null _log_msglineno=$(grep -n "build libperf" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "build libperf"" set -x /usr/bin/make -s EXTRA_CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -C tools/lib/perf V=1 DESTDIR=$RPM_BUILD_ROOT # link against in-tree libcpupower for idle state support # Build libcpupower Python bindings pushd tools/net/ynl export PIP_CONFIG_FILE=/tmp/pip.config cat < $PIP_CONFIG_FILE [install] no-index = true no-build-isolation = false EOF CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s -j${RPM_BUILD_NCPUS} DESTDIR=$RPM_BUILD_ROOT install popd # cpupower # make sure version-gen.sh is executable. chmod +x tools/power/cpupower/utils/version-gen.sh { set +x; } 2>/dev/null _log_msglineno=$(grep -n "build cpupower" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "build cpupower"" set -x CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s -j${RPM_BUILD_NCPUS} -C tools/power/cpupower CPUFREQ_BENCH=false DEBUG=false pushd tools/power/cpupower/debug/x86_64 { set +x; } 2>/dev/null _log_msglineno=$(grep -n "build centrino-decode powernow-k8-decode" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "build centrino-decode powernow-k8-decode"" set -x CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s -j${RPM_BUILD_NCPUS} centrino-decode powernow-k8-decode popd pushd tools/power/x86/x86_energy_perf_policy/ { set +x; } 2>/dev/null _log_msglineno=$(grep -n "build x86_energy_perf_policy" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "build x86_energy_perf_policy"" set -x CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s popd pushd tools/power/x86/turbostat { set +x; } 2>/dev/null _log_msglineno=$(grep -n "build turbostat" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "build turbostat"" set -x CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s popd pushd tools/power/x86/intel-speed-select { set +x; } 2>/dev/null _log_msglineno=$(grep -n "build intel-speed-select" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "build intel-speed-select"" set -x CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s popd pushd tools/arch/x86/intel_sdsi { set +x; } 2>/dev/null _log_msglineno=$(grep -n "build intel_sdsi" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "build intel_sdsi"" set -x CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s CFLAGS="${RPM_OPT_FLAGS}" popd pushd tools/thermal/tmon/ { set +x; } 2>/dev/null _log_msglineno=$(grep -n "build tmon" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "build tmon"" set -x CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s popd pushd tools/bootconfig/ { set +x; } 2>/dev/null _log_msglineno=$(grep -n "build bootconfig" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "build bootconfig"" set -x CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s popd pushd tools/iio/ { set +x; } 2>/dev/null _log_msglineno=$(grep -n "build iio" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "build iio"" set -x CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s popd pushd tools/gpio/ { set +x; } 2>/dev/null _log_msglineno=$(grep -n "build gpio" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "build gpio"" set -x CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s popd # build VM tools pushd tools/mm/ { set +x; } 2>/dev/null _log_msglineno=$(grep -n "build slabinfo page_owner_sort" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "build slabinfo page_owner_sort"" set -x CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s slabinfo page_owner_sort popd pushd tools/verification/rv/ { set +x; } 2>/dev/null _log_msglineno=$(grep -n "build rv" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "build rv"" set -x CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s popd pushd tools/tracing/rtla { set +x; } 2>/dev/null _log_msglineno=$(grep -n "build rtla" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "build rtla"" set -x CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes -L../../power/cpupower" INCLUDES="-I../../power/cpupower/lib" popd #set RPM_VMLINUX_H if [ -f $RPM_BUILD_ROOT/$DevelDir/vmlinux.h ]; then RPM_VMLINUX_H=$RPM_BUILD_ROOT/$DevelDir/vmlinux.h elif [ -f $DevelDir/vmlinux.h ]; then RPM_VMLINUX_H=$DevelDir/vmlinux.h fi echo "${RPM_VMLINUX_H}" > ../vmlinux_h_path { set +x; } 2>/dev/null _log_msglineno=$(grep -n "start build selftests" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "start build selftests"" set -x # Unfortunately, samples/bpf/Makefile expects that the headers are installed # in the source tree. We installed them previously to $RPM_BUILD_ROOT/usr # but there'\''s no way to tell the Makefile to take them from there. { set +x; } 2>/dev/null _log_msglineno=$(grep -n "install headers for selftests" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "install headers for selftests"" set -x /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -j${RPM_BUILD_NCPUS} headers_install # If we re building only tools without kernel, we need to generate config # headers and prepare tree for modules building. The modules_prepare target # will cover both. if [ ! -f include/generated/autoconf.h ]; then { set +x; } 2>/dev/null _log_msglineno=$(grep -n "modules_prepare for selftests" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "modules_prepare for selftests"" set -x /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -j${RPM_BUILD_NCPUS} modules_prepare fi # Build BPFtool for samples/bpf if [ ! -f tools/bpf/bpftool/bootstrap/bpftool ]; then BuildBpftool fi { set +x; } 2>/dev/null _log_msglineno=$(grep -n "build samples/bpf" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "build samples/bpf"" set -x /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -j${RPM_BUILD_NCPUS} EXTRA_CXXFLAGS="${RPM_OPT_FLAGS}" ARCH=$Arch BPFTOOL=$(pwd)/tools/bpf/bpftool/bootstrap/bpftool V=1 M=samples/bpf/ VMLINUX_H="${RPM_VMLINUX_H}" || true pushd tools/testing/selftests # We need to install here because we need to call make with ARCH set which # doesn'\''t seem possible to do in the install section. force_targets="" { set +x; } 2>/dev/null _log_msglineno=$(grep -n "main selftests compile" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "main selftests compile"" set -x # Some selftests (especially bpf) do not build with source fortification. # Since selftests are not shipped, disable source fortification for them. export CFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " export CXXFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -j${RPM_BUILD_NCPUS} EXTRA_CFLAGS="${RPM_OPT_FLAGS}" EXTRA_CXXFLAGS="${RPM_OPT_FLAGS}" EXTRA_LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " ARCH=$Arch V=1 TARGETS="bpf cgroup kmod mm net net/forwarding net/mptcp net/netfilter net/packetdrill tc-testing memfd drivers/net drivers/net/hw iommu cachestat pid_namespace rlimits timens pidfd" SKIP_TARGETS="" $force_targets INSTALL_PATH=/rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests VMLINUX_H="${RPM_VMLINUX_H}" install # Restore the original level of source fortification export CFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " export CXXFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " # '\''make install'\'' for bpf is broken and upstream refuses to fix it. # Install the needed files manually. { set +x; } 2>/dev/null _log_msglineno=$(grep -n "install selftests" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "install selftests"" set -x for dir in bpf bpf/no_alu32 bpf/progs; do # In ARK, the rpm build continues even if some of the selftests # cannot be built. It'\''s not always possible to build selftests, # as upstream sometimes dependens on too new llvm version or has # other issues. If something did not get built, just skip it. test -d $dir || continue mkdir -p /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/$dir find $dir -maxdepth 1 -type f \( -executable -o -name '\''*.py'\'' -o -name settings -o \ -name '\''btf_dump_test_case_*.c'\'' -o -name '\''*.ko'\'' -o \ -name '\''*.o'\'' -exec sh -c '\''readelf -h "{}" | grep -q "^ Machine:.*BPF"'\'' \; \) -print0 | \ xargs -0 cp -t /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/$dir || true done (cd /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT; cp -rav --parents -t /rpmbuild/BUILD/kernel-6.17.8-build/root_unstripped/ "usr/libexec/kselftests/bpf/test_progs" || true) (cd /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT; cp -rav --parents -t /rpmbuild/BUILD/kernel-6.17.8-build/root_unstripped/ "usr/libexec/kselftests/bpf/test_progs-no_alu32" || true) # The urandom_read binary doesn'\''t pass the check-rpaths check and upstream # refuses to fix it. So, we save it to buildroot_unstripped and delete it so it # will be hidden from check-rpaths and will automatically get restored later. (cd /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT; cp -rav --parents -t /rpmbuild/BUILD/kernel-6.17.8-build/root_unstripped/ "usr/libexec/kselftests/bpf/urandom_read" || true) (cd /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT; cp -rav --parents -t /rpmbuild/BUILD/kernel-6.17.8-build/root_unstripped/ "usr/libexec/kselftests/bpf/no_alu32/urandom_read" || true) rm -f /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/bpf/urandom_read rm -f /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/bpf/no_alu32/urandom_read # Copy bpftool to kselftests so selftests is packaged with # the full bpftool instead of bootstrap bpftool cp ./bpf/tools/sbin/bpftool /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/bpf/bpftool popd { set +x; } 2>/dev/null _log_msglineno=$(grep -n "end build selftests" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "end build selftests"" set -x # Module signing (modsign) # # This must be run _after_ find-debuginfo.sh runs, otherwise that will strip # the signature off of the modules. # # Don'\''t sign modules for the zfcpdump variant as it is monolithic. ### ### Special hacks for debuginfo subpackages. ### # This macro is used by %install, so we must redefine it before that.' export FR_INSTALL='cd linux-6.17.8-300.zen1.fc43.x86_64 # re-define RPM_VMLINUX_H, because it doesn'\''t carry over from %build RPM_VMLINUX_H="$(cat ../vmlinux_h_path)" # We have to do the headers install before the tools install because the # kernel headers_install will remove any header files in /usr/include that # it doesn'\''t install itself. # perf tool binary and supporting scripts/binaries /usr/bin/make -s EXTRA_CFLAGS="${RPM_OPT_FLAGS}" EXTRA_CXXFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes -Wl,-E" -C tools/perf V=1 NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_STRLCPY=1 NO_BIONIC=1 LIBTRACEEVENT_DYNAMIC=1 prefix=/usr PYTHON=/usr/bin/python3 DESTDIR=$RPM_BUILD_ROOT lib=lib64 install-bin # remove the '\''trace'\'' symlink. rm -f /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/bin/trace # For both of the below, yes, this should be using a macro but right now # it'\''s hard coded and we don'\''t actually want it anyway right now. # Whoever wants examples can fix it up! # remove examples rm -rf /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/lib/perf/examples rm -rf /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/lib/perf/include # python-perf extension /usr/bin/make -s EXTRA_CFLAGS="${RPM_OPT_FLAGS}" EXTRA_CXXFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes -Wl,-E" -C tools/perf V=1 NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_STRLCPY=1 NO_BIONIC=1 LIBTRACEEVENT_DYNAMIC=1 prefix=/usr PYTHON=/usr/bin/python3 DESTDIR=$RPM_BUILD_ROOT install-python_ext # perf man pages (note: implicit rpm magic compresses them later) mkdir -p /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT//usr/share/man/man1 /usr/bin/make -s EXTRA_CFLAGS="${RPM_OPT_FLAGS}" EXTRA_CXXFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes -Wl,-E" -C tools/perf V=1 NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_STRLCPY=1 NO_BIONIC=1 LIBTRACEEVENT_DYNAMIC=1 prefix=/usr PYTHON=/usr/bin/python3 DESTDIR=$RPM_BUILD_ROOT install-man # remove any tracevent files, eg. its plugins still gets built and installed, # even if we build against system'\''s libtracevent during perf build (by setting # LIBTRACEEVENT_DYNAMIC=1 above in perf_make macro). Those files should already # ship with libtraceevent package. rm -rf /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/lib64/traceevent /usr/bin/make -s EXTRA_CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -C tools/lib/perf V=1 DESTDIR=/rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT prefix=/usr libdir=/usr/lib64 install install_headers # This is installed on some arches and we don'\''t want to ship it rm -rf /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/lib64/libperf.a /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -C tools/power/cpupower DESTDIR=$RPM_BUILD_ROOT libdir=/usr/lib64 libexecdir=/usr/libexec mandir=/usr/share/man unitdir=/usr/lib/systemd/system CPUFREQ_BENCH=false install /usr/lib/rpm/find-lang.sh /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT cpupower mv cpupower.lang ../ pushd tools/power/cpupower/debug/x86_64 install -m755 centrino-decode /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/bin/centrino-decode install -m755 powernow-k8-decode /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/bin/powernow-k8-decode popd chmod 0755 /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/lib64/libcpupower.so* { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Build libcpupower Python bindings" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Build libcpupower Python bindings"" set -x pushd tools/power/cpupower/bindings/python CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s LDFLAGS="-L/rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/lib64 -lcpupower" { set +x; } 2>/dev/null _log_msglineno=$(grep -n "Install libcpupower Python bindings" /rpmbuild/SPECS/${RPM_PACKAGE_NAME}.spec | grep log_msg | cut -d":" -f1) echo "kernel.spec:${_log_msglineno}: "Install libcpupower Python bindings"" set -x /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " INSTALL_DIR=$RPM_BUILD_ROOT%{python3_sitearch} install popd mkdir -p /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/share/man/man8 pushd tools/power/x86/x86_energy_perf_policy CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s DESTDIR=/rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT install popd pushd tools/power/x86/turbostat CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s DESTDIR=/rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT install popd pushd tools/power/x86/intel-speed-select CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s DESTDIR=/rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT install popd pushd tools/arch/x86/intel_sdsi CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s CFLAGS="${RPM_OPT_FLAGS}" DESTDIR=/rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT BINDIR=/usr/bin install popd pushd tools/thermal/tmon CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s INSTALL_ROOT=/rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT install popd pushd tools/bootconfig CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s DESTDIR=/rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT install popd pushd tools/iio CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s DESTDIR=/rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT install popd pushd tools/gpio CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s DESTDIR=/rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT install popd install -m644 -D /rpmbuild/SOURCES/kvm_stat.logrotate /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/etc/logrotate.d/kvm_stat pushd tools/kvm/kvm_stat /usr/bin/make INSTALL_ROOT=/rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT install-tools /usr/bin/make INSTALL_ROOT=/rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT install-man install -m644 -D kvm_stat.service /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/lib/systemd/system/kvm_stat.service popd # install VM tools pushd tools/mm/ install -m755 slabinfo /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/bin/slabinfo install -m755 page_owner_sort /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/bin/page_owner_sort popd pushd tools/verification/rv/ CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s DESTDIR=/rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT install popd pushd tools/tracing/rtla/ CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " EXTRA_CFLAGS="${RPM_OPT_FLAGS}" /usr/bin/make -s HOSTCFLAGS="-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 " HOSTLDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes " -s DESTDIR=/rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT install rm -f /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/bin/hwnoise rm -f /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/bin/osnoise rm -f /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/bin/timerlat (cd /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT ln -sf rtla .//usr/bin/hwnoise ln -sf rtla .//usr/bin/osnoise ln -sf rtla .//usr/bin/timerlat ) popd pushd samples install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/ksamples # install bpf samples pushd bpf install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/ksamples/bpf find -type f -executable -exec install -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/ksamples/bpf \; install -m755 *.sh /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/ksamples/bpf # test_lwt_bpf.sh compiles test_lwt_bpf.c when run; this works only from the # kernel tree. Just remove it. rm /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/ksamples/bpf/test_lwt_bpf.sh install -m644 *_kern.o /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/ksamples/bpf || true install -m644 tcp_bpf.readme /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/ksamples/bpf popd # install pktgen samples pushd pktgen install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/ksamples/pktgen find . -type f -executable -exec install -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/ksamples/pktgen/{} \; find . -type f ! -executable -exec install -m644 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/ksamples/pktgen/{} \; popd popd # install mm selftests pushd tools/testing/selftests/mm find -type d -exec install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/mm/{} \; find -type f -executable -exec install -D -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/mm/{} \; find -type f ! -executable -exec install -D -m644 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/mm/{} \; popd # install cgroup selftests pushd tools/testing/selftests/cgroup find -type d -exec install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/cgroup/{} \; find -type f -executable -exec install -D -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/cgroup/{} \; find -type f ! -executable -exec install -D -m644 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/cgroup/{} \; popd # install drivers/net selftests pushd tools/testing/selftests/drivers/net find -type d -exec install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/drivers/net/{} \; find -type f -executable -exec install -D -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/drivers/net/{} \; find -type f ! -executable -exec install -D -m644 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/drivers/net/{} \; popd # install drivers/net/mlxsw selftests pushd tools/testing/selftests/drivers/net/mlxsw find -type d -exec install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/drivers/net/mlxsw/{} \; find -type f -executable -exec install -D -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/drivers/net/mlxsw/{} \; find -type f ! -executable -exec install -D -m644 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/drivers/net/mlxsw/{} \; popd # install drivers/net/hw selftests pushd tools/testing/selftests/drivers/net/hw find -type d -exec install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/drivers/net/hw/{} \; find -type f -executable -exec install -D -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/drivers/net/hw/{} \; find -type f ! -executable -exec install -D -m644 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/drivers/net/hw/{} \; popd # install drivers/net/netdevsim selftests pushd tools/testing/selftests/drivers/net/netdevsim find -type d -exec install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/drivers/net/netdevsim/{} \; find -type f -executable -exec install -D -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/drivers/net/netdevsim/{} \; find -type f ! -executable -exec install -D -m644 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/drivers/net/netdevsim/{} \; popd # install drivers/net/bonding selftests pushd tools/testing/selftests/drivers/net/bonding find -type d -exec install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/drivers/net/bonding/{} \; find -type f -executable -exec install -D -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/drivers/net/bonding/{} \; find -type f ! -executable -exec install -D -m644 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/drivers/net/bonding/{} \; popd # install net/forwarding selftests pushd tools/testing/selftests/net/forwarding find -type d -exec install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/net/forwarding/{} \; find -type f -executable -exec install -D -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/net/forwarding/{} \; find -type f ! -executable -exec install -D -m644 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/net/forwarding/{} \; popd # install net/mptcp selftests pushd tools/testing/selftests/net/mptcp find -type d -exec install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/net/mptcp/{} \; find -type f -executable -exec install -D -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/net/mptcp/{} \; find -type f ! -executable -exec install -D -m644 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/net/mptcp/{} \; popd # install tc-testing selftests pushd tools/testing/selftests/tc-testing find -type d -exec install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/tc-testing/{} \; find -type f -executable -exec install -D -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/tc-testing/{} \; find -type f ! -executable -exec install -D -m644 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/tc-testing/{} \; popd # install net/netfilter selftests pushd tools/testing/selftests/net/netfilter find -type d -exec install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/net/netfilter/{} \; find -type f -executable -exec install -D -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/net/netfilter/{} \; find -type f ! -executable -exec install -D -m644 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/net/netfilter/{} \; popd # install net/packetdrill selftests pushd tools/testing/selftests/net/packetdrill find -type d -exec install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/net/packetdrill/{} \; find -type f -executable -exec install -D -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/net/packetdrill/{} \; find -type f ! -executable -exec install -D -m644 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/net/packetdrill/{} \; popd # install memfd selftests pushd tools/testing/selftests/memfd find -type d -exec install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/memfd/{} \; find -type f -executable -exec install -D -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/memfd/{} \; find -type f ! -executable -exec install -D -m644 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/memfd/{} \; popd # install iommu selftests pushd tools/testing/selftests/iommu find -type d -exec install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/iommu/{} \; find -type f -executable -exec install -D -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/iommu/{} \; find -type f ! -executable -exec install -D -m644 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/iommu/{} \; popd # install rlimits selftests pushd tools/testing/selftests/rlimits find -type d -exec install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/rlimits/{} \; find -type f -executable -exec install -D -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/rlimits/{} \; find -type f ! -executable -exec install -D -m644 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/rlimits/{} \; popd # install pid_namespace selftests pushd tools/testing/selftests/pid_namespace find -type d -exec install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/pid_namespace/{} \; find -type f -executable -exec install -D -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/pid_namespace/{} \; find -type f ! -executable -exec install -D -m644 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/pid_namespace/{} \; popd # install timens selftests pushd tools/testing/selftests/timens find -type d -exec install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/timens/{} \; find -type f -executable -exec install -D -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/timens/{} \; find -type f ! -executable -exec install -D -m644 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/timens/{} \; popd # install pidfd selftests pushd tools/testing/selftests/pidfd find -type d -exec install -d /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/pidfd/{} \; find -type f -executable -exec install -D -m755 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/pidfd/{} \; find -type f ! -executable -exec install -D -m644 {} /rpmbuild/BUILD/kernel-6.17.8-build/BUILDROOT/usr/libexec/kselftests/pidfd/{} \; popd ### ### clean ### ### ### scripts ###' declare -A FR_FILES FR_FILES[kernel]='' FR_FILES[kernel-debuginfo-common-x86_64]='' FR_FILES[perf]='/usr/bin/perf /usr/lib64/libperf-jvmti.so %dir /usr/libexec/perf-core /usr/libexec/perf-core/* /usr/share/man/man[1-8]/perf* /etc/bash_completion.d/perf %doc linux-6.17.8-300.zen1.fc43.x86_64/tools/perf/Documentation/examples.txt /usr/share/doc/perf-tip/tips.txt /usr/include/perf/perf_dlfilter.h' FR_FILES[perf-debuginfo]='' FR_FILES[python3-perf]='%{python3_sitearch}/*' FR_FILES[python3-perf-debuginfo]='' FR_FILES[libperf]='/usr/lib64/libperf.so.0 /usr/lib64/libperf.so.0.0.1' FR_FILES[libperf-devel]='/usr/lib64/libperf.so /usr/lib64/pkgconfig/libperf.pc /usr/include/internal/*.h /usr/include/perf/bpf_perf.h /usr/include/perf/core.h /usr/include/perf/cpumap.h /usr/include/perf/event.h /usr/include/perf/evlist.h /usr/include/perf/evsel.h /usr/include/perf/mmap.h /usr/include/perf/threadmap.h /usr/share/man/man3/libperf.3.gz /usr/share/man/man7/libperf-counting.7.gz /usr/share/man/man7/libperf-sampling.7.gz /usr/share/doc/libperf/examples/sampling.c /usr/share/doc/libperf/examples/counting.c /usr/share/doc/libperf/html/libperf.html /usr/share/doc/libperf/html/libperf-counting.html /usr/share/doc/libperf/html/libperf-sampling.html' FR_FILES[libperf-debuginfo]='' FR_FILES[kernel-tools]='/usr/bin/cpupower /usr/libexec/cpupower /usr/lib/systemd/system/cpupower.service %config(noreplace) /etc/cpupower-service.conf /usr/share/bash-completion/completions/cpupower /usr/bin/centrino-decode /usr/bin/powernow-k8-decode /usr/share/man/man[1-8]/cpupower* /usr/bin/x86_energy_perf_policy /usr/share/man/man8/x86_energy_perf_policy* /usr/bin/turbostat /usr/share/man/man8/turbostat* /usr/bin/intel-speed-select /usr/bin/intel_sdsi /usr/bin/tmon /usr/bin/bootconfig /usr/bin/iio_event_monitor /usr/bin/iio_generic_buffer /usr/bin/lsiio /usr/bin/lsgpio /usr/bin/gpio-hammer /usr/bin/gpio-event-mon /usr/bin/gpio-watch /usr/share/man/man1/kvm_stat* /usr/bin/kvm_stat /usr/lib/systemd/system/kvm_stat.service %config(noreplace) /etc/logrotate.d/kvm_stat /usr/bin/page_owner_sort /usr/bin/slabinfo /usr/bin/ynl* /usr/share/doc/ynl /usr/share/ynl %{python3_sitelib}/pyynl*' FR_FILES[kernel-tools-libs]='/usr/lib64/libcpupower.so.1 /usr/lib64/libcpupower.so.1.0.1' FR_FILES[kernel-tools-libs-devel]='/usr/lib64/libcpupower.so /usr/include/cpufreq.h /usr/include/cpuidle.h /usr/include/powercap.h %{python3_sitearch}/_raw_pylibcpupower.so %{python3_sitearch}/raw_pylibcpupower.py /usr/lib64/libynl* /usr/include/ynl' FR_FILES[kernel-tools-debuginfo]='' FR_FILES[rtla]='/usr/bin/rtla /usr/bin/hwnoise /usr/bin/osnoise /usr/bin/timerlat /usr/share/man/man1/rtla-hwnoise.1.gz /usr/share/man/man1/rtla-osnoise-hist.1.gz /usr/share/man/man1/rtla-osnoise-top.1.gz /usr/share/man/man1/rtla-osnoise.1.gz /usr/share/man/man1/rtla-timerlat-hist.1.gz /usr/share/man/man1/rtla-timerlat-top.1.gz /usr/share/man/man1/rtla-timerlat.1.gz /usr/share/man/man1/rtla.1.gz' FR_FILES[rv]='/usr/bin/rv /usr/share/man/man1/rv-list.1.gz /usr/share/man/man1/rv-mon-wip.1.gz /usr/share/man/man1/rv-mon-wwnr.1.gz /usr/share/man/man1/rv-mon.1.gz /usr/share/man/man1/rv-mon-sched.1.gz /usr/share/man/man1/rv.1.gz' FR_FILES[kernel-selftests-internal]='/usr/libexec/ksamples /usr/libexec/kselftests' FR_FILES[kernel-debug-core]='%license linux-6.17.8-300.zen1.fc43.x86_64/COPYING-6.17.8-300.zen1.fc43 /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/vmlinuz %ghost /boot/vmlinuz-6.17.8-300.zen1.fc43.x86_64+debug /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/.vmlinuz.hmac %ghost /boot/.vmlinuz-6.17.8-300.zen1.fc43.x86_64+debug.hmac /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/System.map %ghost /boot/System.map-6.17.8-300.zen1.fc43.x86_64+debug %dir /lib/modules %dir /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/symvers.xz /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/config /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/modules.builtin* %ghost %attr(0644, root, root) /boot/symvers-6.17.8-300.zen1.fc43.x86_64+debug.xz %ghost %attr(0600, root, root) /boot/initramfs-6.17.8-300.zen1.fc43.x86_64+debug.img %ghost %attr(0644, root, root) /boot/config-6.17.8-300.zen1.fc43.x86_64+debug' FR_FILES[kernel-debug]='' FR_FILES[kernel-debug-devel]='%defverify(not mtime) /usr/src/kernels/6.17.8-300.zen1.fc43.x86_64+debug' FR_FILES[kernel-debug-modules-core]='%dir /lib/modules %dir /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug %dir /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/kernel /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/build /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/source /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/updates /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/weak-updates /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/systemtap /usr/share/doc/kernel-keys/6.17.8-300.zen1.fc43.x86_64+debug /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/vdso /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/modules.block /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/modules.drm /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/modules.modesetting /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/modules.networking /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/modules.order %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/modules.alias %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/modules.alias.bin %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/modules.builtin.alias.bin %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/modules.builtin.bin %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/modules.dep %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/modules.dep.bin %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/modules.devname %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/modules.softdep %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/modules.symbols %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/modules.symbols.bin %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/modules.weakdep' FR_FILES[kernel-debug-modules-internal]='' FR_FILES[kernel-debug-debuginfo]='' FR_FILES[kernel-debug-uki-virt]='%dir /lib/modules %dir /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/System.map /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/symvers.xz /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/config /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/modules.builtin* %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/vmlinuz-virt.efi %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/.vmlinuz-virt.efi.hmac %ghost /boot/efi/EFI/Linux/*-6.17.8-300.zen1.fc43.x86_64+debug.efi' FR_FILES[kernel-debug-uki-virt-addons]='%dir /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/vmlinuz-virt.efi.extra.d/ /lib/modules/6.17.8-300.zen1.fc43.x86_64+debug/vmlinuz-virt.efi.extra.d/*.addon.efi' FR_FILES[kernel-core]='%license linux-6.17.8-300.zen1.fc43.x86_64/COPYING-6.17.8-300.zen1.fc43 /lib/modules/6.17.8-300.zen1.fc43.x86_64/vmlinuz %ghost /boot/vmlinuz-6.17.8-300.zen1.fc43.x86_64 /lib/modules/6.17.8-300.zen1.fc43.x86_64/.vmlinuz.hmac %ghost /boot/.vmlinuz-6.17.8-300.zen1.fc43.x86_64.hmac /lib/modules/6.17.8-300.zen1.fc43.x86_64/System.map %ghost /boot/System.map-6.17.8-300.zen1.fc43.x86_64 %dir /lib/modules %dir /lib/modules/6.17.8-300.zen1.fc43.x86_64 /lib/modules/6.17.8-300.zen1.fc43.x86_64/symvers.xz /lib/modules/6.17.8-300.zen1.fc43.x86_64/config /lib/modules/6.17.8-300.zen1.fc43.x86_64/modules.builtin* %ghost %attr(0644, root, root) /boot/symvers-6.17.8-300.zen1.fc43.x86_64.xz %ghost %attr(0600, root, root) /boot/initramfs-6.17.8-300.zen1.fc43.x86_64.img %ghost %attr(0644, root, root) /boot/config-6.17.8-300.zen1.fc43.x86_64' FR_FILES[kernel-devel]='%defverify(not mtime) /usr/src/kernels/6.17.8-300.zen1.fc43.x86_64' FR_FILES[kernel-modules-core]='%dir /lib/modules %dir /lib/modules/6.17.8-300.zen1.fc43.x86_64 %dir /lib/modules/6.17.8-300.zen1.fc43.x86_64/kernel /lib/modules/6.17.8-300.zen1.fc43.x86_64/build /lib/modules/6.17.8-300.zen1.fc43.x86_64/source /lib/modules/6.17.8-300.zen1.fc43.x86_64/updates /lib/modules/6.17.8-300.zen1.fc43.x86_64/weak-updates /lib/modules/6.17.8-300.zen1.fc43.x86_64/systemtap /usr/share/doc/kernel-keys/6.17.8-300.zen1.fc43.x86_64 /lib/modules/6.17.8-300.zen1.fc43.x86_64/vdso /lib/modules/6.17.8-300.zen1.fc43.x86_64/modules.block /lib/modules/6.17.8-300.zen1.fc43.x86_64/modules.drm /lib/modules/6.17.8-300.zen1.fc43.x86_64/modules.modesetting /lib/modules/6.17.8-300.zen1.fc43.x86_64/modules.networking /lib/modules/6.17.8-300.zen1.fc43.x86_64/modules.order %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64/modules.alias %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64/modules.alias.bin %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64/modules.builtin.alias.bin %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64/modules.builtin.bin %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64/modules.dep %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64/modules.dep.bin %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64/modules.devname %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64/modules.softdep %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64/modules.symbols %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64/modules.symbols.bin %ghost %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64/modules.weakdep' FR_FILES[kernel-modules-internal]='' FR_FILES[kernel-debuginfo]='' FR_FILES[kernel-uki-virt]='%dir /lib/modules %dir /lib/modules/6.17.8-300.zen1.fc43.x86_64 /lib/modules/6.17.8-300.zen1.fc43.x86_64/System.map /lib/modules/6.17.8-300.zen1.fc43.x86_64/symvers.xz /lib/modules/6.17.8-300.zen1.fc43.x86_64/config /lib/modules/6.17.8-300.zen1.fc43.x86_64/modules.builtin* %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64/vmlinuz-virt.efi %attr(0644, root, root) /lib/modules/6.17.8-300.zen1.fc43.x86_64/.vmlinuz-virt.efi.hmac %ghost /boot/efi/EFI/Linux/*-6.17.8-300.zen1.fc43.x86_64.efi' FR_FILES[kernel-uki-virt-addons]='%dir /lib/modules/6.17.8-300.zen1.fc43.x86_64/vmlinuz-virt.efi.extra.d/ /lib/modules/6.17.8-300.zen1.fc43.x86_64/vmlinuz-virt.efi.extra.d/*.addon.efi' FR_FILES[kernel-modules-extra-matched]='' declare -A FR_DESCRIPTION export FR_FILES FR_DESCRIPTION export FR_PASS=80 export FR_FAIL=81 export FR_PENDING=82 export FR_NOT_APPLICABLE=83 function get_used_rpms() # returns (stdout) list of used rpms if found, else returns 1 { cd $FR_REVIEWDIR if test "${FR_SETTINGS[prebuilt]}" = True then files=( $(ls ../*.rpm 2>/dev/null | grep -v .src.rpm) ) || files=( '@@' ) else files=( $(ls results/*.rpm 2>/dev/null | grep -v .src.rpm) ) || files=( '@@' ) fi test -e ${files[0]} || return 1 echo "${files[@]}" cd $OLDPWD } function unpack_rpms() # Unpack all non-src rpms in results into rpms-unpacked, one dir per rpm. { [ -d rpms-unpacked ] && return 0 rpms=( $( get_used_rpms ) ) || return 1 mkdir rpms-unpacked cd rpms-unpacked retval=0 for rpm_path in ${rpms[@]}; do rpm=$( basename $rpm_path) mkdir $rpm cd $rpm rpm2cpio ../../$rpm_path | cpio -imd &>/dev/null cd .. done cd .. } function unpack_sources() # Unpack sources in upstream into upstream-unpacked # Ignores (reuses) already unpacked items. { sources=( $(cd upstream; ls) ) || sources=( ) if [[ ${#sources[@]} -eq 0 || ! -e "upstream/${sources[0]}" ]]; then return $FR_NOT_APPLICABLE fi for source in "${sources[@]}"; do mkdir upstream-unpacked/$source 2>/dev/null || continue rpmdev-extract -qfC upstream-unpacked/$source upstream/$source || cp upstream/$source upstream-unpacked/$source done } function attach() # Usage: attach
# Reads attachment from stdin { startdir=$(pwd) cd $FR_REVIEWDIR for (( i = 0; i < 10; i++ )); do test -e $FR_REVIEWDIR/.attachments/*$i || break done if [ $i -eq 10 ]; then echo "More than 10 attachments! Giving up" >&2 exit 1 fi sort_hint=$1 shift title=${*//\/ } file="$sort_hint;${title/;/:};$i" cat > .attachments/"$file" cd $startdir }