summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Mills <gmills@us.ibm.com>2017-10-23 13:08:38 -0500
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2017-11-06 18:08:10 +0000
commitf8210842dc0cb13ddd8cec27f7ce23aa7f24f320 (patch)
treed8dff066c1b3dd9476ec187594936a690d5697de
parent6a3e4e459ac61fa5ca915f6063be5ee01524422c (diff)
downloadopenpower-pnor-code-mgmt-f8210842dc0cb13ddd8cec27f7ce23aa7f24f320.tar.gz
openpower-pnor-code-mgmt-f8210842dc0cb13ddd8cec27f7ce23aa7f24f320.zip
Untar tarball and check for squashfs file
Untar the tarball and then check for existence of pnor.xz.squashfs file. A PNOR SquashFS Tarball must have a pnor.xz.squashfs file. A similar check is done is in the openpower item updater. Change-Id: Id6e63ee088941044ecc22282bd5abd6358d17d87 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
-rwxr-xr-xgenerate-ubi18
1 files changed, 18 insertions, 0 deletions
diff --git a/generate-ubi b/generate-ubi
index 3f839f115..6299073b0 100755
--- a/generate-ubi
+++ b/generate-ubi
@@ -50,3 +50,21 @@ else
fi
fi
+echo "Generating PNOR UBI image."
+
+squashfs_file_name="pnor.xz.squashfs"
+
+# Scratch directory for untarring and config file
+scratch_dir=`mktemp -d`
+
+# Untar tarball
+tar -xvf ${tarball} -C ${scratch_dir} ${squashfs_file_name}
+
+# All valid PNOR SquashFS Tarballs have a file named "pnor.xz.squashfs"
+if [ ! -f "${scratch_dir}/${squashfs_file_name}" ]; then
+ echo "No \"${squashfs_file_name}\" file in the tarball!"
+ rm -r "${scratch_dir}"
+ exit 1
+fi
+
+rm -r "${scratch_dir}"
OpenPOWER on IntegriCloud