commit
0fdb1b20c7
@ -0,0 +1,34 @@
|
|||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
# block a macros.kmp to use own copy
|
||||||
|
# ugly hack but it will generate an %kernel_module_package macro
|
||||||
|
# and no way to add own
|
||||||
|
%__kmod_brps_added 1
|
||||||
|
%kernel_version %({ rpm -q --qf '%%{VERSION}-%%{RELEASE}.%%{ARCH}\\n' `rpm -qa | egrep "^kernel(-rt|-aarch64)?-devel" | /usr/lib/rpm/redhat/rpmsort -r | head -n 1`; echo '%%%%{nil}'; } | head -n 1)
|
||||||
|
|
||||||
|
%pki_dir %{_sysconfdir}/pki/kmod
|
||||||
|
|
||||||
|
%__brp_kmod_sign %{expand:\
|
||||||
|
%global sign_file /usr/src/kernels/%{kernel_version}/scripts/sign-file sha256 \
|
||||||
|
[ ! -d "$RPM_BUILD_ROOT/lib/modules/" ] || find "$RPM_BUILD_ROOT/lib/modules/" -type f -name '*.ko' -print -exec %{sign_file} "%{!?privkey:%{pki_dir}/msvsphere_kmod.priv}%{?privkey:"%{privkey}"}" "%{!?pubkey:%{pki_dir}/msvsphere_kmod.pem}%{?pubkey:"%{pubkey}"}" "{}" \\;
|
||||||
|
}
|
||||||
|
|
||||||
|
%__brp_kmod_post_sign_process %{expand:[ ! -d "$RPM_BUILD_ROOT/lib/modules/" ] || find "$RPM_BUILD_ROOT/lib/modules/" -type f -name '*.ko.*' -print -exec rm -f {} \\;}
|
||||||
|
|
||||||
|
#copy-paste from macros.kmp as no way to merge it
|
||||||
|
|
||||||
|
|
||||||
|
%__spec_install_post \
|
||||||
|
%{?__brp_kmod_set_exec_bit} \
|
||||||
|
%{?__debug_package:%{__debug_install_post}} \
|
||||||
|
%{__arch_install_post} \
|
||||||
|
%{__os_install_post} \
|
||||||
|
%{?__brp_kmod_restore_perms} \
|
||||||
|
%{__brp_kmod_sign} \
|
||||||
|
%{__brp_kmod_post_sign_process} \
|
||||||
|
%{nil}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
|||||||
|
%define pkidir %{_sysconfdir}/pki/kmod
|
||||||
|
|
||||||
|
Summary: Kernel module(s) signing tool
|
||||||
|
Name: msvsphere-modsign
|
||||||
|
Version: 1.0
|
||||||
|
Release: 1%{?dist}
|
||||||
|
|
||||||
|
License: GPLv2
|
||||||
|
URL: https://msvsphere.ru
|
||||||
|
Source1: macros.modsign
|
||||||
|
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
BuildRequires: openssl
|
||||||
|
BuildRequires: openssl-devel
|
||||||
|
|
||||||
|
%description
|
||||||
|
MSVSphere Lightweight Virtual Environment (LVE) kernel module.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
cp %{SOURCE1} macros.modsign
|
||||||
|
|
||||||
|
%build
|
||||||
|
#nothing to build
|
||||||
|
|
||||||
|
%install
|
||||||
|
install -d %{buildroot}%{_sysconfdir}/rpm
|
||||||
|
install -m 644 macros.modsign %{buildroot}%{_sysconfdir}/rpm
|
||||||
|
|
||||||
|
%files
|
||||||
|
%{_sysconfdir}/rpm/macros.modsign
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Wed Jun 28 2023 Arkady L. Shane <ashejn@msvsphere.ru> - 1.0-1
|
||||||
|
- initial build for MSVSphere 9 (Cloud Linux fork)
|
Loading…
Reference in new issue