OK! I completed the “Convert the Raspberry Pi disk image to support Mender” section, flashed the .sdimg file to a SD disk, booted it on the Pi, the Mender daemon is running and I was able to authorize the device in hosted Mender.
Next I tried creating my “golden image”. I flashed 2018-11-13-raspbian-stretch-lite.img
to a second SD card, booted it on the Pi, and made a change to the filesystem (I created a file “two” in the /home/pi directory as a marker).
I then copied the SD card on my Mac to a two.img
file using dd. (The resulting two.img file was 15GB, the size of the SD card). To check the img file, I flashed the file back to the SD card using Etcher and verified that I was able to boot the SD card on the Pi and see my filesystem change.
Now I ran docker-mender-convert
with the raw disk image set to two.img
, but it’s trying to create two 15GB partitions:
*** Data partition size set to default value: 128MB ***
*** Total storage size set to default value: 8GB ***
1/9 Repartitioning raw disk image...
Detected raw disk image with 2 partition(s).
Calculating partitions' sizes of the Mender image.
Adjust Mender disk image size to the total storage size (8000MB).
Defined total storage size of MB is too small.
Minimal required storage is 30448MB. Aborting.
Check /mender-convert/output/build.log for details.
Is there a way to tell mender-convert that I only want 4GB partitions?
I thought maybe raw-disk-image-shrink-rootfs
was what I might want to use, but I’m not sure how to use it:
./docker-mender-convert raw-disk-image-shrink-rootfs --raw-disk-image input/two.img
IMAGE_NAME=mender-convert
MENDER_CONVERT_DIR="$(pwd)"
mkdir -p output
docker run \
--mount type=bind,source="$MENDER_CONVERT_DIR,target=/mender-convert" \
--privileged=true \
$IMAGE_NAME "$@"
Running mender-convert raw-disk-image-shrink-rootfs --raw-disk-image input/two.img
*** Data partition size set to default value: 128MB ***
*** Total storage size set to default value: 8GB ***
1/1 Shrinking raw disk image root filesystem...
./mender-convert: line 191: local: `=': not a valid identifier
./mender-convert: line 191: local: `512': not a valid identifier
./mender-convert: line 201: 98304 * : syntax error: operand expected (error token is "* ")
Or should I shrink the partition on my “golden” SD card to 4GB before copying it to my .img file?