commit 0c1868baf57c323ff3a5c72f42be65e7a767e9da Author: tigro Date: Wed Jun 5 12:04:43 2024 +0300 import kmodtool-1.1-4.el9 diff --git a/.kmodtool.metadata b/.kmodtool.metadata new file mode 100644 index 0000000..e69de29 diff --git a/SOURCES/kmodtool-brp-kmodsign b/SOURCES/kmodtool-brp-kmodsign new file mode 100644 index 0000000..437633e --- /dev/null +++ b/SOURCES/kmodtool-brp-kmodsign @@ -0,0 +1,45 @@ +#! /bin/bash + +# The modules_sign target checks for corresponding .o files for every .ko that +# is signed. This doesn't work for package builds which re-use the same build +# directory for every flavour, and the .config may change between flavours. +# So instead of using this script to just sign lib/modules/$KernelVer/extra, +# sign all .ko in the buildroot. + +# This essentially duplicates the 'modules_sign' Kbuild target and runs the +# same commands for those modules. + +MODSECKEY="$1" +MODPUBKEY="$2" +KERNELSRCDIR="$4" + +MOD_DIR="$3" +SCRIPTS_SIGN_BIN="scripts/sign-file" + +if [ -z "${MODSECKEY}" ] || [ -z "${MODPUBKEY}" ] || [ -z "${MOD_DIR}" ] ; then + echo "brp-kmodsign: missing parameters" + exit 1 +fi +if [ -z "${KERNELSRCDIR}" ] ; then + KERNELSRCDIR="." +fi +if [ ! -x "${KERNELSRCDIR}/${SCRIPTS_SIGN_BIN}" ] ; then + echo "brp-kmodsign: ${KERNELSRCDIR}/${SCRIPTS_SIGN_BIN} not found or not executable" + exit 1 +fi + +MODULES=$(find "${MOD_DIR}" -name "*.ko") + +for MOD in ${MODULES} +do + "${KERNELSRCDIR}/${SCRIPTS_SIGN_BIN}" sha256 "${MODSECKEY}" "${MODPUBKEY}" "${MOD}" + rm -f "${MOD}".{sig,dig} +done + +RANDOMMOD=$(find "${MOD_DIR}" -type f -name "*.ko" | sort -R | head -n 1) +if [ "~Module signature appended~" != "$(tail -c 28 ${RANDOMMOD})" ] ; then + echo "brp-kmodsign: modules are unsigned!" + exit 1 +fi + +exit 0 diff --git a/SOURCES/kmodtool-kernel-variants b/SOURCES/kmodtool-kernel-variants new file mode 100644 index 0000000..6b04ec1 --- /dev/null +++ b/SOURCES/kmodtool-kernel-variants @@ -0,0 +1 @@ +@(smp?(-debug)|PAE?(-debug)|lpae|debug|kdump|xen|kirkwood|highbank|imx|omap|tegra|rt) diff --git a/SOURCES/kmodtool-kmodtool b/SOURCES/kmodtool-kmodtool new file mode 100644 index 0000000..de659e1 --- /dev/null +++ b/SOURCES/kmodtool-kmodtool @@ -0,0 +1,648 @@ +#!/bin/bash + +# kmodtool - Helper script for building kernel module RPMs +# Copyright (c) 2003-2012 Ville Skyttä , +# Thorsten Leemhuis +# Copyright (c) 2012-2019 Nicolas Chauvet +# Copyright (c) 2017-2018 Nicolas Viéville +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +shopt -s extglob + +myprog="kmodtool-${repo}" +myver="0.12.1" + +kmodname= +build_kernels="current" +kernels_known_variants= +kernel_versions= +kernel_versions_to_build_for= +filterfile= +target= + +kernel_uname_r="" +kernel_uname_r_vanilla="" +kernel_uname_r_short="" +kernel_uname_r_wo_arch="" +kernel_uname_r_dist="" +kernel_uname_r_rel="" +kernel_uname_r_rel_plus_one="" +kernel_uname_r_short_plus_one="" +kernel_uname_r_rel_minor="" + +error_out() +{ + local errorlevel=${1} + shift + echo "Error: $@" >&2 + # the next line is not multi-line safe -- not needed *yet* + echo "%global kmodtool_check echo \"kmodtool error: $@\"; exit ${errorlevel};" + exit ${errorlevel} +} + +print_rpmtemplate_header() +{ + echo + echo '%global kmodinstdir_prefix '${usr_lib_modules}/ + echo '%global kmodinstdir_postfix '/extra/${kmodname}/ + echo '%global kernel_versions '${kernel_versions} + echo +} + +init_kernel_uname_r_vars() +{ + ## Build some interesting strings with kernel uname -r + ## Examples: + ## - Fedora and rhel: + ## kernel_uname_r 3.10.0-693.2.2.el7.x86_64 + ## kernel_uname_r_vanilla 3.10.0 + ## kernel_uname_r_short 3.10.0-693.el7 + ## kernel_uname_r_wo_arch 3.10.0-693.2.2.el7 + ## kernel_uname_r_dist el7 + ## kernel_uname_r_rel 693 + ## kernel_uname_r_rel_plus_one 694 + ## kernel_uname_r_short_plus_one 3.10.0-694.el7 + ## kernel_uname_r_rel_minor 2.2 + ## + kernel_uname_r=${1} + kernel_uname_r_vanilla=$(echo ${1} | sed -n -e "s/\.${target}//" -e "s/\([[:alnum:]\.]\+\|\)-\(.*\)/\1/p") + kernel_uname_r_short=$(echo ${1} | sed -n -e "s/\.${target}//" -e "s/\(.*\)-\([[:alnum:]]\+\)\(\.[[:alnum:]\.]\+\|\)\(\.el.*\|\.fc.*\)/\1-\2\4/p") + kernel_uname_r_wo_arch=$(echo ${1} | sed -e "s/\.${target}//") + kernel_uname_r_dist=$(echo ${1} | sed -n -e "s/\.${target}//" -e "s/\(.*\)-\([[:alnum:]]\+\.[[:alnum:]]\+\-\|[[:alnum:]]\+\)\([[:alnum:]\.]\+\|\)\(\.el.*\|\.fc.*\)/\4/" -e "s/^\.//p") + kernel_uname_r_rel=$(echo ${1} | sed -n -e "s/\.${target}//" -e "s/\(.*\)-\([[:alnum:]]\+\.[[:alnum:]]\+\-\|[[:alnum:]]\+\.\)\([[:alnum:]\.]\+\|\)\(.*\)/\2/" -e "s/^\.//" -e "s/[\.\-]$//p") + if $(echo "${kernel_uname_r_rel}" | grep -qE '^[0-9]+$') ; then + kernel_uname_r_rel_plus_one=$(( kernel_uname_r_rel+1 )) + else + kernel_uname_r_rel_plus_one="" + fi + kernel_uname_r_short_plus_one=$(echo ${kernel_uname_r_short} | sed -e "s/(//" -e "s/-${kernel_uname_r_rel}\./-${kernel_uname_r_rel_plus_one}\./") + kernel_uname_r_rel_minor=$(echo ${1} | sed -n -e "s/\.${target}//" -e "s/\(.*\)-\([[:alnum:]]\+\.[[:alnum:]]\+\-\|[[:alnum:]]\+\.\)\([[:alnum:]\.]\+\|\)\(\.el.*\|\.fc.*\)/\3/" -e "s/^\.//p") +} + +print_rpmtemplate_macros() +{ + # Defines package names macros depending on distributions (default + # is Fedora): + # - rhel_kabi is set if building for RHEL + # - kmod_pkg_name and pkg_kmod_name are the two possible forms of + # the package name used when building packages modules. First one + # uses kmod as prefix, the second one uses kmod as suffix. These + # macros allow to modify the naming schema regarding the target + # distribution (for example with suffix and prefix different from + # kmod). + # - kmod_obsolete_name same as kmod_pkg_name and pkg_kmod_name but + # for obsolete package name + # + if [[ -n ${obsolete_name} ]] ; then + echo '%global obsolete_name '${obsolete_name} + fi + cat <= %{?epoch:%{epoch}:}%{version} +Provides: %{pkg_kmod_name} = %{?epoch:%{epoch}:}%{version}-%{release} +EOF + + if [[ -n "${obsolete_name}" ]] ; then + echo "Provides: akmod-${obsolete_name} = ${obsolete_version}" + echo "Obsoletes: akmod-${obsolete_name} < ${obsolete_version}" + fi + + cat < /dev/null & + +%post -n akmod-${kmodname} +[ -x /usr/sbin/akmods-ostree-post ] && /usr/sbin/akmods-ostree-post ${kmodname} %{_usrsrc}/akmods/%{pkg_kmod_name}-%{version}-%{release}.src.rpm + +%files -n akmod-${kmodname} +%defattr(-,root,root,-) +%{_usrsrc}/akmods/* +EOF +} + +print_akmodmeta () +{ + cat <= %{?epoch:%{epoch}:}%{version} +Requires(post): %{?_prefix_usr}/sbin/depmod +Requires(postun): %{?_prefix_usr}/sbin/depmod +%if %{with rhel_kabi} +Requires(post): %{?_prefix_usr}/sbin/weak-modules +Requires(postun): %{?_prefix_usr}/sbin/weak-modules +%endif +EOF + + if [[ -n "${obsolete_name}" ]] ; then + echo + echo "Provides: %{kmod_obsolete_name}-${kernel_uname_r} = ${obsolete_version}" + echo "Obsoletes: %{kmod_obsolete_name}-${kernel_uname_r} < ${obsolete_version}" + fi + + # second part + if [[ ! -n "${customkernel}" ]] ; then + cat </dev/null ; \\\ +elif [ -f /lib/modules/${kernel_uname_r}/System.map ] ; then \\\ + %{?_prefix_usr}/sbin/depmod -aeF /lib/modules/${kernel_uname_r}/System.map ${kernel_uname_r} >/dev/null ; \\\ +else \\\ + %{?_prefix_usr}/sbin/depmod -a >/dev/null ; \\\ +fi || : + +%if %{with rhel_kabi} +Requires: kernel >= ${kernel_uname_r_short} +Requires: kernel < ${kernel_uname_r_short_plus_one} +BuildRequires: kernel-devel = ${kernel_uname_r_wo_arch} redhat-rpm-config +%else +Requires: kernel-uname-r = ${kernel_uname_r} +BuildRequires: kernel-devel-uname-r = ${kernel_uname_r} +BuildRequires: gcc +%endif + +%post -n %{package_kmod_name} +%{_kmodtool_depmod_post} + +%if %{with rhel_kabi} +modules=( \$(find ${usr_lib_modules}/${kernel_uname_r}/extra/${kmodname}/ -name "*.ko" -o -name "*.ko.xz") ) +printf '%s\n' "\${modules[@]}" | %{?_prefix_usr}/sbin/weak-modules --add-modules +%endif + +%if %{with rhel_kabi} +%preun -n %{package_kmod_name} +rpm -ql %{package_kmod_name}-%{version}-%{release}.$(arch) | grep -e '\.ko$' -e '\.ko.xz$' > /var/run/rpm-%{package_kmod_name}-modules +%endif + +%postun -n %{package_kmod_name} +%{_kmodtool_depmod_post} + +%if %{with rhel_kabi} +modules=( \$(cat /var/run/rpm-%{package_kmod_name}-modules) ) +rm -f /var/run/rpm-%{package_kmod_name}-modules +printf '%s\n' "\${modules[@]}" | %{?_prefix_usr}/sbin/weak-modules --remove-modules +%endif +EOF + else + cat < /dev/null || : + +%if %{with rhel_kabi} +if [[ "\$(uname -r)" == "${kernel_uname_r}" ]] ; then + modules=( \$(find ${usr_lib_modules}/${kernel_uname_r}/extra/${kmodname}/ -name "*.ko" -o -name "*.ko.xz") ) + printf '%s\n' "\${modules[@]}" | %{?_prefix_usr}/sbin/weak-modules --add-modules +fi +%endif + +%if %{with rhel_kabi} +%preun -n %{package_kmod_name} +if [[ "\$(uname -r)" == "${kernel_uname_r}" ]] ; then + rpm -ql %{package_kmod_name}-%{version}-%{release}.$(arch) | grep -e '\.ko$' -e '\.ko.xz$' > /var/run/rpm-%{package_kmod_name}-modules +fi +%endif + +%postun -n %{package_kmod_name} +[[ "\$(uname -r)" == "${kernel_uname_r}" ]] && %{?_prefix_usr}/sbin/depmod -a > /dev/null || : + +%if %{with rhel_kabi} +if [[ "\$(uname -r)" == "${kernel_uname_r}" ]] ; then + modules=( \$(cat /var/run/rpm-%{package_kmod_name}-modules) ) + rm -f /var/run/rpm-%{package_kmod_name}-modules + printf '%s\n' "\${modules[@]}" | %{?_prefix_usr}/sbin/weak-modules --remove-modules +fi +%endif +EOF + fi + + # third part + cat <= %{?epoch:%{epoch}:}%{version}-%{release} +EOF + + if [[ -n "${obsolete_name}" ]] ; then + echo "Provides: %{kmod_obsolete_name}${kernel_variant} = ${obsolete_version}" + echo "Obsoletes: %{kmod_obsolete_name}${kernel_variant} < ${obsolete_version}" + fi + + cat < -- look for our shared files in " + echo " --filterfile -- filter the results with grep --file " + echo " --for-kernels -- created templates only for these kernels" + echo " --kmodname -- name of the kmod (required)" + echo " --noakmod -- no akmod package" + echo " --repo -- use buildsys-build--kerneldevpkgs" + echo " --target -- target-arch (required)" +} + +while [ "${1}" ] ; do + case "${1}" in + --filterfile) + shift + if [[ ! -n "${1}" ]] ; then + error_out 2 "Please provide path to a filter-file together with --filterfile" >&2 + elif [[ ! -e "${1}" ]] ; then + error_out 2 "Filterfile ${1} not found" >&2 + fi + filterfile="${1}" + shift + ;; + --kmodname) + shift + if [[ ! -n "${1}" ]] ; then + error_out 2 "Please provide the name of the kmod together with --kmodname" >&2 + fi + # strip pending -kmod + kmodname="${1%%-kmod}" + shift + ;; + --repo) + shift + if [[ ! -n "${1}" ]] ; then + error_out 2 "Please provide the name of the repo together with --repo" >&2 + fi + repo=${1} + shift + ;; + --for-kernels) + shift + if [[ ! -n "${1}" ]] ; then + error_out 2 "Please provide the name of the kmod together with --kmodname" >&2 + fi + for_kernels="${1}" + shift + ;; + --noakmod) + shift + noakmod="true" + ;; + --obsolete-name) + shift + if [[ ! -n "${1}" ]] ; then + error_out 2 "Please provide the name of the kmod to obsolte together with --obsolete-name" >&2 + fi + obsolete_name="${1}" + shift + ;; + --obsolete-version) + shift + if [[ ! -n "${1}" ]] ; then + error_out 2 "Please provide the version of the kmod to obsolte together with --obsolete-version" >&2 + fi + obsolete_version="${1}" + shift + ;; + --target) + shift + target="${1}" + shift + ;; + --akmod) + shift + build_kernels="akmod" + ;; + --newest) + shift + build_kernels="newest" + ;; + --current) + shift + build_kernels="current" + ;; + --help) + myprog_help + exit 0 + ;; + --version) + echo "${myprog} ${myver}" + exit 0 + ;; + *) + echo "Error: Unknown option '${1}'." >&2 + usage >&2 + exit 2 + ;; + esac +done + +# These should always be in /lib/modules +# as that's how the kernel package lays them out +usr_lib_modules=/lib/modules + +if [[ -e ./kmodtool-kernel-variants ]] ; then + kernels_known_variants="$(cat ./kmodtool-kernel-variants)" +elif [[ -e /usr/share/kmodtool/kernel-variants ]] ; then + kernels_known_variants="$(cat /usr/share/kmodtool/kernel-variants)" +else + error_out 2 "Could not find /usr/share/kmodtool/kernel-variants" +fi + +# general sanity checks +if [[ ! -n "${target}" ]] ; then + error_out 2 "please pass target arch with --target" +elif [[ ! -n "${kmodname}" ]] ; then + error_out 2 "please pass kmodname with --kmodname" +elif [[ ! -n "${kernels_known_variants}" ]] ; then + error_out 2 "could not determine known variants" +elif ( [[ -n "${obsolete_name}" ]] && [[ ! -n "${obsolete_version}" ]] ) || ( [[ ! -n "${obsolete_name}" ]] && [[ -n "${obsolete_version}" ]] ) ; then + error_out 2 "you need to provide both --obsolete-name and --obsolete-version" +fi + +# go +print_rpmtemplate_macros +if [[ -n "${for_kernels}" ]] ; then + # this is easy: + print_customrpmtemplate "${for_kernels}" +elif [[ "${build_kernels}" == "akmod" ]] ; then + # do only a akmod package + print_akmodtemplate + print_akmodmeta +else + # seems we are on out own to decide for which kernels to build + + # we need more sanity checks in this case + if [[ ! -n "${repo}" ]] ; then + error_out 2 "please provide repo name with --repo" + elif ! $(which buildsys-build-${repo}-kerneldevpkgs &> /dev/null) ; then + error_out 2 "buildsys-build-${repo}-kerneldevpkgs not found" + fi + + # call buildsys-build-${repo}-kerneldevpkgs to get the list of kernels + cmdoptions="--target ${target}" + + # filterfile to filter list of kernels? + if [[ -n "${filterfile}" ]] ; then + cmdoptions="${cmdoptions} --filterfile ${filterfile}" + fi + + kernel_versions_to_build_for="$(buildsys-build-${repo}-kerneldevpkgs --${build_kernels} ${cmdoptions})" + returncode=$? + if (( ${returncode} != 0 )) ; then + error_out 2 "buildsys-build-${repo}-kerneldevpkgs failed: $(buildsys-build-${repo}-kerneldevpkgs --${build_kernels} ${cmdoptions})" + fi + + if [[ "${build_kernels}" == "current" ]] && [[ ! -n "${noakmod}" ]] ; then + print_akmodtemplate + fi + + print_rpmtemplate +fi diff --git a/SOURCES/macros.kmodtool b/SOURCES/macros.kmodtool new file mode 100644 index 0000000..9dedd27 --- /dev/null +++ b/SOURCES/macros.kmodtool @@ -0,0 +1,114 @@ +# /etc/rpm/macros.kmodtool: kmodtool keypair sign and zip config. +# +# This file controls signing and zipping modules on the system, included +# akmods ones. +# It uses the rpm macros syntax to define global symbol imported +# directly by kmodtool while rebuilding kmods. +# +# Signing modules +# +# __kmodtool_signmodules can take one of these two values: +# 1 - Modules would be signed when rebuilding modules. +# 0 - No signed modules when rebuilding modules. +# __kmodtool_signmodules_pubkey gives path and name of the public key to +# be used to sign newly build modules. +# __kmodtool_signmodules_privkey gives path and name of the private key to +# be used to sign newly build modules. +# +# __kmodtool_signmodules* macros can be overriden by users and/or +# packagers provided that those values and their dependencies are +# manually checked. Be carefull when modifying these values. To override +# these macros please define these ones in your spec file (one +# underscore as prefix and not two): +# - _kmodtool_signmodules +# - _kmodtool_signmodules_pubkey +# - _kmodtool_signmodules_privkey +# It is also possible to uncomment one or several of the macros provided +# below: +#%%_kmodtool_signmodules 0 +#%%_kmodtool_signmodules 1 +#%%_kmodtool_signmodules_pubkey /path/to/your/public_key.der +#%%_kmodtool_signmodules_privkey /path/to/your/private_key.der +# +# Signing modules is enabled in Fedora kernels for every arches, +# even if kernels are not signed for arches other than +# %%{ix86} x86_64 aarch64. +# +# Sign modules on x86. Make sure the config files match this setting if +# more architectures are added. +%__kmodtool_signmodules %{?_kmodtool_signmodules:%{_kmodtool_signmodules}}%{!?_kmodtool_signmodules:1} + +# This is current keypair enrolled in MOK to sign modules +%__kmodtool_signmodules_pubkey %{?_kmodtool_signmodules_pubkey:%{_kmodtool_signmodules_pubkey}}%{!?_kmodtool_signmodules_pubkey:/etc/pki/akmods/certs/public_key.der} +%__kmodtool_signmodules_privkey %{?_kmodtool_signmodules_privkey:%{_kmodtool_signmodules_privkey}}%{!?_kmodtool_signmodules_privkey:/etc/pki/akmods/private/private_key.priv} + +# Define signing macros +# +%__kmodtool_modsign_cmd %{_rpmconfigdir}/brp-kmodsign +%__kmodtool_modsign_install_post \ +if [ "%{__kmodtool_signmodules}" -eq "1" ] && [ -x %{__kmodtool_modsign_cmd} ] && [ -e %{__kmodtool_signmodules_privkey} ] && [ -e %{__kmodtool_signmodules_pubkey} ] ; then\ + %{__kmodtool_modsign_cmd} %{__kmodtool_signmodules_privkey} %{__kmodtool_signmodules_pubkey} %{buildroot}%{kmodinstdir_prefix}%{__kmodtool_kernel_uname_r}%{kmodinstdir_postfix} /usr/src/kernels/%{__kmodtool_kernel_uname_r}\ +fi\ +%{nil} + +# Zipping modules +# +# __kmodtool_zipmodules can take one of these two values: +# 1 - Modules would be zipped when rebuilding modules. +# 0 - No zipped modules when rebuilding modules. +# +# __kmodtool_zipmodules* macros can be overriden by users and/or packagers +# provided that those values and their dependencies are manually +# checked. Be carefull when modifying these values. To override these +# macros please define these ones in your spec file (one underscore as +# prefix and not two): +# - _kmodtool_zipmodules +# It is also possible to uncomment one of the macros provided below: +#%%_kmodtool_zipmodules 0 +#%%_kmodtool_zipmodules 1 +# +# Zipping modules according to Fedora kernels sources is enabled only +# for arches %%{ix86} x86_64 aarch64. For information zipping kernel +# modules is available since rhel 7.x and fedora 21. +# Settings below conform to this directives. +# +# Zip modules on x86 x86_64 aarch64. Make sure the config files match +# this setting if more architectures are added. +%__kmodtool_zipmodules_arch_ok %( +echo %{ix86} x86_64 aarch64 | grep -qwo %{_arch} +if [ $? -eq 0 ] ; then + echo 1 +else + echo 0 +fi +) + +# Distributions where zipping is enabled by default +%__kmodtool_zipmodules_dist_ok %( +if (( %{?rhel} + 0 > 6 || %{?fedora} + 0 > 20 )) ; then + echo 1 +else + echo 0 +fi +) + +# Put arches and distributions conditions together +%__kmodtool_zipmodules_ok %( +if (( %{?__kmodtool_zipmodules_arch_ok} && %{?__kmodtool_zipmodules_dist_ok} )) ; then + echo 1 +else + echo 0 +fi +) + +# Put them all in place +%__kmodtool_zipmodules %{?_kmodtool_zipmodules:%{_kmodtool_zipmodules}}%{!?_kmodtool_zipmodules:%{?__kmodtool_zipmodules_ok}} + + +# Define zipping macros +# +%__kmodtool_modzip_install_post\ +if [ "%{__kmodtool_zipmodules}" -eq "1" ] ; then\ + find %{buildroot}%{kmodinstdir_prefix}%{__kmodtool_kernel_uname_r}%{kmodinstdir_postfix} -type f -name '*.ko' | xargs xz;\ +fi\ +%{nil} diff --git a/SPECS/kmodtool.spec b/SPECS/kmodtool.spec new file mode 100644 index 0000000..326a668 --- /dev/null +++ b/SPECS/kmodtool.spec @@ -0,0 +1,300 @@ +# Define rpm macros directory for rhel6 and rhel7 +%{!?_rpmmacrodir: %define _rpmmacrodir /usr/lib/rpm/macros.d} + +Name: kmodtool +Version: 1.1 +Release: 4%{?dist} +Summary: Tool for building kmod packages +License: MIT +URL: http://rpmfusion.org/Packaging/KernelModules/Kmods2 +# We are upstream, these files are maintained directly in pkg-git +Source1: %{name}-kmodtool +Source2: %{name}-kernel-variants +Source3: kmodtool-brp-kmodsign +Source4: macros.kmodtool +BuildArch: noarch + + +%description +This package contains tools and list of recent kernels that get used when +building kmod-packages. + + +%prep +# nothing to prep + + +%build +# nothing to build + + +%install +mkdir -p -m 0755 %{buildroot}%{_bindir} \ + %{buildroot}%{_datadir}/%{name} \ + %{buildroot}%{_rpmconfigdir} \ + %{buildroot}%{_rpmmacrodir} +install -p -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/kmodtool +install -p -m 0644 %{SOURCE2} %{buildroot}%{_datadir}/%{name}/kernel-variants +install -p -m 0755 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/brp-kmodsign +install -p -m 0644 %{SOURCE4} %{buildroot}%{_rpmmacrodir}/ + + +%files +%{_bindir}/* +%{_datadir}/%{name} +%{_rpmconfigdir}/brp-kmodsign +%{_rpmmacrodir}/macros.kmodtool + +%changelog +* Wed Jun 05 2024 Arkady L. Shane - 1.1-4 +- Rebuilt for MSVSphere 9.4 + +* Sun Apr 03 2022 Sérgio Basto - 1.1-4 +- kernel-abi-whitelists is not needed and break builds on el9 + +* Thu Jan 20 2022 Fedora Release Engineering - 1.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Mon Dec 20 2021 Nicolas Chauvet - 1.1-2 +- Revert suse commit in kmodtool + +* Fri Oct 22 2021 Nicolas Viéville - 1.1-1 +- Add signing module method to use with UEFI Secure Boot machines thanks + to Stanislas Leduc (#1454824) (reworked method) +- Add as well zipping module method and support for it in Fedora and RHEL + +* Fri Oct 22 2021 Nicolas Viéville - 1-44 +- Fix indentation +- Add installonlypkg(kernel-module) to allow kmod packages co-install (RHEL) +- Convert if statement from "[!] $variable" to "[!] -n $variable" +- Remove unused variables and code +- Force remove temporary file +- Remove grep pipe after find command +- Standardize globally kmod package names macros and kernel_uname_r + variables in order to ease the build of kmod packages for non-default + distribution (Fedora), for example for RHEL +- Try to fix: check if uname from Makefile is the same as kernel variable + +* Thu Jul 22 2021 Fedora Release Engineering - 1-43 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Jan 26 2021 Fedora Release Engineering - 1-42 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 1-41 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon Jul 06 2020 Neal Gompa - 1-40 +- Always use /lib/modules for kmod install path + +* Mon Jul 06 2020 Neal Gompa - 1-39 +- Don't force-disable debuginfo subpackages + +* Wed Jan 29 2020 Fedora Release Engineering - 1-38 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Sun Oct 13 2019 Sérgio Basto - 1-37 +- Fix package name in epel scriptlets + +* Thu Oct 10 2019 Leigh Scott - 1-36 +- Fix naming conflict with kmod meta package + +* Thu Jul 25 2019 Fedora Release Engineering - 1-35 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu May 16 2019 Nicolas Chauvet - 1-34 +- Add _kmodtool_depmod_post - rhbz#1703715 + +* Thu Feb 28 2019 Alexander Larsson - 1-33 +- Call akmods-ostree-post to support ostree/silverblue builds - rhbz#1667014 + +* Fri Feb 01 2019 Fedora Release Engineering - 1-32 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Wed Nov 07 2018 Nicolas Viéville - 1-31 +- Update copyrights +- Add BuildRequires for gcc to build kmod modules for fc29+ + +* Fri Jul 13 2018 Fedora Release Engineering - 1-30 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Mon Mar 26 2018 Nicolas Chauvet - 1-29 +- Update copyrights +- Drop Group field +- Patches from Nicolas Vieville - Enhancements for RHEL kernel: +- remove unneeded uname-r sub-package for RHEL +- enforce a range dependency for kernels +- register modules with /usr/sbin/weak-modules +- use depmod as seen in example file /usr/lib/rpm/redhat/kmodtool +- Add -e to depmod. + +* Wed Feb 07 2018 Fedora Release Engineering - 1-28 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Mon Oct 09 2017 Robert Scheck - 1-27 +- Revert my previous conditional fix for (/usr)/sbin/depmod + and apply the kmodtool patch by Nicolas Vieville (#1484293) + +* Tue Sep 19 2017 Robert Scheck - 1-26 +- Add conditional fix for (/usr)/sbin/depmod for RHEL/CentOS 6 + +* Wed Jul 26 2017 Fedora Release Engineering - 1-25 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Thu Feb 16 2017 Hans de Goede - 1-24 +- Modernize .spec a bit +- Submit to Fedora for package review + +* Sat Dec 07 2013 Nicolas Chauvet - 1-23 +- Add support for lpae kernel variant for ARM + +* Sat Feb 23 2013 Nicolas Chauvet - 1-22 +- Fix directory ownership rfbz#2684 + +* Mon Sep 03 2012 Nicolas Chauvet - 1-21 +- Add ARM varriant + +* Sat May 26 2012 Nicolas Chauvet - 1-20 +- Fix for depmod - rfbz#2340 + +* Wed Feb 01 2012 Nicolas Chauvet - 1-19 +- Update to 0.12.0 + +* Sun Mar 29 2009 Thorsten Leemhuis - 1-18 +- rebuild for new F11 features + +* Thu Feb 26 2009 Thorsten Leemhuis - 1-17 +- add support for obsoletes to kmodtool + +* Sun Feb 01 2009 Thorsten Leemhuis - 1-16 +- add posttrans hooks to akmod packages, to make akmods build them + after install or update + +* Sat Jan 31 2009 Thorsten Leemhuis - 1-15 +- require kmod-${kmodname}-${kernel_uname_r} with >= in meta package to + avoid problems if user has a newer akmods package that wants to install + a newer kmod-${kmodname}-${kernel_uname_r} + +* Sun Dec 14 2008 Thorsten Leemhuis - 1-14 +- don't require the kmod-meta package in kmod-(uname -r) packages + +* Tue Sep 30 2008 Thorsten Leemhuis - 1-13 +- rebuild for RPM Fusion + +* Sat Aug 02 2008 Thorsten Leemhuis - 1-12 +- fix #2056 (kmod provides in akmod package needs epoch) + +* Sat Jun 14 2008 Thorsten Leemhuis - 1-11 +- fix #2011 + +* Sun Apr 06 2008 Thorsten Leemhuis - 1-10 +- use better Requires and BuildRequires to avoid fileslist download + +* Sat Mar 29 2008 Thorsten Leemhuis - 1-9 +- adjust to recent "arch and flavor in uname" changes from j-rod + +* Sat Feb 23 2008 Thorsten Leemhuis - 1-8 +- add AkmodsBuildRequires stuff to akmods template, so those rare kmod + packages that need special BR can be added to the akmod package + +* Sat Jan 26 2008 Thorsten Leemhuis - 1-7 +- fix the akmods vs. akmod confusion and use akmod normally + +* Wed Jan 09 2008 Thorsten Leemhuis - 1-6 +- integrate akmodstool into kmodtool + +* Mon Dec 17 2007 Thorsten Leemhuis - 1-5 +- update kmodtool, so the kmod-foo- package does not require the + kmod-foo package when building for kernels that were passed with for-kernels + +* Tue Dec 04 2007 Thorsten Leemhuis - 1-4 +- update kmodtool, so the kmod-foo metapackage requires the proper version + of the kmod-foo- package + +* Tue Dec 04 2007 Thorsten Leemhuis - 1-3 +- update kmodtool, so the kmod-foo metapackage provides foo-kmod (which it only + indirectly does); that should fix #1742, as kmod-foo has a shorter name now + then kmod-foo- + +* Sat Dec 01 2007 Thorsten Leemhuis - 1-2 +- update kmodtool, so the kmod-foo- package tracks in kmod-foo + +* Sun Oct 28 2007 Thorsten Leemhuis - 1-1 +- split buildsys stuff out into a seperate package +- rename kmod-helpers-livna to kmodtool +- add proper obsoletes +- make package noarch + +* Sat Oct 27 2007 Thorsten Leemhuis - 16-2 +- Update to latest kernels 2.6.23.1-35.fc8 2.6.21-2950.fc8xen + +* Sat Oct 27 2007 Thorsten Leemhuis - 16-1 +- Update to latest kernels 2.6.23.1-35.fc8 2.6.21-2949.fc8xen + +* Thu Oct 18 2007 Thorsten Leemhuis - 15-1 +- rebuilt for latest kernels + +* Thu Oct 18 2007 Thorsten Leemhuis - 14-1 +- rebuilt for latest kernels + +* Thu Oct 18 2007 Thorsten Leemhuis - 13-1 +- rebuilt for latest kernels + +* Thu Oct 18 2007 Thorsten Leemhuis - 12-1 +- rebuilt for latest kernels + +* Fri Oct 12 2007 Thorsten Leemhuis - 11-1 +- rebuilt for latest kernels + +* Thu Oct 11 2007 Thorsten Leemhuis - 10-1 +- rebuilt for latest kernels + +* Wed Oct 10 2007 Thorsten Leemhuis - 9-2 +- fix typo + +* Wed Oct 10 2007 Thorsten Leemhuis - 9-1 +- rebuilt for latest kernels + +* Sun Oct 07 2007 Thorsten Leemhuis - 8-1 +- update for 2.6.23-0.224.rc9.git6.fc8 + +* Sun Oct 07 2007 Thorsten Leemhuis - 7-1 +- update for 2.6.23-0.222.rc9.git1.fc8 + +* Wed Oct 03 2007 Thorsten Leemhuis - 6-1 +- update for 2.6.23-0.217.rc9.git1.fc8 and 2.6.21-2947.fc8xen + +* Wed Oct 03 2007 Thorsten Leemhuis - 5-1 +- disable --all-but-latest stuff -- does not work as expected +- rename up2date list of kernels from "latest" to "current" as latest + and newest are to similar in wording; asjust script as well +- kmodtool: don't provide kernel-modules, not needed anymore with + the new stayle and hurts + +* Sun Sep 09 2007 Thorsten Leemhuis - 4-2 +- fix typos in spec file and list-kernels script +- interdependencies between the two buildsys-build packages needs to be + arch specific as well + +* Sun Sep 09 2007 Thorsten Leemhuis - 4-1 +- s/latests/latest/ +- update kernel lists for rawhide and test2 kernels +- make kmod-helpers-livna-list-kernels print BuildRequires for all kernels + as well; this is not needed and will slow build a bit as it will track + all the kernel-devel packages in, but that way we make sure they are really + available in the buildsys + +* Fri Sep 07 2007 Thorsten Leemhuis - 3-4 +- implement proper arch deps + +* Fri Sep 07 2007 Thorsten Leemhuis - 3-3 +- proper list of todays rawhide-kernels + +* Fri Sep 07 2007 Thorsten Leemhuis - 3-2 +- fix typo in kmod-helpers-livna-latests-kernels + +* Fri Sep 07 2007 Thorsten Leemhuis - 3-1 +- adjust for devel + +* Sat Sep 01 2007 Thorsten Leemhuis - 2-1 +- initial package