BeagleBoneBlack Custom Image Issue

Hi,

We have our own debian bullseye image up and running on BBB currently. Now we want to make a mender image but we getting below error. I am using mender-convert and “beaglebone-black_debian_sdcard_config” files to create the image. What can be the problem??

U-Boot SPL 2022.04-00023-g4237220b-dirty (Apr 29 2022 - 22:02:41 +0300)
Trying to boot from MMC1

U-Boot 2022.04-00023-g4237220b-dirty (Apr 29 2022 - 22:02:41 +0300)

CPU : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM: 512 MiB
Reset Source: watchdog reset has occurred.
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
Core: 149 devices, 14 uclasses, devicetree: separate
WDT: Started wdt@44e35000 with servicing (60s timeout)
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4…
** Unable to use mmc 0:1 for loading the env **
Board: BeagleBone Black
not set. Validating first E-fuse MAC
BeagleBone Black:
BeagleBone Cape EEPROM: no EEPROM at address: 0x54
BeagleBone Cape EEPROM: no EEPROM at address: 0x55
BeagleBone Cape EEPROM: no EEPROM at address: 0x56
BeagleBone Cape EEPROM: no EEPROM at address: 0x57
Net: eth2: ethernet@4a100000, eth3: usb_ether
Press SPACE to abort autoboot in 0 seconds
board_name=[A335BNLT] …
board_rev=[00C0] …
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
Couldn’t find partition 0:2 0x82000000
Can’t set block device
Couldn’t find partition 0:2 0x82000000
Can’t set block device
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1…
93384 bytes read in 9 ms (9.9 MiB/s)
Scanning disk mmc@48060000.blk…
Scanning disk mmc@481d8000.blk…
Found 8 disks
No EFI system partition
BootOrder not defined
EFI boot manager: Cannot load any image
Found EFI removable media binary efi/boot/bootarm.efi
385024 bytes read in 28 ms (13.1 MiB/s)
Booting /efi\boot\bootarm.efi
Welcome to GRUB!

lock: OK
lock: OK

EFI stub: Entering in SVC mode with MMU enabled
EFI stub: Booting Linux Kernel…
EFI stub: Using DTB from configuration table
EFI stub: Exiting boot services…

1 Like

Hi @umtkyck,

I have similar situation.

I built a custom debian bullseye image with the official omap-image-builder.
The image (without mender integration) runs flawlessly on BBB.

Then I ran mender-convert with custom config:

source configs/beaglebone_black_base_config
MENDER_STORAGE_TOTAL_SIZE_MB="3648"
MENDER_DEVICE_TYPE="beaglebone-sdcard"
MENDER_STORAGE_DEVICE_BASE="/dev/mmcblk0p"
IMAGE_ROOTFS_SIZE="-1"

The conversion ran successfully.
Here’s the mender-convert log

root@d605bba7ef92:/mender-convert# MENDER_ARTIFACT_NAME="demo-1" ./mender-convert --config configs/ebc_device_sdcard_config --overlay ./input/rootfs
_overlay_demo/ --disk-image ./input/debian-11.5-minimal-armhf-2022-11-12-22-02-00-2gb.img
Running mender-convert-extract: --config ./work/override_compression_config --config configs/ebc_device_sdcard_config --overlay ./input/rootfs_overl
ay_demo/ --disk-image ./input/debian-11.5-minimal-armhf-2022-11-12-22-02-00-2gb.img
2022-11-13 02:43:28 [INFO] [mender-convert-extract] Using configuration file: configs/mender_convert_config
2022-11-13 02:43:28 [INFO] [mender-convert-extract] Using configuration file: ./work/override_compression_config
2022-11-13 02:43:28 [INFO] [mender-convert-extract] Using configuration file: configs/ebc_device_sdcard_config
2022-11-13 02:43:28 [INFO] [mender-convert-extract] Validating disk image
2022-11-13 02:43:28 [INFO] [mender-convert-extract] Disk parsed successfully
2022-11-13 02:43:28 [INFO] [mender-convert-extract] NUMBER OF PARTS: 1 TYPE: dos
2022-11-13 02:43:28 [INFO] [mender-convert-extract] PART 1: SIZE: 1.8G TYPE: 0x83
2022-11-13 02:43:28 [INFO] [mender-convert-extract] PART 1: extracting to work/part-1.fs
2022-11-13 02:43:38 [INFO] [mender-convert-extract] Generating boot partition (required, does not exist in original image)
2022-11-13 02:43:38 [INFO] [mender-convert-extract] Extracting boot gap to work/boot-gap.bin
2022-11-13 02:43:38 [WARN] [mender-convert-extract] Detected a U-Boot version in the range v2018.09 - v2019.07. These U-Boot versions are known to h
ave broken UEFI support, and therefore the MENDER_GRUB_EFI_INTEGRATION feature is unlikely to work. This only affects newly flashed devices using th
e partition image (extension ending in "img"). The Mender artifact should still work to upgrade an existing, working device. There are two possible
workarounds for this issue: 1) Use either an older or a newer image that works, and use a Mender artifact afterwards to up/down-grade it to the vers
ion you want. 2) If the device has a non-UEFI U-Boot port in mender-convert, use that (look for a board specific file in `configs`) . If you want to
 ignore this error and force creation of the image, set the MENDER_IGNORE_UBOOT_BROKEN_UEFI=1 config option.
