Good news. I've managed to fix a bunch of problems I was having, including this one last night with the "invalid ELF header". Turns out there were some problems on my eMMC. With the serial debug cable, I observed quite a few of these errors during the installation:
[ 117.320212] blk_update_request: I/O error, dev mmcblk1, sector 4720648
[ 117.326810] blk_update_request: I/O error, dev mmcblk1, sector 4720656
[ 117.333405] blk_update_request: I/O error, dev mmcblk1, sector 4720664
The way I solved it was to do the following:
- insert the micro SD card with the installation image into a laptop or desktop computer before using it on the BB device
- edit the file /opt/scripts/tools/eMMC/init-eMMC-flasher-v3-bbgw.sh on the micro SD card (or whatever script is appropriate for your device)
- search for all instances of mkfs -- there are 3, all around lines 300-320
- add the extra parameter "-c -c" -- this calls badblocks(8) which will run a lengthy test to discover and mark bad blocks
The three individual mkfs lines will look something like this:
LC_ALL=C mkfs.vfat -c -c -F 16 ${destination}p1 -n ${boot_label}
LC_ALL=C mkfs.ext4 -c -c ${ext4_options} ${destination}p2 -L ${rootfs_label}
LC_ALL=C mkfs.ext4 -c -c ${ext4_options} ${destination}p1 -L ${boot_label}
The installation takes much longer (an hour?) because it checks the eMMC for bad blocks, but in my case it resurrected a device that was no longer working.
Stéphane