scripts/runqemu: Fix MACHINE regex
When runqemu tries to determine the MACHINE variable from a kernel or vmdk filename that doesn't contain any known machine name, the variable gets set to the filename. It should remain unset and cause an error. [YOCTO #2890] (From OE-Core rev: 22c0668d9e0a22c095d78bab7b45ef4f803dd0d1) Signed-off-by: Mihai Prica <mihai.prica@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
7d8038dfc6
commit
12d003a800
|
@ -224,13 +224,13 @@ fi
|
||||||
|
|
||||||
if [ -z "$MACHINE" ]; then
|
if [ -z "$MACHINE" ]; then
|
||||||
if [ "x$FSTYPE" = "xvmdk" ]; then
|
if [ "x$FSTYPE" = "xvmdk" ]; then
|
||||||
MACHINE=`basename $VM | sed 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
|
MACHINE=`basename $VM | sed -n 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/p'`
|
||||||
if [ -z "$MACHINE" ]; then
|
if [ -z "$MACHINE" ]; then
|
||||||
error "Unable to set MACHINE from vmdk filename [$VM]"
|
error "Unable to set MACHINE from vmdk filename [$VM]"
|
||||||
fi
|
fi
|
||||||
echo "Set MACHINE to [$MACHINE] based on vmdk [$VM]"
|
echo "Set MACHINE to [$MACHINE] based on vmdk [$VM]"
|
||||||
else
|
else
|
||||||
MACHINE=`basename $KERNEL | sed 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
|
MACHINE=`basename $KERNEL | sed -n 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/p'`
|
||||||
if [ -z "$MACHINE" ]; then
|
if [ -z "$MACHINE" ]; then
|
||||||
error "Unable to set MACHINE from kernel filename [$KERNEL]"
|
error "Unable to set MACHINE from kernel filename [$KERNEL]"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue