Try to run Mender with Ubuntu 20 LTS on Raspberry Pi 3 Model B

Hi,

I’m new in Mender and currently working on a PoC to evaluate it. After having a good start with Mender based on the “Get started” projects I’m now struggeling while creating my first own “golden image” with Ubuntu 20 LTS on a Raspberry 3 model B.

I installed Ubuntu on a 32GB SD card and after that there are 2 partitions – a small boot partition and a bigger OS partition. I shrink the OS partition to 8GB. After that I start mender-convert on an Ubuntu virtual machine hosted on Windows with VMware. The SD card is connected as block device from host to VM for using “dd”. The mender-convert process starts, detects the two partitions in the SD card image but runs in an error:

sven@ubuntu:~/mender-convert$ sudo MENDER_ARTIFACT_NAME=release-1 ./docker-mender-convert \

--disk-image input/golden-image-1.img \
--config configs/raspberrypi3_config \
--overlay rootfs_overlay_demo/

[sudo] password for sven:
Running mender-convert --disk-image input/golden-image-1.img --config configs/raspberrypi3_config --overlay rootfs_overlay_demo/
Running mender-convert-extract: --config ./work/override_compression_config --disk-image input/golden-image-1.img --config configs/raspberrypi3_config --overlay rootfs_overlay_demo/
2021-06-21 10:40:50 [INFO] [mender-convert-extract] Using configuration file: configs/mender_convert_config
2021-06-21 10:40:50 [INFO] [mender-convert-extract] Using configuration file: ./work/override_compression_config
2021-06-21 10:40:50 [INFO] [mender-convert-extract] Using configuration file: configs/raspberrypi3_config
2021-06-21 10:40:50 [INFO] [mender-convert-extract] Validating disk image
2021-06-21 10:40:50 [INFO] [mender-convert-extract] Disk parsed successfully
2021-06-21 10:40:50 [INFO] [mender-convert-extract] NUMBER OF PARTS: 2 TYPE: dos
2021-06-21 10:40:50 [INFO] [mender-convert-extract] PART 1: SIZE: 256M TYPE: 0xc
2021-06-21 10:40:50 [INFO] [mender-convert-extract] PART 1: extracting to work/part-1.fs
2021-06-21 10:40:51 [INFO] [mender-convert-extract] PART 2: SIZE: 8G TYPE: 0x83
2021-06-21 10:40:51 [INFO] [mender-convert-extract] PART 2: extracting to work/part-2.fs
mender-convert-extract has finished. Cleaning up…
Running mender-convert-modify: --config ./work/override_compression_config --disk-image input/golden-image-1.img --config configs/raspberrypi3_config --overlay rootfs_overlay_demo/
2021-06-21 10:41:34 [INFO] [mender-convert-modify] Using configuration file: configs/mender_convert_config
2021-06-21 10:41:34 [INFO] [mender-convert-modify] Using configuration file: ./work/override_compression_config
2021-06-21 10:41:34 [INFO] [mender-convert-modify] Using configuration file: configs/raspberrypi3_config
2021-06-21 10:41:34 [INFO] [mender-convert-modify] Installing Mender client and related files
2021-06-21 10:41:36 [INFO] [mender-convert-modify] Successfully downloaded mender-client_2.6.0-1_arm64.deb
2021-06-21 10:41:36 [INFO] [mender-convert-modify] Successfully installed mender-client_2.6.0-1_arm64.deb into /mender-convert/work/rootfs/
2021-06-21 10:41:36 [INFO] [mender-convert-modify] Creating the Mender Configure state folder in the data partition
2021-06-21 10:41:36 [INFO] [mender-convert-modify] Using root device A in mender.conf: /dev/mmcblk0p2
2021-06-21 10:41:36 [INFO] [mender-convert-modify] Using root device B in mender.conf: /dev/mmcblk0p3
2021-06-21 10:41:36 [INFO] [mender-convert-modify] Creating state scripts version file.
2021-06-21 10:41:36 [INFO] [mender-convert-modify] Installing a custom /etc/fstab (see /mender-convert/logs/convert.log.FJw4 for more info)
2021-06-21 10:41:36 [INFO] [mender-convert-modify] Using boot partition device in fstab: /dev/mmcblk0p1
2021-06-21 10:41:36 [INFO] [mender-convert-modify] Using data partition device in fstab: /dev/mmcblk0p4
2021-06-21 10:41:36 [INFO] [mender-convert-modify] Performing platform specific modifications (if any)
2021-06-21 10:41:36 [INFO] [mender-convert-modify] Running hook: platform_modify
mender-convert-modify has finished. Cleaning up…
2021-06-21 10:41:37 [ERROR] [mender-convert] mender-convert failed
2021-06-21 10:41:37 [DEBUG] [mender-convert-modify] When running: (configs/raspberrypi_config:78): run_and_log_cmd():

 sudo cp work/boot/kernel7.img work/rootfs/boot/zImage
 cp: cannot stat 'work/boot/kernel7.img': No such file or directory

2021-06-21 10:41:37 [ERROR] [mender-convert] mender-convert failed
2021-06-21 10:41:37 [ERROR] [mender-convert] mender-convert exit code: 1
Log file available at: logs/convert.log.FJw4

It seems the problem is not new. There are several other topics around Ubuntu and Raspi3 some years ago. What I have to do to overcome this “hurdle”?

Thanks for your advice
Sven

Hi @Sven_DS and thank you for trying out Mender.

I cannot see what the problem is.

The error is from this line and the variable RASPBERRYPI_KERNEL_IMAGE is defined here. So it seems like your boot partition has a different name for the kernel image.

