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

Was there any progress on this? Im interested in converting an Ubuntu 20.04 for a rpi and im stuck at the same problems mentioned here.

@janezcimerman: No, I’m not working on this any longer. It was only the first step. Now I’m using our final HW platform an Intel based “standard” system.

Just a heads up Mender.io staff… I just spent 30 minutes writing a rant about how much I’m starting to think this product is smoke and mirrors and/or vaporware for at least 1 OS on 1 SBC system. Unfortunately, and the reason for the rant is, It’s Ubuntu and RPI4. Like it or not, those two make up a very large market share, with Ubuntu being the *ux of choice for servers for around 85% of the systems out there (IIRC, don’t quote me, it’s late) and RPI hardware in general being VERY attractive to clients such as mine and to burgeoning DIY embedded system designers.

I saved the original rant and replaced it with this message.

Final thought: PLEASE get your community hub’s info aggregated into single locations like “sticky” threads or just maybe update your documentation with some of the content here. Furthermore, your documentation could stand quite a bit of revision. The tutorial on mender-convert is missing several pieces of information such as recommended methods of imaging disks, what you can and/or should do to the image after creating it but before conversion (failures because partitioning wouldn’t fit on the disk it came from??? I know how it can be fixed, but don’t you think that telling a complete unknown variable (i.e. random tutorial readers) a few more items of information such as how to trim down disk used space, resizing partitions AFTER imaging, and many many more things about using your service might be helpful? Additionally, do you really feel that placing a challenge (“do you think you can do better?”) to improve upon your documentation is really a good idea? I can tell you that it was a cause for concern to me even before I started reading it…

If you think this was long and “rant-y”, you should have seen the rant…

1 Like

throws hands up Amazing…

Amazing…

@rushowr this thread has only now caught my attention, I’m really sorry about that. However I hope that the “Amazing” means you’ve had some good success?

Having said that, I am very much aware of the need to revisit and streamline the documentation respectively tutorial situation. It is high on my priority list and will be started real soon.

Obviously this is both late and not making up for lost time, which I dearly know as a developer, but what I can offer straight away is time to take your opinion and also rants. Just ping me if you feel like it!

Greetz,
Josef

1 Like

Josef, thank you for your reply. I wish that I had better news for you concerning what “amazing” meant. I was making a statement about how amazingly frustrating working with this product. I’ll contact you directly, and any information of use that results will be compiled into a post by me on the board to help others probably feeling the same way I do here but not having the lack of inhibition that I do (gotta love traumatic brain injuries that result in that particular effect)…
Cheers, and talk soon!

1 Like