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 <kasong@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
This commit is contained in:
Kairui Song 2019-02-24 23:00:17 +08:00
parent 24f9b31080
commit 289e16c881

View File

@ -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