mender-convert-extract has finished. Cleaning up...
Running mender-convert-modify: --config ./work/override_compression_config --config configs/ebc_device_sdcard_config --overlay ./input/rootfs_overla
y_demo/ --disk-image ./input/debian-11.5-minimal-armhf-2022-11-12-22-02-00-2gb.img
2022-11-13 02:43:38 [INFO] [mender-convert-modify] Using configuration file: configs/mender_convert_config
2022-11-13 02:43:38 [INFO] [mender-convert-modify] Using configuration file: ./work/override_compression_config
2022-11-13 02:43:38 [INFO] [mender-convert-modify] Using configuration file: configs/ebc_device_sdcard_config
2022-11-13 02:43:39 [INFO] [mender-convert-modify] Installing Mender client and related files
2022-11-13 02:43:39 [INFO] [mender-convert-modify] Installing Mender client version latest
2022-11-13 02:43:42 [INFO] [mender-convert-modify] Successfully downloaded mender-client_3.4.0-1+debian+bullseye_armhf.deb
2022-11-13 02:43:42 [INFO] [mender-convert-modify] Successfully installed mender-client_3.4.0-1+debian+bullseye_armhf.deb into /mender-convert/work/
rootfs/
2022-11-13 02:43:42 [INFO] [mender-convert-modify] Creating state folder in the data partition for Mender add-ons
2022-11-13 02:43:42 [INFO] [mender-convert-modify] Installing GRUB EFI bootloader...
2022-11-13 02:43:42 [INFO] [mender-convert-modify] Found Linux kernel image:

        /mender-convert/work/rootfs/boot/vmlinuz-5.10.140-ti-r52

2022-11-13 02:43:42 [INFO] [mender-convert-modify] Found initramfs image:

        /mender-convert/work/rootfs/boot/initrd.img-5.10.140-ti-r52

