mirror of https://github.com/dynup/kpatch
kpatch-build: Stop reading vmlinux after the first match
When searching for 'Linux version ...' in vmlinux, stop after the first match so that we don't keep reading a potentially huge file. Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
This commit is contained in:
parent
7770c18f93
commit
b5f77d0608
|
@ -481,7 +481,7 @@ if [[ -n "$USERSRCDIR" ]]; then
|
|||
[[ ! -e "$VMLINUX" ]] && die "can't find vmlinux"
|
||||
|
||||
# Extract the target kernel version from vmlinux in this case.
|
||||
ARCHVERSION="$(strings "$VMLINUX" | grep -e "^Linux version" | awk '{ print($3); }')"
|
||||
ARCHVERSION="$(strings "$VMLINUX" | grep -m 1 -e "^Linux version" | awk '{ print($3); }')"
|
||||
fi
|
||||
|
||||
[[ -z "$ARCHVERSION" ]] && ARCHVERSION="$(uname -r)"
|
||||
|
|
Loading…
Reference in New Issue