weak-modules:disable an error when /lib/modules/uname -r/weak-modules does not exist

Signed-off-by: yangyanchao <yangyanchao6@huawei.com>
(cherry picked from commit 169dfdc0f9fc1272563e208c446ecfdbd3717498)
This commit is contained in:
yangyanchao 2021-08-13 14:52:58 +08:00 committed by openeuler-sync-bot
parent 23bbe3c243
commit 06729cc445
2 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,6 @@
Name: kmod
Version: 27
Release: 8
Release: 9
Summary: Kernel module management
# GPLv2+ is used by programs, LGPLv2+ is used for libraries.
License: GPLv2+ and LGPLv2+
@ -123,6 +123,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf
%doc TODO NEWS README
%changelog
* Fri Aug 13 2021 YangYanchao <yangyanchao6@huawei.com> - 27-9
- weak-modules: disable an error when /lib/modules/`uname -r`/weak-modules does not exist
* Wed Apr 7 2021 YangYanchao <yangyanchao6@huawei.com> - 27-8
- backport weak-modules script from fedora

View File

@ -1078,7 +1078,9 @@ remove_kernel() {
module_has_changed $weak_modules $remove_krel
# Remove everything beneath the weak-updates directory
( cd "$weak_modules" && doit rm -rf * )
if [ -d "weak_modules" ]; then
( cd "$weak_modules" && doit rm -rf * )
fi
}
################################################################################