From 417b82ae763243b33726174fb75be236f4ce91cd Mon Sep 17 00:00:00 2001 From: Lluis Campos Date: Thu, 4 Mar 2021 13:33:19 +0100 Subject: [PATCH] MEN-4256: Remove /etc/mender/artifact_info from RPi pre-converted image Update tests accordingly. Changelog: raspberrypi_raspbian_config: Remove /etc/mender/artifact_info from image. For pre-converted images, the file is expected to be populated at setup time. Signed-off-by: Lluis Campos --- configs/images/raspberrypi_raspbian_config | 10 ++++++++++ mender-convert-package | 5 ++--- tests/mender-image-tests | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/configs/images/raspberrypi_raspbian_config b/configs/images/raspberrypi_raspbian_config index 8109283..b2af92f 100644 --- a/configs/images/raspberrypi_raspbian_config +++ b/configs/images/raspberrypi_raspbian_config @@ -46,3 +46,13 @@ EOF } PLATFORM_MODIFY_HOOKS+=(grow_data_partition) + +# +# Remove /etc/mender/artifact_info from image, expected to be populated at setup time +# +function remove_artifact_info() { + log_info "Removing /etc/mender/artifact_info" + run_and_log_cmd "rm work/rootfs/etc/mender/artifact_info" +} + +USER_LOCAL_MODIFY_HOOKS+=(remove_artifact_info) diff --git a/mender-convert-package b/mender-convert-package index 2aa4be1..666ec00 100755 --- a/mender-convert-package +++ b/mender-convert-package @@ -144,7 +144,6 @@ rootfs_part_sectors=$(((${disk_image_total_sectors} - ${data_part_sectors} - \ rootfs_part_sectors=$(disk_align_sectors ${rootfs_part_sectors} ${MENDER_PARTITION_ALIGNMENT}) device_type=$(cat work/rootfs/data/mender/device_type | sed 's/[^=]*=//') -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") @@ -212,7 +211,7 @@ disk_create_file_system_from_folder "work/rootfs/" "work/rootfs.img" \ log_info "Copying root filesystem image to deploy directory" run_and_log_cmd "cp --sparse=always work/rootfs.img deploy/${image_name}.${image_fs_type}" -mender_create_artifact "${device_type}" "${artifact_name}" "${image_name}" +mender_create_artifact "${device_type}" "${MENDER_ARTIFACT_NAME}" "${image_name}" log_info "Creating Mender compatible disk-image" @@ -372,7 +371,7 @@ testscfg_add "MENDER_PARTITIONING_OVERHEAD_KB" "$(((${overhead_sectors} * 512) / testscfg_add "MENDER_PARTITION_ALIGNMENT" "${MENDER_PARTITION_ALIGNMENT}" testscfg_add "MENDER_STORAGE_TOTAL_SIZE_MB" "${MENDER_STORAGE_TOTAL_SIZE_MB}" testscfg_add "MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET" "12582912" -testscfg_add "MENDER_ARTIFACT_NAME" "${artifact_name}" +testscfg_add "MENDER_ARTIFACT_NAME" "${MENDER_ARTIFACT_NAME}" testscfg_add "MENDER_FEATURES" "${mender_features}" testscfg_add "DEPLOY_DIR_IMAGE" "${PWD}/deploy" testscfg_add "MENDER_MACHINE" "${device_type}" diff --git a/tests/mender-image-tests b/tests/mender-image-tests index f6379d3..eab5e6d 160000 --- a/tests/mender-image-tests +++ b/tests/mender-image-tests @@ -1 +1 @@ -Subproject commit f6379d3c9010fc576cbd1004aa6dae68ca12810f +Subproject commit eab5e6d2c97b474fe76c0218a25644f8bb484c23