I just tried converting a vanilla Ubuntu 20.04 and worked just fine using configs/raspberrypi3_config. The image I used was ubuntu-20.04.2-preinstalled-server-armhf+raspi.img.xz from official Ubuntu site. Can you please try with this vanilla image? That will show us if the problem is in your setup (I don’t think so, though) or with the image.

If the setup is sane, the next step I suggest is to then compare the contents of the boot partition from the vanilla image and your golden image. Maybe there is some modification and a new kernel image was installed in /boot partition (most likely the name of the kernel image). If the kernel image has a different name, redefine RASPBERRYPI_KERNEL_IMAGE in a custom config file and add it you your mender-convert call.

Keep us posted with your progress!

1 Like

Hi,

I try it with the other image … now I have another error:

Running mender-convert --disk-image input/golden-image-1.img --config configs/raspberrypi3_config --overlay rootfs_overlay_demo/
Running mender-convert-extract: --config ./work/override_compression_config --disk-image input/golden-image-1.img --config configs/raspberrypi3_config --overlay rootfs_overlay_demo/
2021-06-22 16:01:25 [INFO] [mender-convert-extract] Using configuration file: configs/mender_convert_config
2021-06-22 16:01:25 [INFO] [mender-convert-extract] Using configuration file: ./work/override_compression_config
2021-06-22 16:01:25 [INFO] [mender-convert-extract] Using configuration file: configs/raspberrypi3_config
2021-06-22 16:01:25 [INFO] [mender-convert-extract] Validating disk image
2021-06-22 16:01:25 [INFO] [mender-convert-extract] Disk parsed successfully
2021-06-22 16:01:25 [INFO] [mender-convert-extract] NUMBER OF PARTS: 2 TYPE: dos
2021-06-22 16:01:25 [INFO] [mender-convert-extract] PART 1: SIZE: 256M TYPE: 0xc
2021-06-22 16:01:25 [INFO] [mender-convert-extract] PART 1: extracting to work/part-1.fs
2021-06-22 16:01:26 [INFO] [mender-convert-extract] PART 2: SIZE: 4G TYPE: 0x83
2021-06-22 16:01:26 [INFO] [mender-convert-extract] PART 2: extracting to work/part-2.fs
mender-convert-extract has finished. Cleaning up…
Running mender-convert-modify: --config ./work/override_compression_config --disk-image input/golden-image-1.img --config configs/raspberrypi3_config --overlay rootfs_overlay_demo/
2021-06-22 16:01:49 [INFO] [mender-convert-modify] Using configuration file: configs/mender_convert_config
2021-06-22 16:01:49 [INFO] [mender-convert-modify] Using configuration file: ./work/override_compression_config
2021-06-22 16:01:49 [INFO] [mender-convert-modify] Using configuration file: configs/raspberrypi3_config
2021-06-22 16:01:50 [INFO] [mender-convert-modify] Installing Mender client and related files
mender-convert-modify has finished. Cleaning up…
2021-06-22 16:02:02 [ERROR] [mender-convert] mender-convert failed
2021-06-22 16:02:02 [DEBUG] [mender-convert-modify] When running: (modules/deb.sh:42): run_and_log_cmd():

wget -Nq https://downloads.mender.io/repos/debian/dists/stable/main/binary-armhf/Packages -P /tmp
2021-06-22 16:02:02 [ERROR] [mender-convert] mender-convert failed
2021-06-22 16:02:02 [ERROR] [mender-convert] mender-convert exit code: 4
Log file available at: logs/convert.log.2l3h

Try it 4 times - manual download works!?

Sven

Hi @Sven_DS,

That is indeed a very strange situation: it now has failed installing the Mender package (more specifically, inspecting downloads.mender.io for the latest package) which is before the kernel copy that was failing before.

This new error cannot be related to the image.

Needless to say that the wget on that URL works fine for me. Maybe some networking issue between Docker, the Ubuntu VM, and your Windows host?

Hi Sven,
can you please specify what version of the RPi Ubuntu image you’re using (32 or 64bit one)?

I don’t have an overall picture in my mind what docker is doing in your tool chain. But downloading the package manually via Firefox was possible. So - no network problems with the Ubuntu VM or the host.

I started with 64 bit. But after first hurdles it was suggested to go with 32 bit.

@Sven_DS my comment assumes that you are running docker-mender-convert, as documented in the official docs page, in the VM. In that case mender-convert is running inside a container, and hence the possible networking issue.

It really was more of a wild guess, it puzzles me that networking worked fine earlier (when you used your golden image).

Hi guys,

I’m not giving up. I try your tool chain with Raspi OS and it works fine. The conversion runs smoothly and after start I have registered the device. Backed with that success I try it with Ubuntu Server 20 LTS 32bit: conversion runs the first time without errors (don’t no why). But startup failed with the following log messages (see attachments).

Can you hit any key to drop it into U-Boot and then do the following:

U-Boot> env default -a -f
U-Boot> printenv mender_setup

Not sure why but it looks like your u-boot is missing the Mender environment variables.

Drew

Hi Sven,
one suggestion which might be a workaround for the networking issue is to run mender-convert directly in the VM.
So instead of Win->[VM] Linux-> [Docker] mender-convert you could try Win->[VM] Linux-> [Native] mender-convert.

To do this replace ./docker-mender-convert with just ./mender-convert when running it in your Ubuntu VM.

Result:

Yeah, that confirms that your UBoot is not built with the Mender patches. I don’t know what the “Error: Can’t force access to” messages are about.

I don’t know how the Ubuntu 20 RPI images work but it seems that a custom UBoot build will be needed. @tranchitella didn’t you play with mender-convert using Ubuntu?

Drew