bugfix: weak-modules cannot create soft link in cvm

This commit is contained in:
chenzheng 2024-09-09 14:38:55 +00:00 committed by 18523959662
parent 0839267489
commit f20b0906a2

View File

@ -5,7 +5,7 @@
Name : virtCCA_driver Name : virtCCA_driver
Summary : virtCCA driver is some drivers for TEE specific function. Summary : virtCCA driver is some drivers for TEE specific function.
Version : 0.1.3 Version : 0.1.3
Release : 5 Release : 6
ExclusiveArch: aarch64 ExclusiveArch: aarch64
License : GPLV2 License : GPLV2
Group : System/Kernel Group : System/Kernel
@ -44,32 +44,42 @@ rm -rf %{buildroot}
%post %post
if [[ "$1" = "1" || "$1" = "2" ]] ; then if [[ "$1" = "1" || "$1" = "2" ]] ; then
echo "installing %{kmod_1_name}.ko" echo "installing virtCCA driver"
if [ -e /sbin/weak-modules ] ; then install_dir="/lib/modules/%{kernel}/extra"
echo "/lib/modules/%{kernel}/extra/%{kmod_1_name}.ko" | /sbin/weak-modules --add-module --no-initramfs link_dir="/lib/modules/$(uname -r)/extra"
if [ "$install_dir" != "$link_dir" ] ; then
ln -sf "$install_dir/%{kmod_1_name}.ko" "$link_dir/%{kmod_1_name}.ko"
ln -sf "$install_dir/%{kmod_2_name}.ko" "$link_dir/%{kmod_2_name}.ko"
fi fi
echo "installed %{kmod_1_name}.ko" echo "installed virtCCA driver"
fi fi
%postun %postun
if [[ "$1" = "0" ]] ; then if [[ "$1" = "0" ]] ; then
echo "removing %{kmod_1_name}.ko" echo "removing virtCCA driver"
if [ -e /sbin/weak-modules ] ; then link_dir="/lib/modules/$(uname -r)/extra"
echo "/lib/modules/%{kernel}/extra/%{kmod_1_name}.ko" | /sbin/weak-modules --remove-module --no-initramfs install_dir="/lib/modules/%{kernel}/extra"
if [ "$install_dir" != "$link_dir" ] ; then
rm -rf "$link_dir/%{kmod_1_name}.ko"
rm -rf "$link_dir/%{kmod_2_name}.ko"
fi fi
echo "removed %{kmod_1_name}.ko" echo "removed virtCCA driver"
fi fi
%changelog %changelog
* Mon Sep 9 2024 chenzheng<chenzheng71@huawei.com> - 0.1.3-6
- Type:bugfix
- DESC:weak-modules cannot create soft link in cvm
* Mon Jul 15 2024 tujipei<tujipei@huawei.com> - 0.1.3-5 * Mon Jul 15 2024 tujipei<tujipei@huawei.com> - 0.1.3-5
- Type:bugfix - Type:bugfix
- DESC:Use weak-modules to decouple kernel modules from kernel versions - DESC:Use weak-modules to decouple kernel modules from kernel versions
* Mon June 3 2024 tujipei<tujipei@huawei.com> - 0.1.3-4 * Mon Jun 3 2024 tujipei<tujipei@huawei.com> - 0.1.3-4
- Type:bugfix - Type:bugfix
- DESC:Clean the scanned security problem for the sealing key code - DESC:Clean the scanned security problem for the sealing key code
* Mon June 3 2024 tujipei<tujipei@huawei.com> - 0.1.2-3 * Mon Jun 3 2024 tujipei<tujipei@huawei.com> - 0.1.2-3
- Type:bugfix - Type:bugfix
- DESC:Fit class_create for different kernel version - DESC:Fit class_create for different kernel version