From 289e16c8816c86dba4608fb13d2d522f3d1cddc1 Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Sun, 24 Feb 2019 23:00:17 +0800 Subject: [PATCH] mkdumprd: Improve the config reading logic Seems some dead codes are left here for historical reason, just remove them, read the config and strip comments only for once. This improve the speed by a lot (2.6s -> 0.498s for reading a simple config in my test case, on HDD) and make the code cleaner. Signed-off-by: Kairui Song Acked-by: Dave Young --- mkdumprd | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mkdumprd b/mkdumprd index 6fc68fe..a99d5f1 100644 --- a/mkdumprd +++ b/mkdumprd @@ -444,13 +444,9 @@ do add_dracut_arg $config_val ;; *) - if [ -n $(echo $config_opt | grep "^#.*$") ] - then - continue - fi ;; esac -done < $conf_file +done <<< "$(grep -v -e "^#" -e "^$" $conf_file)" handle_default_dump_target