@mirzak, @drewmoseley
Note: Previous mender_convert version 2.0 I followed the same steps and it was successful.
Steps that I had followed:
-
Downloaded tool
https://github.com/mendersoftware/mender-convert/tree/2.2.x -
cd mender-convert
-
created generic-x86_64 at path “mender-convert/configs/generic-x86_64”
MENDER_STORAGE_DEVICE=/dev/sda
MENDER_DEVICE_TYPE=“generic-x86_64”
MENDER_STORAGE_TOTAL_SIZE_MB=“24000”
MENDER_BOOT_PART_SIZE_MB=“512”
MENDER_DATA_PART_SIZE_MB=“2000”Nothing to copy
MENDER_COPY_BOOT_GAP=“n”
-
mkdir -p input & cd input
-
copy ubuntu18.04 .img into input folder
-
convert virtual box .vhd to .img file
sudo VBoxManage clonehd <path to .vhd file of Virtual box Ubuntu 18.04> <.img destination file path> --format raw -
sudo su
-
Execute ./docker-build
-
Generate Mender Artifact image file (.mender) and golden SD card Image file (.img similar to .sdimg) from Ubuntu 18.04 raw image (.img) file by entering below command.
MENDER_ARTIFACT_NAME=release-1 ./docker-mender-convert --disk-image input/<.img file created in previous Section:Create Raw Ubuntu 18.04 Image> --config configs/generic-x86_64 -
fdisk -l -u <.img golden image filename>
-
Mount SD image partition & Edit grub configuration file with below commands.
sudo mkdir /mnt/boot sudo mount -o loop,offset=((512*16384)) <.img golden image file-path> /mnt/boot cd /mnt/boot/EFI/BOOT/
$ sudo gedit grub.cfg
Replace mender_grub_storage_device=hd0 in grub.cfg.
grub_storage=${root}
if [ “$grub_storage” == “hd0,msdos1” ]; then
mender_grub_storage_device=hd0
elif [ “$grub_storage” == “hd1,msdos1” ]; then
mender_grub_storage_device=hd1
elif [ “$grub_storage” == “hd2,msdos1” ]; then
mender_grub_storage_device=hd2
elif [ “$grub_storage” == “hd3,msdos1” ]; then
mender_grub_storage_device=hd3
elif [ “$grub_storage” == “hd4,msdos1” ]; then
mender_grub_storage_device=hd4
elif [ “$grub_storage” == “hd5,msdos1” ]; then
mender_grub_storage_device=hd5
elif [ “$grub_storage” == “hd6,msdos1” ]; then
mender_grub_storage_device=hd6
elif [ “$grub_storage” == “hd7,msdos1” ]; then
mender_grub_storage_device=hd7
fi
-
Assign kernel_imagetype and initrd_imagetype fields values
kernel_imagetype=vmlinuz-5.3.0-51-generic
initrd_imagetype=initrd.img-5.3.0-51-generic -
Unmount boot partition
cd sudo umount /mnt/boot -
Burn Golden image (.img) on SD Card Format the SD card to type FAT32
$ sudo dd if=<.img file path> of= bs=1M status=progress conv=fsync && sudo sync -
Burn Host Machine with prepared SD Card with Golden Image
a. Insert Ubuntu 18.04 bootable pen drive on Host Machine (machine on which mender image (.mender) will deploy) and boot up Host Machine with Pen drive and Try Ubuntu option.
b. After booting up with Pen Drive and Try Ubuntu, Insert SD Card on Host Machine.c. Format using gparted or disk utility application. Delete all partitions and then format it to FAT32.
d. Open a terminal and burn the golden image on the Host machine
sudo dd if= of= bs=1M status=progress conv=fsync && sudo sync
e. On successfully burn on Host Machine Primary Partition, Reboot Host Machine.
On reboot, i am getting an error as "login incorrect sulogin: crypt failed: Invalid argument"
I would gladly accept if you have an idea or want to give advice.
Best regards