From a2fbce15872167cfeb2bee4dcf66c33e29e4dfe2 Mon Sep 17 00:00:00 2001 From: Joe Lawrence Date: Wed, 15 Nov 2017 10:44:42 -0500 Subject: [PATCH] kpatch: don't complain about missing livepatch .kpatch.checksum The verify_module_checksum() function reads a kpatch-specific ELF section to compare on-disk and in-memory kernel modules. The function only reports a miscompare if the .kpatch.checksum section actually exists. Livepatches don't have such section, so throw away any "Section '.kpatch.checksum' was not dumped because it does not exist!" warnings from readelf. Signed-off-by: Joe Lawrence --- kpatch/kpatch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kpatch/kpatch b/kpatch/kpatch index 01bd9b2..21fec87 100755 --- a/kpatch/kpatch +++ b/kpatch/kpatch @@ -145,7 +145,7 @@ verify_module_checksum () { modname="$(get_module_name "$1")" [[ -z "$modname" ]] && return 1 - checksum="$(readelf -p .kpatch.checksum "$1" | grep '\[.*\]' | awk '{print $3}')" + checksum="$(readelf -p .kpatch.checksum "$1" 2>&1 | grep '\[.*\]' | awk '{print $3}')" # Fail checksum match only if both exist and diverge if [[ ! -z "$checksum" ]] && [[ -e "$SYSFS/${modname}/checksum" ]] ; then