Browse Source

MEN-3361: Possible to choose multiple device types in config file

Changelog: Now it is possible to write multiple device types in the config file using a space seperated string. Filenames for files in the deploy dir will contain all the device names seperated with +.

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

5
configs/mender_convert_config

@ -227,9 +227,10 @@ source configs/mender_grub_config
# You might want to override this to e.g provide state-scripts or providing
# a private key to sign your artifact.
mender_create_artifact() {
local -r device_type="${1}"
local -r device_types="${1}"
local -r artifact_name="${2}"
local -r image_name="${3}"
local -r all_device_types="$(for device_type in $device_types; do echo " --device-type $device_type"; done)"
mender_artifact=deploy/${image_name}.mender
log_info "Writing Mender artifact to: ${mender_artifact}"
@ -240,5 +241,5 @@ mender_create_artifact() {
--file work/rootfs.img \
--output-path ${mender_artifact} \
--artifact-name ${artifact_name} \
--device-type ${device_type}"
${all_device_types}"
}

5
mender-convert-package

@ -151,7 +151,10 @@ temp_img_name=$(basename "$disk_image")
# Strip the image suffix from temp_img_name and set the original image name as
# the output image name
image_name="${temp_img_name%.*}-${device_type}-mender"
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"
actual_rootfs_size=$(sudo du -s --block-size=512 work/rootfs | cut -f 1)

Loading…
Cancel
Save