Commit 90db2151 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Fix the error messages in helper

parent 9a4838f0
......@@ -149,7 +149,7 @@ get_partition_table() {
# secondary gpt is not it the end of the disk, and a warning that has to
# do with the "Last Usable LBA" entry in gpt.
if ! output="$("$PARTED" -s -m "$dev" unit s print | grep -E -v "^(Warning|Error): ")"; then
log_error "Unable to read partition table for device \`${dev}'"
log_error "Unable to read partition table for device \`${dev}'. The image seems corrupted."
fi
echo "$output"
......
......@@ -90,6 +90,14 @@ trap '{ umount "$target"; }' ERR
if [ -z "$SNF_IMAGE_PROPERTY_EXCLUDE_ALL_TASKS" ]; then
if [ "$SNF_IMAGE_PROPERTY_OSFAMILY" = "" ]; then
log_error "Required image property \`OSFAMILY' is missing or empty."
fi
if [ "$SNF_IMAGE_PROPERTY_ROOT_PARTITION" = "" ]; then
log_error "Required image property \`ROOT_PARTITION' is missing or empty."
fi
export SNF_IMAGE_RESIZE_PART="$(get_partition_to_resize "$SNF_IMAGE_DEV")"
if [[ ! "$SNF_IMAGE_PROPERTY_OSFAMILY" =~ ^(linux|windows)$ ]]; then
......
......@@ -34,13 +34,15 @@ if [ ! -d "$SNF_IMAGE_TARGET" ]; then
fi
if [ -z "$SNF_IMAGE_PROPERTY_ROOT_PARTITION" ]; then
log_error "Root Partition image property not defined"
log_error "Required image property \`ROOT_PARTITION' not defined or empty"
fi
rootdev="${SNF_IMAGE_DEV}${SNF_IMAGE_PROPERTY_ROOT_PARTITION}"
if [ ! -b "$rootdev" ]; then
log_error "Image root partition device:\`$rootdev' is not a block device"
log_error "Root partition device:\`$rootdev' is not a block device. " \
"Please check if the value for image property \`ROOT_PARTITION' " \
"(=$SNF_IMAGE_PROPERTY_ROOT_PARTITION) is valid."
fi
mount "$rootdev" "$SNF_IMAGE_TARGET" -o rw
......
......@@ -40,6 +40,9 @@ windows_password() {
echo "@echo off" > "$target/Windows/SnfScripts/ChangeAdminPassword.cmd"
if [ -z "$SNF_IMAGE_PROPERTY_USERS" ]; then
warn "Image property \`USERS' is missing or empty. " \
"Changing the password for default user: \`Administrator'."
SNF_IMAGE_PROPERTY_USERS="Administrator"
fi
......@@ -67,6 +70,8 @@ linux_password() {
users+=("$usr")
done
else
warn "Image property \`USERS' is missing or empty. " \
"Changing the password for default user: \'root'."
users+=("root")
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment