diff --git a/.gitignore b/.gitignore index ef43e34..9d66b62 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ rootfs_overlay_demo/* mender_local_config *.xml *.html +convert.log diff --git a/mender-convert b/mender-convert index b434cee..9eccc56 100755 --- a/mender-convert +++ b/mender-convert @@ -18,6 +18,9 @@ source modules/bootstrap.sh source modules/cliparser.sh source modules/decompressinput.sh +mkdir -p work +touch work/convert.log + ############################################################################### # Declaration of important variables for this file # ############################################################################### @@ -26,11 +29,11 @@ declare compression_type="" # Detected input file compression, also applied to declare ocfile="./work/override_compression_config" declare disk_image="" # Needed in parse_cli_options, and is passed to decompress_image() declare -a overlays=() # [Dummy] Needed in parse_cli_options, not here -declare -a configs=() # [Dummy] Needed in parse_cli_options, not here +declare -a configs=() # [Dummy] Needed in parse_cli_options, not here +MENDER_ARTIFACT_NAME="${MENDER_ARTIFACT_NAME:-}" # Required env variable +MENDER_CONVERT_VERSION="${MENDER_CONVERT_VERSION:-}" # Required env variable ############################################################################### -MENDER_CONVERT_VERSION=$(git describe --tags --dirty --exact-match 2>/dev/null || git rev-parse --short HEAD) - function show_help() { cat << EOF mender-convert @@ -113,8 +116,6 @@ if [ -z "${MENDER_ARTIFACT_NAME}" ]; then echo -e "\tMENDER_ARTIFACT_NAME=\"release-1\" ./mender-convert" exit 1 fi -mkdir -p work -touch work/convert.log parse_cli_options "$@" diff --git a/modules/decompressinput.sh b/modules/decompressinput.sh index 9cb155e..b11ba2f 100644 --- a/modules/decompressinput.sh +++ b/modules/decompressinput.sh @@ -81,7 +81,7 @@ function decompress_image () { xzcat "${input_image}" > "${disk_image}" ;; * ) - log_fatal "Unsupported input image type: ${input_image}" + log_fatal "Unsupported input image format: ${input_image}. We support: '.img', '.gz', '.zip', '.xz'." ;; esac echo "${disk_image}"