commit 0fdb1b20c7da8303528a58e8392b3be17f9a7ba0 Author: tigro Date: Thu Jun 29 17:03:34 2023 +0300 initial build for MSVSphere 9.2 diff --git a/.msvsphere-modsign.metadata b/.msvsphere-modsign.metadata new file mode 100644 index 0000000..e69de29 diff --git a/SOURCES/macros.modsign b/SOURCES/macros.modsign new file mode 100644 index 0000000..88cab52 --- /dev/null +++ b/SOURCES/macros.modsign @@ -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} + + + diff --git a/SPECS/msvsphere-modsign.spec b/SPECS/msvsphere-modsign.spec new file mode 100644 index 0000000..eced91f --- /dev/null +++ b/SPECS/msvsphere-modsign.spec @@ -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 - 1.0-1 +- initial build for MSVSphere 9 (Cloud Linux fork)