scripts/runqemu: Factor image location code into a shell function
This commit is contained in:
parent
0e22433130
commit
e121f9eb59
|
@ -72,17 +72,32 @@ if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o
|
||||||
CROSSPATH=$BUILDDIR/tmp/cross/arm-poky-linux-gnueabi/bin
|
CROSSPATH=$BUILDDIR/tmp/cross/arm-poky-linux-gnueabi/bin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
function findimage {
|
||||||
|
where=$1
|
||||||
|
machine=$2
|
||||||
|
extension=$3
|
||||||
|
names=$4
|
||||||
|
for name in $names;
|
||||||
|
do
|
||||||
|
fullname=$where/$name-$machine.$extension
|
||||||
|
if [ -e "$fullname" ]; then
|
||||||
|
HDIMAGE=$fullname
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "Couldn't find image in $where. Attempted image names were:"
|
||||||
|
for name in $names;
|
||||||
|
do
|
||||||
|
echo $name-$machine.$extension
|
||||||
|
done
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
if [ "$MACHINE" = "qemuarm" ]; then
|
if [ "$MACHINE" = "qemuarm" ]; then
|
||||||
if [ "$TYPE" = "ext3" ]; then
|
if [ "$TYPE" = "ext3" ]; then
|
||||||
if [ "x$HDIMAGE" = "x" ]; then
|
if [ "x$HDIMAGE" = "x" ]; then
|
||||||
T=$BUILDDIR/tmp/deploy/images/poky-image
|
T=$BUILDDIR/tmp/deploy/images
|
||||||
if [ -e "$T-sdk-qemuarm.ext3" ]; then
|
findimage $T qemuarm ext3 "poky-image-sdk poky-image-sato poky-image-minimal"
|
||||||
HDIMAGE="$T-sdk-qemuarm.ext3"
|
|
||||||
elif [ -e "$T-sato-qemuarm.ext3" ]; then
|
|
||||||
HDIMAGE="$T-sato-qemuarm.ext3"
|
|
||||||
elif [ -e "$T-minimal-qemuarm.ext3" ]; then
|
|
||||||
HDIMAGE="$T-minimal-qemuarm.ext3"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -118,14 +133,8 @@ if [ "$MACHINE" = "qemux86" ]; then
|
||||||
fi
|
fi
|
||||||
if [ "$TYPE" = "ext3" ]; then
|
if [ "$TYPE" = "ext3" ]; then
|
||||||
if [ "x$HDIMAGE" = "x" ]; then
|
if [ "x$HDIMAGE" = "x" ]; then
|
||||||
T=$BUILDDIR/tmp/deploy/images/poky-image
|
T=$BUILDDIR/tmp/deploy/images
|
||||||
if [ -e "$T-sdk-qemux86.ext3" ]; then
|
findimage $T qemux86 ext3 "poky-image-sdk poky-image-sato poky-image-minimal moblin-image-netbook"
|
||||||
HDIMAGE=$T-sdk-qemux86.ext3
|
|
||||||
elif [ -e "$T-sato-qemux86.ext3" ]; then
|
|
||||||
HDIMAGE=$T-sato-qemux86.ext3
|
|
||||||
elif [ -e "$T-minimal-qemux86.ext3" ]; then
|
|
||||||
HDIMAGE=$T-minimal-qemux86.ext3
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
CROSSPATH=$BUILDDIR/tmp/cross/i586-poky-linux/bin
|
CROSSPATH=$BUILDDIR/tmp/cross/i586-poky-linux/bin
|
||||||
|
|
Loading…
Reference in New Issue