Browse Source
Merge pull request #285 from NilsOlavKJohansen/master
Possible to have custom filenames for deployed files.
2.3.x
NilsOlavKJohansen
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
15 additions and
3 deletions
-
configs/mender_convert_config
-
mender-convert-package
|
|
@ -78,6 +78,12 @@ MENDER_DATA_PART_GROWFS=y |
|
|
|
# input disk image |
|
|
|
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. |
|
|
|
# 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. |
|
|
|
|
|
@ -149,12 +149,18 @@ artifact_name=$(cat work/rootfs/etc/mender/artifact_info | sed 's/[^=]*=//') |
|
|
|
# Get the name from the input 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 |
|
|
|
# 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. |
|
|
|
image_name="${image_name}-$(sed 's| |+|g' <<< $device_type)-mender" |
|
|
|
# Add device types to the filename and replaces whitespace with + to seperate device types. |
|
|
|
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) |
|
|
|
|
|
|
|