From 06729cc445fb6b6aaa542f2dbfdc7c0973bd63f8 Mon Sep 17 00:00:00 2001 From: yangyanchao Date: Fri, 13 Aug 2021 14:52:58 +0800 Subject: [PATCH] weak-modules:disable an error when /lib/modules/`uname -r`/weak-modules does not exist Signed-off-by: yangyanchao (cherry picked from commit 169dfdc0f9fc1272563e208c446ecfdbd3717498) --- kmod.spec | 5 ++++- weak-modules | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/kmod.spec b/kmod.spec index 92d847d..8d9cdda 100644 --- a/kmod.spec +++ b/kmod.spec @@ -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 - 27-9 +- weak-modules: disable an error when /lib/modules/`uname -r`/weak-modules does not exist + * Wed Apr 7 2021 YangYanchao - 27-8 - backport weak-modules script from fedora diff --git a/weak-modules b/weak-modules index 65806d0..7ba26bb 100644 --- a/weak-modules +++ b/weak-modules @@ -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 } ################################################################################ -- Gitee