Unnamed repository
09ccf88405
Add a helper kdump_get_conf_val to replace get_option_value. It can help cover more corner cases in the code, like when there are multiple spaces in config file, config value separated by a tab, heading spaces, or trailing comments. And this uses "sed group command" and "sed hold buffer", make it much faster than previous `grep <config> | tail -1`. This helper is supposed to provide a universal way for kexec-tools scripts to read in config value. Currently, different scripts are reading the config in many different fragile ways. For example, following codes are found in kexec-tools script code base: 1. grep ^force_rebuild $KDUMP_CONFIG_FILE echo $_force_rebuild | cut -d' ' -f2 2. grep ^kdump_post $KDUMP_CONFIG_FILE | cut -d\ -f2 3. awk '/^sshkey/ {print $2}' $conf_file 4. grep ^path $KDUMP_CONFIG_FILE | cut -d' ' -f2- 1, 2, and 4 will fail if the space is replaced by, e.g. a tab 1 and 2 might fail if there are multiple spaces between config name and config value: "kdump_post /var/crash/scripts/kdump-post.sh" A space will be read instead of config value. 1, 2, 3 will fail if there are space in file path, like: "kdump_post /var/crash/scripts dir/kdump-post.sh" 4 will fail if there are trailing comments: "path /var/crash # some comment here" And all will fail if there are heading space, " path /var/crash" And all will most likely cause problems if the config file contains the same option more than once. And all of them are slower than the new sed call. Old get_option_value is also very slow and doesn't handle heading space. Although we never claim to support heading space or tailing comments before, it's harmless to be more robust on config reading, and many conf files in /etc support heading spaces. And have a faster and safer config reading helper makes it easier to clean up the code. Signed-off-by: Kairui Song <kasong@redhat.com> Acked-by: Philipp Rudo <prudo@redhat.com> |
||
---|---|---|
tests | ||
.editorconfig | ||
.gitignore | ||
60-kdump.install | ||
92-crashkernel.install | ||
98-kexec.rules | ||
98-kexec.rules.ppc64 | ||
crashkernel-howto.txt | ||
dracut-early-kdump-module-setup.sh | ||
dracut-early-kdump.sh | ||
dracut-fadump-init-fadump.sh | ||
dracut-fadump-module-setup.sh | ||
dracut-kdump-capture.service | ||
dracut-kdump-emergency.service | ||
dracut-kdump-emergency.target | ||
dracut-kdump-error-handler.sh | ||
dracut-kdump.sh | ||
dracut-module-setup.sh | ||
dracut-monitor_dd_progress | ||
early-kdump-howto.txt | ||
fadump-howto.txt | ||
kdump-dep-generator.sh | ||
kdump-in-cluster-environment.txt | ||
kdump-lib-initramfs.sh | ||
kdump-lib.sh | ||
kdump-logger.sh | ||
kdump-migrate-action.sh | ||
kdump-restart.sh | ||
kdump-udev-throttler | ||
kdump.conf | ||
kdump.conf.5 | ||
kdump.service | ||
kdump.sysconfig | ||
kdump.sysconfig.aarch64 | ||
kdump.sysconfig.i386 | ||
kdump.sysconfig.ppc64 | ||
kdump.sysconfig.ppc64le | ||
kdump.sysconfig.s390x | ||
kdump.sysconfig.x86_64 | ||
kdumpctl | ||
kdumpctl.8 | ||
kexec-kdump-howto.txt | ||
kexec-tools-2.0.22-makedumpfile-check-for-invalid-physical-address-proc-kcore-when-finding-max_paddr.patch | ||
kexec-tools-2.0.22-makedumpfile-check-for-invalid-physical-address-proc-kcore-when-making-ELF-dumpfile.patch | ||
kexec-tools-2.0.22-makedumpfile-Increase-SECTION_MAP_LAST_BIT-to-5.patch | ||
kexec-tools.spec | ||
live-image-kdump-howto.txt | ||
mkdumprd | ||
mkdumprd.8 | ||
mkfadumprd | ||
README | ||
sources | ||
zanata-notes.txt |
Adding a patch to kexec-tools ============================= There is a mailing list kexec@lists.fedoraproject.org where all the dicussion related to fedora kexec-tools happen. All the patches are posted there for inclusion and committed to kexec-tools after review. So if you want your patches to be included in fedora kexec-tools package, post these to kexec@lists.fedoraproject.org. One can subscribe to list and browse through archives here. https://admin.fedoraproject.org/mailman/listinfo/kexec