From 6b507fec2cb80645f3937f71c13a8b6f988959b9 Mon Sep 17 00:00:00 2001 From: yangyanchao Date: Fri, 13 Aug 2021 17:05:22 +0800 Subject: [PATCH 1/2] weak-modules:disable an error when /lib/modules/`uname -r`/weak-modules does not exist Signed-off-by: yangyanchao --- kmod.spec | 5 ++++- weak-modules | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/kmod.spec b/kmod.spec index db27a6d..d114ed0 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+ @@ -124,6 +124,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 YangYangchao - 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 From ae4c1ae92dec44be8b4b51b54dca7589da33b054 Mon Sep 17 00:00:00 2001 From: yangyanchao Date: Fri, 13 Aug 2021 17:11:15 +0800 Subject: [PATCH 2/2] weak-modules: fix a bug when using weak_modules without '$' Signed-off-by: yangyanchao --- kmod.spec | 7 +++++-- weak-modules | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/kmod.spec b/kmod.spec index d114ed0..b9e745d 100644 --- a/kmod.spec +++ b/kmod.spec @@ -1,6 +1,6 @@ Name: kmod Version: 27 -Release: 9 +Release: 10 Summary: Kernel module management # GPLv2+ is used by programs, LGPLv2+ is used for libraries. License: GPLv2+ and LGPLv2+ @@ -124,8 +124,11 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %doc TODO NEWS README %changelog +* Fri Aug 13 2021 YangYanchao - 27-10 +- weak-modules: fix a bug when using weak_modules without '$' + * Fri Aug 13 2021 YangYanchao - 27-9 -- weak-modules: disable an error when /lib/modules/`uname -r`/weak-modules does not exist +- weak-modules: fix a bug when /lib/modules/`uname -r`/weak-update does not exist * Wed Apr 7 2021 YangYangchao - 27-8 - backport weak-modules script from fedora diff --git a/weak-modules b/weak-modules index 7ba26bb..e67e7bb 100644 --- a/weak-modules +++ b/weak-modules @@ -1078,7 +1078,7 @@ remove_kernel() { module_has_changed $weak_modules $remove_krel # Remove everything beneath the weak-updates directory - if [ -d "weak_modules" ]; then + if [ -d "$weak_modules" ]; then ( cd "$weak_modules" && doit rm -rf * ) fi } -- Gitee