Rather new to Mender, so I basically followed this post: Raspberry Pi 3 Model B/B+ Raspbian. I substituted the official raspbian image with a custom one built via pi-gen (Only modifications around boot is enabling i2c). I wrote the .sdimg to the sd card using etcher. The image does work without using mender-convert.
I noticed the pi wasn’t booting, so I connected a serial and saw the following:
U-Boot 2018.07-g981cc831e3 (May 13 2019 - 01:06:40 +0000)
DRAM: 948 MiB
RPI 3 Model B (0xa22082)
MMC: mmc@7e202000: 0, sdhci@7e300000: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment
Failed (-5)
Loading Environment from MMC... OK
In: serial
Out: serial
Err: serial
Net: 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
300 bytes read in 0 ms
## Executing script at 02400000
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
switch to partitions #0, OK
mmc0 is current device
4944992 bytes read in 209 ms (22.6 MiB/s)
Kernel image @ 0x080000 [ 0x000000 - 0x4b7460 ]
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
SCRIPT FAILED: continuing...
starting USB...
I’m not quite sure where to start troubleshooting, any help would be appreciated.
Could you try removing init=/usr/lib/raspi-config/init_resize.sh from cmdline.txt before attempting the first boot. I suspect it is related to this, though we have not found out why.
I appreciate the guidance, you put me on the right path! I removed that directive and my custom image boots (and reboots correctly). I’m wondering if there was some error on first boot now… I’ll reflash again and monitor first boot for anything.
Thanks! Anything I can provide to help track down that bug?
I’m wondering if there was some error on first boot now… I’ll reflash again and monitor first boot for anything.
What that line does is that it will on first boot try to expand the “data” partition to occupy the remaining space available on the disk and by removing this line you have skipped this step.
There is probably something going wrong in the “expand” procedure that corrupts the SD.
Thanks! Anything I can provide to help track down that bug?
And the pi still works. The /usr/sbin/resizefs.sh script just aborts.
I re-imaged, and I got the following on the boot right after the resize reboot (without the init work around). The error message differs from the third reboot.
[ 7.476983] sysrq: SysRq : Resetting
[ 7.480635] CPU0: stopping
[ 7.483637] CPU1: stopping
[ 7.486595] CPU3: stopping
U-Boot 2018.07-g981cc831e3 (May 13 2019 - 01:06:40 +0000)
DRAM: 948 MiB
RPI 3 Model B (0xa22082)
MMC: mmc@7e202000: 0, sdhci@7e300000: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment
Failed (-5)
Loading Environment from MMC... OK
In: serial
Out: serial
Err: serial
Net: 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
300 bytes read in 1 ms (293 KiB/s)
## Executing script at 02400000
libfdt fdt_path_offset() returned FDT_ERR_BADSTRUCTURE
switch to partitions #0, OK
mmc0 is current device
4944992 bytes read in 208 ms (22.7 MiB/s)
Kernel image @ 0x080000 [ 0x000000 - 0x4b7460 ]
## Flattened Device Tree blob at 2eff9800
Booting using the fdt blob at 0x2eff9800
reserving fdt memory region: addr=0 size=1000
reserving fdt memory region: addr=2eff9800 size=7800
Using Device Tree in place at 2eff9800, end 2f003fff
WARNING: could not set serial-number FDT_ERR_BADSTRUCTURE.
ERROR: root node setup failed
- must RESET the board to recover.
FDT creation failed! hanging...### ERROR ### Please RESET the board ###
I have been working all night on this stuff, and I got to the end of it all, and it seems I am having the same experience. I do not know for sure yet, but I am working w/ 1.1
I am starting over…
I guess I just
git clone --no-checkout
git checkout 1.1.x
Thanks for working on all of this, it is pretty late here, so I apologize for my dry lifeless post.
From a written image just like in this guide, and it did solve my issue. I am grateful this fix is here.
I am about to write a 1.1.x convert, and I will report on that. I can also report on artifact application, because that is the last step in my testing.
The report on artifact testing will most likely be later today.