Browse Source

Merge pull request #155 from oleorhagen/MEN-3051

MEN-3051: Update the naming convention for the output files
2.0.x
oleorhagen 5 years ago
committed by GitHub
parent
commit
52291b07f6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .gitlab-ci.yml
  2. 2
      configs/rockpro64_config
  3. 38
      mender-convert-package
  4. 2
      modules/probe.sh
  5. 12
      scripts/test/test-utils.sh

4
.gitlab-ci.yml

@ -76,7 +76,7 @@ test_acceptance_prebuilt_raspberrypi:
- aws s3 cp s3://mender-gitlab-tmp-storage/$CI_PROJECT_NAME/$CI_PIPELINE_ID/deploy.tar.gz deploy.tar.gz
- tar xzf deploy.tar.gz
# Extract converted Raspbian artifacts
- unxz deploy/raspberrypi-${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}.sdimg.xz
- unxz deploy/raspberrypi-${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}-mender.img.xz
- ./scripts/test/run-tests.sh --no-pull --prebuilt-image raspberrypi ${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}
test_acceptance_qemux86_64:
@ -148,7 +148,7 @@ publish:s3:
# Prepare high privilege S3 keys (the base keys are for the tmp storage only)
- export AWS_ACCESS_KEY_ID=$PUBLISH_AWS_ACCESS_KEY_ID
- export AWS_SECRET_ACCESS_KEY=$PUBLISH_AWS_SECRET_ACCESS_KEY
- aws s3 cp deploy/raspberrypi-${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}.sdimg.xz
- aws s3 cp deploy/raspberrypi-${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}-mender.img.xz
s3://$S3_BUCKET_NAME/${RASPBIAN_NAME}/arm/${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}.img.xz
- aws s3api put-object-acl --acl public-read --bucket $S3_BUCKET_NAME
--key ${RASPBIAN_NAME}/arm/${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}.img.xz

2
configs/rockpro64_config

