From c94880aa2f8152e9ad86c37f22b2cb4b6eebae3a Mon Sep 17 00:00:00 2001 From: Gregory Haynes Date: Mon, 15 Dec 2014 15:40:48 -0800 Subject: [PATCH] Fail helpfully if uuidgen is missing If uuidgen is not installed we currently fail when performing tune2fs. Change-Id: I4062eb1d62322c455dac5b83b856f454da211320 --- bin/disk-image-create | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/disk-image-create b/bin/disk-image-create index 933a0a66..5e82d9bc 100755 --- a/bin/disk-image-create +++ b/bin/disk-image-create @@ -158,6 +158,11 @@ fi # NOTE: Tuning the rootfs uuid works only for ext filesystems. # Rely on the below environment variable only for ext filesystems. export DIB_IMAGE_ROOT_FS_UUID=$(uuidgen -r) +if echo "$FS_TYPE" | grep -q "^ext" && [ -z "${DIB_IMAGE_ROOT_FS_UUID}" ]; then + echo "ext filesystem detected but no DIB_IMAGE_ROOT_FS_UUID found." + echo "Is the uuidgen utility installed on your system?" + exit 1 +fi # FS_TYPE isn't available until after we source img-defaults if [ -z "$DIB_ROOT_LABEL" ]; then