Fix check for ISO file in deployment script.

The checking for ISO files was made through the mime type. However
this method can fail as the mime type can be set differently by the
browser or tool used to download the file. An example of this
behavior can be found on Fedora 28 where the file command returns
application/octect-stream.

The fix is to avoid using the mime type for checking and just verify
that if a DOS/MBR file.

Closes-Bug: 1804610
Change-Id: I69f09df66215d405720801fbcbe3d43aac668564
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
This commit is contained in:
Erich Cordoba 2018-12-03 11:29:28 -06:00
parent ded5fc1218
commit 3645b8517f
1 changed files with 2 additions and 3 deletions

View File

@ -10,9 +10,8 @@ usage() {
iso_image_check() {
local ISOIMAGE=$1
FILETYPE=$(file --mime-type -b ${ISOIMAGE})
if ([ "$FILETYPE" != "application/x-iso9660-image" ]); then
echo "$ISOIMAGE is not an application/x-iso9660-image type"
if ! file ${ISOIMAGE} | grep "DOS/MBR" > /dev/null; then
echo "$ISOIMAGE is not an ISO type"
exit -1
fi
}