@ -27,6 +27,6 @@ function platform_modify() {
function platform_package() {
log_info "Embedding bootloader in disk image"
run_and_log_cmd "dd if=work/rockpro64/rksd_loader.img of=${sdimg_path} \
run_and_log_cmd "dd if=work/rockpro64/rksd_loader.img of=${img_path} \
seek=64 conv=notrunc status=none"
}

38
mender-convert-package

@ -194,7 +194,7 @@ mender_create_artifact "${device_type}" "${artifact_name}"
log_info "Creating Mender compatible disk-image"
sdimg_path=deploy/${image_name}.sdimg
img_path=deploy/${image_name}-mender.img
log_info "Total disk size: $(disk_sectors_to_mb ${disk_image_total_sectors}) MiB"
log_info " Boot partition $(disk_sectors_to_mb ${boot_part_sectors}) MiB"
@ -203,7 +203,7 @@ log_info " Data partition $(disk_sectors_to_mb ${data_part_sectors}) MiB"
# Initialize sdcard image file
run_and_log_cmd \
"dd if=/dev/zero of=${sdimg_path} bs=512 count=0 seek=${disk_image_total_sectors} status=none"
"dd if=/dev/zero of=${img_path} bs=512 count=0 seek=${disk_image_total_sectors} status=none"
# boot_part_start, is defined at the beginning of this file
boot_part_end=$(( ${boot_part_start} + ${boot_part_sectors} - 1 ))
@ -218,25 +218,25 @@ data_start=$(disk_align_sectors ${rootfsb_end} ${MENDER_PARTITION_ALIGNMENT} )
data_end=$(( ${data_start} + ${data_part_sectors} - 1 ))
# Create partition table. TODO: GPT support
run_and_log_cmd "${PARTED} -s ${sdimg_path} mklabel msdos"
run_and_log_cmd "${PARTED} -s ${sdimg_path} unit s mkpart primary fat32 ${boot_part_start} ${boot_part_end}"
run_and_log_cmd "${PARTED} -s ${sdimg_path} set 1 boot on"
run_and_log_cmd "${PARTED} -s ${sdimg_path} -- unit s mkpart primary ext2 ${rootfsa_start} ${rootfsa_end}"
run_and_log_cmd "${PARTED} -s ${sdimg_path} -- unit s mkpart primary ext2 ${rootfsb_start} ${rootfsb_end}"
run_and_log_cmd "${PARTED} -s ${sdimg_path} -- unit s mkpart primary ext2 ${data_start} ${data_end}"
run_and_log_cmd "${PARTED} -s ${sdimg_path} print"
run_and_log_cmd "${PARTED} -s ${img_path} mklabel msdos"
run_and_log_cmd "${PARTED} -s ${img_path} unit s mkpart primary fat32 ${boot_part_start} ${boot_part_end}"
run_and_log_cmd "${PARTED} -s ${img_path} set 1 boot on"
run_and_log_cmd "${PARTED} -s ${img_path} -- unit s mkpart primary ext2 ${rootfsa_start} ${rootfsa_end}"
run_and_log_cmd "${PARTED} -s ${img_path} -- unit s mkpart primary ext2 ${rootfsb_start} ${rootfsb_end}"
run_and_log_cmd "${PARTED} -s ${img_path} -- unit s mkpart primary ext2 ${data_start} ${data_end}"
run_and_log_cmd "${PARTED} -s ${img_path} print"
# Write boot-gap
if [ "${MENDER_COPY_BOOT_GAP}" == "y" ]; then
log_info "Writing boot gap of size: ${boot_part_sectors} (sectors)"
disk_write_at_offset "${output_dir}/boot-gap.bin" "${sdimg_path}" "1"
disk_write_at_offset "${output_dir}/boot-gap.bin" "${img_path}" "1"
fi
# Burn Partitions
disk_write_at_offset "${boot_part}" "${sdimg_path}" "${boot_part_start}"
disk_write_at_offset "${output_dir}/rootfs.img" "${sdimg_path}" "${rootfsa_start}"
disk_write_at_offset "${output_dir}/rootfs.img" "${sdimg_path}" "${rootfsb_start}"
disk_write_at_offset "${output_dir}/data.img" "${sdimg_path}" "${data_start}"
disk_write_at_offset "${boot_part}" "${img_path}" "${boot_part_start}"
disk_write_at_offset "${output_dir}/rootfs.img" "${img_path}" "${rootfsa_start}"
disk_write_at_offset "${output_dir}/rootfs.img" "${img_path}" "${rootfsb_start}"
disk_write_at_offset "${output_dir}/data.img" "${img_path}" "${data_start}"
log_info "Performing platform specific package operations (if any)"
platform_package
@ -248,17 +248,17 @@ if [ "${MENDER_USE_BMAP}" == "y" ]; then
log_error "You have enabled the MENDER_USE_BMAP option, but we could not find the required 'bmaptool'"
log_fatal "You can install 'bmaptool' with: apt-get install bmap-tools (on Debian based distributions)"
fi
run_and_log_cmd "${BMAP_TOOL} create ${sdimg_path} > ${sdimg_path}.bmap"
run_and_log_cmd "${BMAP_TOOL} create ${img_path} > ${img_path}.bmap"
fi
case "${MENDER_COMPRESS_DISK_IMAGE}" in
gzip)
log_info "Compressing ${sdimg_path}.gz"
run_and_log_cmd "pigz --best --force ${sdimg_path}"
log_info "Compressing ${img_path}.gz"
run_and_log_cmd "pigz --best --force ${img_path}"
;;
lzma)
log_info "Compressing ${sdimg_path}.xz"
run_and_log_cmd "pxz --best --force ${sdimg_path}"
log_info "Compressing ${img_path}.xz"
run_and_log_cmd "pxz --best --force ${img_path}"
;;
none)
:

2
modules/probe.sh

@ -30,7 +30,7 @@ probe_arch() {
done
if [ -z "${file_info}" ]; then
log_fatal "Sorry, where not able to determinate target architecture"
log_fatal "Sorry, not able to determinate target architecture"
fi
target_arch="unknown"

12
scripts/test/test-utils.sh

@ -59,7 +59,7 @@ convert_and_test() {
local ret=0
run_tests "${device_type}" "${artifact_name}" || ret=$?
rm -f deploy/${device_type}-${artifact_name}.*
rm -f deploy/${device_type}-${artifact_name}*
return $ret
}
@ -76,12 +76,18 @@ run_tests() {
# Need to decompress images built with MENDER_COMPRESS_DISK_IMAGE=gzip before
# running tests.
if [ -f deploy/${device_type}-${artifact_name}.sdimg.gz ]; then
if [ -f deploy/${device_type}-${artifact_name}-mender.img.gz ]; then
# sudo is needed because the image is created using docker-mender-convert
# which sets root permissions on the image
sudo gunzip --force deploy/${device_type}-${artifact_name}.sdimg.gz
sudo gunzip --force deploy/${device_type}-${artifact_name}-mender.img.gz
fi
# MEN-3051: Rename the files back to .sdimg, as the sdimg extension has meaning
# in the test-infrastructure.
for file in ${MENDER_CONVERT_DIR}/deploy/*.img; do
mv $file "${file%-mender.img}.sdimg"
done
cd ${WORKSPACE}/mender-image-tests
python3 -m pytest --verbose \

Loading…
Cancel
Save