File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -283,12 +283,6 @@ rm -f "$LOGFILE"
283283
284284trap cleanup EXIT INT TERM HUP
285285
286- KVER=${ARCHVERSION%% -* }
287- if [[ $ARCHVERSION =~ - ]]; then
288- KREL=${ARCHVERSION##* -}
289- KREL=${KREL% .* }
290- fi
291-
292286if [[ -n $USERSRCDIR ]]; then
293287 # save .config and vmlinux since they'll get removed with mrproper so
294288 # we can restore them later and be able to run kpatch-build multiple
@@ -300,6 +294,15 @@ if [[ -n $USERSRCDIR ]]; then
300294 [[ -z $VMLINUX ]] && VMLINUX=" $USERSRCDIR " /vmlinux
301295 [[ ! -e " $VMLINUX " ]] && die " can't find vmlinux"
302296 [[ " $VMLINUX " = " $USERSRCDIR " /vmlinux ]] && cp -f " $VMLINUX " $TEMPDIR /vmlinux && VMLINUX=$TEMPDIR /vmlinux
297+
298+ # Extract the target kernel version from vmlinux in this case.
299+ ARCHVERSION=$( strings " $VMLINUX " | grep -e " ^Linux version" | awk ' { print($3); }' )
300+ fi
301+
302+ KVER=${ARCHVERSION%% -* }
303+ if [[ $ARCHVERSION =~ - ]]; then
304+ KREL=${ARCHVERSION##* -}
305+ KREL=${KREL% .* }
303306fi
304307
305308[[ -z $TARGETS ]] && TARGETS=" vmlinux modules"
You can’t perform that action at this time.
0 commit comments