|
|
@ -19,8 +19,6 @@ General commands: |
|
|
|
necessary files installed |
|
|
|
mender-disk-image-to-artifact - creates Mender artifact file |
|
|
|
from Mender image |
|
|
|
raw-disk-image-shrink-rootfs - shrinks existing embedded raw |
|
|
|
disk image |
|
|
|
|
|
|
|
Options: [-r|--raw-disk-image | -m|--mender-disk-image | -s|--data-part-size-mb | |
|
|
|
-d|--device-type | -p|--rootfs-partition-id | -n|--demo | -i|--demo-host-ip | |
|
|
@ -85,13 +83,6 @@ Examples: |
|
|
|
|
|
|
|
Note: artifact name format is: release-<release_no>_<mender_version> |
|
|
|
|
|
|
|
To shrink the existing embedded raw disk image: |
|
|
|
|
|
|
|
./mender-convert raw-disk-image-shrink-rootfs |
|
|
|
--raw-disk-image <raw_disk_image_path> |
|
|
|
|
|
|
|
Output: Root filesystem size (sectors): 4521984 |
|
|
|
|
|
|
|
EOF |
|
|
|
} |
|
|
|
|
|
|
@ -159,8 +150,8 @@ do_raw_disk_image_shrink_rootfs() { |
|
|
|
elif [[ $raw_disk_counts -eq 2 ]]; then |
|
|
|
sudo losetup $loopdevice $raw_disk_image -o $((${raw_disk_sizes[prootfs_start]} * $sector_size)) |
|
|
|
else |
|
|
|
log "Error: invalid/unsupported embedded raw disk image. Aborting." |
|
|
|
return 1 |
|
|
|
log "Warning: invalid/unsupported embedded raw disk image. Skipping resize..." |
|
|
|
return 0 |
|
|
|
fi |
|
|
|
|
|
|
|
block_size=($(sudo dumpe2fs -h $loopdevice | grep 'Block size' | tr -s ' ' | cut -d ' ' -f3)) |
|
|
@ -648,6 +639,9 @@ do_from_raw_disk_image() { |
|
|
|
return 1 |
|
|
|
fi |
|
|
|
|
|
|
|
do_raw_disk_image_shrink_rootfs || rc=$? |
|
|
|
[[ $rc -ne 0 ]] && { return 1; } |
|
|
|
|
|
|
|
do_raw_disk_image_create_partitions || rc=$? |
|
|
|
[[ $rc -ne 0 ]] && { return 1; } |
|
|
|
|
|
|
@ -797,14 +791,6 @@ mender_rootfs_image=${output_dir}/${mender_rootfs_basename} |
|
|
|
mender_artifact=${output_dir}/${mender_disk_basename}.mender |
|
|
|
|
|
|
|
case "$1" in |
|
|
|
raw-disk-image-shrink-rootfs) |
|
|
|
total=1 |
|
|
|
do_raw_disk_image_shrink_rootfs || rc=$? |
|
|
|
[[ $rc -ne 0 ]] && { log "Check $build_log for details."; exit 1; } |
|
|
|
log "The rootfs partition in the raw disk image has been shrinked successfully!" |
|
|
|
log "You can now convert the output raw disk image\n\t$raw_disk_image\ |
|
|
|
\nto a Mender disk image." |
|
|
|
;; |
|
|
|
mender-disk-image-to-artifact) |
|
|
|
total=1 |
|
|
|
do_mender_disk_image_to_artifact || rc=$? |
|
|
|