Browse Source

Possible to have custom filenames for deployed files.

Changelog: Now it is possible to to select a custom filename for the deployed files by using a DEPLOY_IMAGE_NAME string in the config file.

Signed-off-by: nils olav <nils.olav@northern.tech>
2.3.x
nils olav 4 years ago
parent
commit
d1d15d5068
No known key found for this signature in database GPG Key ID: B6106D29DE03549D
  1. 6
      configs/mender_convert_config
  2. 12
      mender-convert-package

6
configs/mender_convert_config

@ -78,6 +78,12 @@ MENDER_DATA_PART_GROWFS=y
# input disk image # input disk image
MENDER_DEVICE_TYPE="" MENDER_DEVICE_TYPE=""
# A string that defines the filenames of the deployed files.This is optional.
# If no DEPLOY_IMAGE_NAME is defined the filenames will be a combination off
# the date and the names of all DEVICE_TYPES.
# These will be seperated with a +.
DEPLOY_IMAGE_NAME=""
# The partition scheme to use for the converted image. # The partition scheme to use for the converted image.
# To override set this to "gpt" or "dos" (the scheme names used by fdisk and partx). # To override set this to "gpt" or "dos" (the scheme names used by fdisk and partx).
# By default mender-convert will use the partition scheme from the input image. # By default mender-convert will use the partition scheme from the input image.

12
mender-convert-package

@ -149,12 +149,18 @@ artifact_name=$(cat work/rootfs/etc/mender/artifact_info | sed 's/[^=]*=//')
# Get the name from the input disk_image # Get the name from the input disk_image
temp_img_name=$(basename "$disk_image") temp_img_name=$(basename "$disk_image")
# Check if user has chooses custom filename
if [ -z "${DEPLOY_IMAGE_NAME}" ]; then
# Strip the image suffix from temp_img_name and set the original image name as # Strip the image suffix from temp_img_name and set the original image name as
# the output image name # the output image name
image_name="${temp_img_name%.*}" image_name="${temp_img_name%.*}"
#Adds device types to the filename and replaces whitespace with + to seperate device types. # Add device types to the filename and replaces whitespace with + to seperate device types.
image_name="${image_name}-$(sed 's| |+|g' <<< $device_type)-mender" image_name="${image_name}-$(sed 's| |+|g' <<< $device_type)-mender"
else
# User has choosen custom filename in config file
image_name=$DEPLOY_IMAGE_NAME
fi
actual_rootfs_size=$(sudo du -s --block-size=512 work/rootfs | cut -f 1) actual_rootfs_size=$(sudo du -s --block-size=512 work/rootfs | cut -f 1)

Loading…
Cancel
Save