2022-11-13 02:43:43 [INFO] [mender-convert-modify] Installing GRUB...
2022-11-13 02:43:43 [INFO] [mender-convert-modify] Installing mender-grub-editenv
2022-11-13 02:43:43 [INFO] [mender-convert-modify] Installing the GRUB editenv binary
2022-11-13 02:43:43 [INFO] [mender-convert-modify] GRUB EFI: bootarm.efi
2022-11-13 02:43:43 [INFO] [mender-convert-modify] Generating the mender-grub config...
2022-11-13 02:43:44 [INFO] [mender-convert-modify] Using root device A in mender.conf: /dev/mmcblk0p2
2022-11-13 02:43:44 [INFO] [mender-convert-modify] Using root device B in mender.conf: /dev/mmcblk0p3
2022-11-13 02:43:44 [INFO] [mender-convert-modify] Installing the local mender.conf file
2022-11-13 02:43:44 [INFO] [mender-convert-modify] Creating state scripts version file.
2022-11-13 02:43:44 [INFO] [mender-convert-modify] Installing a custom /etc/fstab (see /mender-convert/logs/convert.log for more info)
2022-11-13 02:43:44 [INFO] [mender-convert-modify] Using boot partition device in fstab: /dev/mmcblk0p1
2022-11-13 02:43:44 [INFO] [mender-convert-modify] Using data partition device in fstab: /dev/mmcblk0p4
2022-11-13 02:43:44 [INFO] [mender-convert-modify] Performing platform specific modifications (if any)
2022-11-13 02:43:44 [INFO] [mender-convert-modify] Running hook: platform_modify
2022-11-13 02:43:44 [INFO] [mender-convert-modify] Running hook: beaglebone_fix_broken_uefi
2022-11-13 02:43:44 [WARN] [mender-convert-modify] Attempting to work around broken UEFI support in U-Boot by forcing a newer U-Boot version.
2022-11-13 02:43:45 [INFO] [mender-convert-modify] Running hook: disable_udisks2_service
2022-11-13 02:43:45 [INFO] [mender-convert-modify] Performing user/local specific modifications (if any)
2022-11-13 02:43:45 [INFO] [mender-convert-modify] Running hook: user_local_modify
2022-11-13 02:43:45 [INFO] [mender-convert-modify] Applying rootfs overlay: ./input/rootfs_overlay_demo/
2022-11-13 02:43:45 [INFO] [mender-convert-modify] Performing overlay specific modifications (if any)
2022-11-13 02:43:45 [INFO] [mender-convert-modify] Running hook: overlay_modify
mender-convert-modify has finished. Cleaning up...
Running mender-convert-package: --config ./work/override_compression_config --config configs/ebc_device_sdcard_config --overlay ./input/rootfs_overl
ay_demo/ --disk-image ./input/debian-11.5-minimal-armhf-2022-11-12-22-02-00-2gb.img
2022-11-13 02:43:45 [INFO] [mender-convert-package] Using configuration file: configs/mender_convert_config
2022-11-13 02:43:45 [INFO] [mender-convert-package] Using configuration file: ./work/override_compression_config
2022-11-13 02:43:45 [INFO] [mender-convert-package] Using configuration file: configs/ebc_device_sdcard_config
2022-11-13 02:43:45 [INFO] [mender-convert-package] Rootfs filesystem size will be 1728 MiB
2022-11-13 02:43:46 [INFO] [mender-convert-package] Creating a file-system image from: work/rootfs/data/
2022-11-13 02:43:46 [INFO] [mender-convert-package] Creating a file-system image from: work/rootfs/
2022-11-13 02:43:59 [INFO] [mender-convert-package] Copying root filesystem image to deploy directory
2022-11-13 02:44:00 [INFO] [mender-convert-package] Writing Mender artifact to: deploy/debian-11.5-minimal-armhf-2022-11-12-22-02-00-2gb-beaglebone-
sdcard-mender.mender
2022-11-13 02:44:00 [INFO] [mender-convert-package] This can take up to 20 minutes depending on which compression method is used
2022-11-13 02:44:24 [INFO] [mender-convert-package] Creating Mender compatible disk-image
2022-11-13 02:44:24 [INFO] [mender-convert-package] Total disk size: 3648 MiB
2022-11-13 02:44:24 [INFO] [mender-convert-package]   Boot partition    40 MiB
2022-11-13 02:44:24 [INFO] [mender-convert-package]   RootFS partitions 1728 MiB x 2
2022-11-13 02:44:24 [INFO] [mender-convert-package]   Data partition    128 MiB
2022-11-13 02:44:24 [INFO] [mender-convert-package] Using input diskimage partition scheme (dos)
2022-11-13 02:44:24 [INFO] [mender-convert-package] Writing DOS (MBR) partition table
2022-11-13 02:44:24 [INFO] [mender-convert-package] Writing boot gap of size: 81920 (sectors)
2022-11-13 02:44:25 [INFO] [mender-convert-package] Writing boot partition image
2022-11-13 02:44:25 [INFO] [mender-convert-package] Writing rootfsa partition image
2022-11-13 02:44:35 [INFO] [mender-convert-package] Writing rootfsb partition image
2022-11-13 02:44:45 [INFO] [mender-convert-package] Writing data partition image
2022-11-13 02:44:46 [INFO] [mender-convert-package] Performing platform specific package operations (if any)
2022-11-13 02:44:46 [INFO] [mender-convert-package] Running hook: platform_package
2022-11-13 02:44:46 [INFO] [mender-convert-package] Conversion has completed! \o/
mender-convert-package has finished. Cleaning up...

But when I flash the converted mender image to SD card and boot up BBB, I have the similar error as yours.

U-Boot 2020.07 (Sep 21 2020 - 11:06:32 +0200)

CPU  : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM:  512 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment

Loading Environment from MMC... *** Warning - bad CRC, using default environment

<ethaddr> not set. Validating first E-fuse MAC
Net:   eth0: ethernet@4a100000
Warning: usb_ether MAC addresses don't match:
Address in ROM is		de:ad:be:ef:00:01
Address in environment is	d0:03:eb:de:d7:43
, eth1: usb_ether
Press SPACE to abort autoboot in 2 seconds
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
93357 bytes read in 9 ms (9.9 MiB/s)
Found EFI removable media binary efi/boot/bootarm.efi
Scanning disk mmc@48060000.blk...
Scanning disk mmc@481d8000.blk...
** Unrecognized filesystem type **
Found 6 disks
BootOrder not defined
EFI boot manager: Cannot load any image
385024 bytes read in 27 ms (13.6 MiB/s)
Welcome to GRUB!



EFI stub: Entering in SVC mode with MMU enabled
EFI stub: Booting Linux Kernel...
EFI stub: Using DTB from configuration table
EFI stub: Exiting boot services and installing virtual address map...

@ thienandangthanh
@ umtkyck

Did one of you solve the issue? I just encountered the same problem.

It looks like there is an issue with kernel. I am also using kernel 5.10. It boots totally fine, when booted without mender, but once deployed as a mender artifact the boot process stops.

any ideas?

Not sure if this is still relavent.

However I had the same issue. The image I used was Debian 11, I used a Debian 10 image and everything worked fine.

I am not sure what the difference is but could be a kernel issue.