On 07/04/17 at 01:45pm, Xunlei Pang wrote:
In case of on lvm related target, we can clearly and safely
remove many unnecessary modules to reduce initramfs size,
and to enhance stability.
Signed-off-by: Xunlei Pang <xlpang(a)redhat.com>
---
mkdumprd | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd
index 0bd724c..ad44325 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -382,21 +382,34 @@ check_crypt()
return 1
}
+is_lvm()
+{
+ if [ -d "/sys/dev/block/$1/dm" ]; then
+ return 0
+ fi
+
+ return 1
+}
+
omit_dracut_modules()
{
local target majmin
- local has_crypt
+ local has_crypt has_lvm
# Skip fadump case
is_fadump_capable && return
has_crypt=0
+ has_lvm=0
for target in $(get_kdump_targets); do
if [ -b "$target" ]; then
# Check "crypt"
majmin=$(get_maj_min $target)
check_block_and_slaves is_crypt $majmin && has_crypt=1
+
+ # Check "lvm"
+ check_block_and_slaves is_lvm $majmin && has_lvm=1
fi
done
@@ -404,6 +417,12 @@ omit_dracut_modules()
if [ "$has_crypt" == "0" ]; then
add_dracut_arg "--omit" "crypt"
fi
+
+ # Further omit more modules in case of no lvm related target
+ if [ "$has_lvm" == "0" ]; then
Since it is not only lvm, how about change the name to has_dm and is_dm?
+ # "has_lvm=0" implies "has_crypt=0"
+ add_dracut_arg "--omit" "lvm dm multipath dmraid"
+ fi
}
if ! check_resettable; then
--
1.8.3.1
_______________________________________________
kexec mailing list -- kexec(a)lists.fedoraproject.org
To unsubscribe send an email to kexec-leave(a)lists.fedoraproject.org
Thanks
Dave