I am trying to convert image from https://downloads.raspberrypi.org/raspios_lite_armhf_latest
to use with mender.io (Minimal image based on Debian Buster)
I provisioned original image to 2GB SD card, it is booting / working fine,
then copied from SD card (dd) to disk
I build mender-convert (2.1.0 )
Running mender-convert -v
Version: cc3f688
Created rootfs_overlay_demo, as per tutorial
Run mender-convert:
misha-asus/media/misha/LINUX_5T/RPi/mender-convert (2.1.0 $)$ MENDER_ARTIFACT_NAME=release-1 ./docker-mender-convert --disk-image input/rpi_2GB.img --config configs/raspberrypi4_config --overlay rootfs_overlay_demo/
Running mender-convert --disk-image input/rpi_2GB.img --config configs/raspberrypi4_config --overlay rootfs_overlay_demo/
Running mender-convert-extract: --disk-image input/rpi_2GB.img --config configs/raspberrypi4_config --overlay rootfs_overlay_demo/
2020-09-11 21:19:39 [INFO] [mender-convert-extract] Using configuration file: configs/mender_convert_config
2020-09-11 21:19:39 [INFO] [mender-convert-extract] Using configuration file: configs/raspberrypi4_config
2020-09-11 21:19:39 [INFO] [mender-convert-extract] Validating disk image
2020-09-11 21:19:39 [INFO] [mender-convert-extract] Disk parsed successfully
2020-09-11 21:19:39 [INFO] [mender-convert-extract] NUMBER OF PARTS: 2 TYPE: dos
2020-09-11 21:19:39 [INFO] [mender-convert-extract] PART 1: SIZE: 256M TYPE: 0xc
2020-09-11 21:19:39 [INFO] [mender-convert-extract] PART 1: extracting to work/part-1.fs
2020-09-11 21:19:47 [INFO] [mender-convert-extract] PART 2: SIZE: 1.6G TYPE: 0x83
2020-09-11 21:19:47 [INFO] [mender-convert-extract] PART 2: extracting to work/part-2.fs
mender-convert-extract has finished. Cleaning up...
Running mender-convert-modify: --disk-image input/rpi_2GB.img --config configs/raspberrypi4_config --overlay rootfs_overlay_demo/
2020-09-11 21:21:05 [INFO] [mender-convert-modify] Using configuration file: configs/mender_convert_config
2020-09-11 21:21:05 [INFO] [mender-convert-modify] Using configuration file: configs/raspberrypi4_config
2020-09-11 21:21:08 [INFO] [mender-convert-modify] Installing Mender client and related files
2020-09-11 21:21:10 [INFO] [mender-convert-modify] Using root device A in mender.conf: /dev/mmcblk0p2
2020-09-11 21:21:10 [INFO] [mender-convert-modify] Using root device B in mender.conf: /dev/mmcblk0p3
2020-09-11 21:21:10 [INFO] [mender-convert-modify] Creating state scripts version file.
2020-09-11 21:21:11 [INFO] [mender-convert-modify] Installing a custom /etc/fstab (see work/convert.log for more info)
2020-09-11 21:21:11 [INFO] [mender-convert-modify] Using boot partition device in fstab: /dev/mmcblk0p1
2020-09-11 21:21:11 [INFO] [mender-convert-modify] Using data partition device in fstab: /dev/mmcblk0p4
2020-09-11 21:21:11 [INFO] [mender-convert-modify] Performing platform specific modifications (if any)
2020-09-11 21:21:11 [INFO] [mender-convert-modify] Running hook: platform_modify
2020-09-11 21:21:13 [INFO] [mender-convert-modify] Performing user/local specific modifications (if any)
2020-09-11 21:21:13 [INFO] [mender-convert-modify] Running hook: user_local_modify
2020-09-11 21:21:13 [INFO] [mender-convert-modify] Applying rootfs overlay: rootfs_overlay_demo/
mender-convert-modify has finished. Cleaning up...
Running mender-convert-package: --disk-image input/rpi_2GB.img --config configs/raspberrypi4_config --overlay rootfs_overlay_demo/
2020-09-11 21:21:14 [INFO] [mender-convert-package] Using configuration file: configs/mender_convert_config
2020-09-11 21:21:14 [INFO] [mender-convert-package] Using configuration file: configs/raspberrypi4_config
2020-09-11 21:21:14 [WARN] [mender-convert-package] The allocated boot part size 40 MiB is too small.
2020-09-11 21:21:14 [WARN] [mender-convert-package] The actual boot part size is 256 MiB
2020-09-11 21:21:14 [WARN] [mender-convert-package] Will adjust MENDER_BOOT_PART_SIZE_MB automatically
2020-09-11 21:21:14 [WARN] [mender-convert-package] Consider adjusting the configuration file to avoid this message
2020-09-11 21:21:18 [INFO] [mender-convert-package] Rootfs filesystem size will be 1875 MiB
2020-09-11 21:21:18 [INFO] [mender-convert-package] Creating a file-system image from: work/rootfs/data/
2020-09-11 21:21:19 [INFO] [mender-convert-package] Creating a file-system image from: work/rootfs/
2020-09-11 21:22:58 [INFO] [mender-convert-package] Copying root filesystem image to deploy directory
2020-09-11 21:24:32 [INFO] [mender-convert-package] Writing Mender artifact to: deploy/rpi_2GB-raspberrypi4-mender.mender
2020-09-11 21:24:32 [INFO] [mender-convert-package] This can take up to 20 minutes depending on which compression method is used
2020-09-11 21:28:01 [INFO] [mender-convert-package] Creating Mender compatible disk-image
2020-09-11 21:28:01 [INFO] [mender-convert-package] Total disk size: 8192 MiB
2020-09-11 21:28:01 [INFO] [mender-convert-package] Boot partition 256 MiB
2020-09-11 21:28:01 [INFO] [mender-convert-package] RootFS partitions 3892 MiB x 2
2020-09-11 21:28:01 [INFO] [mender-convert-package] Data partition 128 MiB
2020-09-11 21:28:01 [INFO] [mender-convert-package] Using input diskimage partition scheme (dos)
2020-09-11 21:28:01 [INFO] [mender-convert-package] Writing DOS (MBR) partition table
2020-09-11 21:28:03 [INFO] [mender-convert-package] Writing boot partition image
2020-09-11 21:28:14 [INFO] [mender-convert-package] Writing rootfsa partition image
2020-09-11 21:33:06 [INFO] [mender-convert-package] Writing rootfsb partition image
2020-09-11 21:37:59 [INFO] [mender-convert-package] Writing data partition image
2020-09-11 21:37:59 [INFO] [mender-convert-package] Performing platform specific package operations (if any)
2020-09-11 21:37:59 [INFO] [mender-convert-package] Running hook: platform_package
2020-09-11 21:37:59 [INFO] [mender-convert-package] Compressing deploy/rpi_2GB-raspberrypi4-mender.img.gz
2020-09-11 21:41:28 [INFO] [mender-convert-package] Conversion has completed! \o/
mender-convert-package has finished. Cleaning up...
Output Artifacts and images can be found in the deploy directory:
deploy/rpi32_small-raspberrypi4-mender.cfg
deploy/rpi32_small-raspberrypi4-mender.ext4
deploy/rpi32_small-raspberrypi4-mender.img
deploy/rpi32_small-raspberrypi4-mender.mender
deploy/rpi_2GB-raspberrypi4-mender.cfg
deploy/rpi_2GB-raspberrypi4-mender.ext4
deploy/rpi_2GB-raspberrypi4-mender.img.gz
deploy/rpi_2GB-raspberrypi4-mender.mender
deploy/rpi_2GB_3-raspberrypi3-mender.cfg
deploy/rpi_2GB_3-raspberrypi3-mender.ext4
deploy/rpi_2GB_3-raspberrypi3-mender.img
deploy/rpi_2GB_3-raspberrypi3-mender.mender
deploy/rpi_32-raspberrypi4-mender.cfg
deploy/rpi_32-raspberrypi4-mender.ext4
deploy/rpi_32-raspberrypi4-mender.img
deploy/rpi_32-raspberrypi4-mender.mender
Everything seem fine so far (fdisk -lu):
Disk rpi_2GB-raspberrypi4-mender.img: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x4efa4bd2
Device Boot Start End Sectors Size Id Type
rpi_2GB-raspberrypi4-mender.img1 * 24576 548863 524288 256M c W95 FAT32 (LBA)
rpi_2GB-raspberrypi4-mender.img2 548864 8519679 7970816 3.8G 83 Linux
rpi_2GB-raspberrypi4-mender.img3 8519680 16490495 7970816 3.8G 83 Linux
rpi_2GB-raspberrypi4-mender.img4 16490496 16752639 262144 128M 83 Linux
Wrote file to 32 GB SD card. Trying to boot. Monitor shows signal, but nothing on the screen
Ethernet light stays orange, no blinking
After fiddling around with RPI, I figured out how to enable serial output for boot
messages. It turns out I had to modify eeprom as per this doc
https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md
In addition to this (very strange) messages only come out if after I turn power on
I also send some data (keystroke) on host computer. It seem it wakes up Rpi boot output
(this note not related to the topic).
The serial log is here:
Initialising SDRAM 'Micron' 32Gb x2 total-size: 64 Gbit 3200
VLI: HUB2: 0xfff00000 0x24e6 MCU: 0xfff20000 0x15218
VL805 0xfff00000 0xfff20000
XHCI-STOP
xHC ver: 256 HCS: 05000420 fc000031 00e70004 HCC: 002841eb
xHC ports 5 slots 32 intrs 4
Boot mode: SD (01) order f4
SD HOST: 250000000 CTL0: 0x00000000 BUS: 100000 Hz actual: 100000 HZ div: 2500 (1250) status: 0x1fff0000 delay: 1080
SD HOST: 250000000 CTL0: 0x00000f00 BUS: 100000 Hz actual: 100000 HZ div: 2500 (1250) status: 0x1fff0000 delay: 1080
CID: 000353444147474344805d7a40fc0111
CSD: 400e00325b590000edc87f800a404000
SD: bus-width: 4 spec: 2 SCR: 0x02358443 0x00000000
SD HOST: 250000000 CTL0: 0x00000f04 BUS: 50000000 Hz actual: 41666666 HZ div: 6 (3) status: 0x1fff0000 delay: 2
MBR: 0x00006000, 524288 type: 0x0c
MBR: 0x00086000, 7970816 type: 0x83
MBR: 0x00820000, 7970816 type: 0x83
MBR: 0x00fba000, 262144 type: 0x83
lba: 24576 oem: 'mkfs.fat' volume: ' boot '
rsc 32 fat-sectors 4033 c-count 516190 c-size 1 r-dir 2 r-sec 0
PM_RSTS: 0x00001000
Partition: 0
lba: 24576 oem: 'mkfs.fat' volume: ' boot '
rsc 32 fat-sectors 4033 c-count 516190 c-size 1 r-dir 2 r-sec 0
Read config.txt bytes 1856 hnd 0x00000386 hash 'fcb68e2872e9a1c2'
recover4.elf not found (6)
recovery.elf not found (6)
Read start4.elf bytes 2278336 hnd 0x0001128e hash '78e6729ebb0d2e84'
Read fixup4.dat bytes 5418 hnd 0x00000399 hash '6f078b9acde7f5e1'
0x00d03114 0x00000000 0x0000001f
MEM GPU: 76 ARM: 948 TOTAL: 1024
Starting start4.elf @ 0xfec00200 partition 0
MESS:00:00:05.352103:0: arasan: arasan_emmc_open
MESS:00:00:05.511771:0: brfs: File read: /mfs/sd/config.txt
MESS:00:00:05.515012:0: brfs: File read: 1856 bytes
MESS:00:00:05.544699:0: brfs: File read: /mfs/sd/config.txt
MESS:00:00:05.553921:0: brfs: File read: 1856 bytes
MESS:00:00:06.016100:0: gpioman: gpioman_get_pin_num: pin DISPLAY_DSI_PORT not defined
MESS:00:00:06.023350:0: *** Restart logging
MESS:00:00:06.038378:0: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
MESS:00:00:06.044318:0: HDMI0: hdmi_pixel_encoding: 300000000
MESS:00:00:06.049796:0: HDMI1: hdmi_pixel_encoding: 300000000
MESS:00:00:06.060219:0: dtb_file 'bcm2711-rpi-4-b.dtb'
MESS:00:00:06.069041:0: brfs: File read: /mfs/sd/bcm2711-rpi-4-b.dtb
MESS:00:00:06.072281:0: Loading 'bcm2711-rpi-4-b.dtb' to 0x100 size 0xb96f
MESS:00:00:06.091168:0: brfs: File read: 47471 bytes
MESS:00:00:06.103017:0: brfs: File read: /mfs/sd/overlays/overlay_map.dtb
MESS:00:00:06.162139:0: brfs: File read: 1423 bytes
MESS:00:00:06.167623:0: brfs: File read: /mfs/sd/config.txt
MESS:00:00:06.170544:0: dtparam: audio=on
MESS:00:00:06.183074:0: brfs: File read: 1856 bytes
MESS:00:00:06.195963:0: brfs: File read: /mfs/sd/overlays/vc4-fkms-v3d.dtbo
MESS:00:00:06.216277:0: Loaded overlay 'vc4-fkms-v3d'
MESS:00:00:06.284434:0: brfs: File read: 1238 bytes
MESS:00:00:06.291753:0: brfs: File read: /mfs/sd/overlays/disable-bt.dtbo
MESS:00:00:06.330035:0: Loaded overlay 'disable-bt'
MESS:00:00:06.427699:0: brfs: File read: 1073 bytes
MESS:00:00:06.433059:0: brfs: File read: /mfs/sd/cmdline.txt
MESS:00:00:06.435689:0: Read command line from file 'cmdline.txt':
MESS:00:00:06.441552:0: 'console=serial0,115200 console=tty1 root=${mender_kernel_root} rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait'
MESS:00:00:07.716263:0: brfs: File read: 122 bytes
MESS:00:00:07.802590:0: brfs: File read: /mfs/sd/kernel7l.img
MESS:00:00:07.805277:0: Loading 'kernel7l.img' to 0x8000 size 0x5e390
MESS:00:00:07.811452:0: Device tree loaded to 0x2eff4100 (size 0xbe95)
MESS:00:00:07.817896:0: uart: Set PL011 baud rate to 103448.300000 Hz
MESS:00:00:07.826807:0: uart: Baud rate change done...
MESS:00:00:07.828859:0: uart: Baud rate change done...
MESS:00:00:07.838232:0: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
MMC: mmcnr@7e300000: 1, emmc2@7e340000: 0
Loading Environment from MMC... OK
In: serial
Out: serial
Err: serial
Net: Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
568 bytes read in 13 ms (42 KiB/s)
\## Executing script at 02400000
switch to partitions #0, OK
mmc0 is current device
5996480 bytes read in 1224 ms (4.7 MiB/s)
Kernel image @ 0x080000 [ 0x000000 - 0x5b7fc0 ]
\## Flattened Device Tree blob at 2eff4100
Booting using the fdt blob at 0x2eff4100
reserving fdt memory region: addr=0 size=1000
Using Device Tree in place at 2eff4100, end 2f002f94
Starting kernel ...
Here boot stops, apparently when kernel should start
After comparing boot partitions for original image and mender-converted one I found very
few differences, namely
kernel7l.img
Original file:
rw-r–r-- 1 misha misha 5996480 Aug 11 23:36 /media/misha/boot/kernel7l.img
file /media/misha/boot/kernel7l.img
/media/misha/boot/kernel7l.img: Linux kernel ARM boot executable zImage (little-endian)
The file on mender image is
-rw-r–r-- 1 misha misha 385936 Sep 11 14:21 /media/misha/boot1/kernel7l.img
file /media/misha/boot1/kernel7l.img
/media/misha/boot1/kernel7l.img: COM executable for DOS
Interesting, if I just replace kernel7l.img from mender-convert to original one.
system boots, but not all the way.
I think something went wrong, and new kernel7l.img does not work for RPi4.
Any help greatly appreciated.
Thank you!
Mikhail