diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build index 266426e..dba68da 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build @@ -119,8 +119,8 @@ find_dirs() { gcc_version_check() { # ensure gcc version matches that used to build the kernel - local gccver=$(gcc --version |head -n1 |cut -d' ' -f2-) - local kgccver=$(readelf -p .comment $VMLINUX |grep GCC: | tr -s ' ' | cut -d ' ' -f5-) + local gccver=$(gcc --version | head -n1 | cut -d' ' -f2- | sed 's/GNU/GCC/g') + local kgccver=$(readelf -p .comment $VMLINUX | grep GCC: | tr -s ' ' | cut -d ' ' -f5- | sed 's/GNU/GCC/g') if [[ "$gccver" != "$kgccver" ]]; then warn "gcc/kernel version mismatch" echo "gcc version: $gccver"