Flashing "ubuntu" to BeagleV Ahead crashes

Host system is Fedora 40 Silverblue. How to reproduce:

  1. Install android-tools.
  2. Download the archive `https://files.beagle.cc/file/beagleboard-public-2021/images/xuantie-ubuntu-23.04-20230705.zip and unpack it.
  3. Put the BeagleV Ahead in USB mode. lsusb output:
❯ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0408:a061 Quanta Computer, Inc. HD User Facing
Bus 001 Device 004: ID 8087:0026 Intel Corp. AX201 Bluetooth
Bus 001 Device 005: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 001 Device 006: ID 2345:7654 T-HEAD USB download gadget
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 003: ID 05e3:0626 Genesys Logic, Inc. Hub
  1. Run the flash script:
❯ fastboot --version
fastboot version 34.0.4-android-tools
Installed as /usr/bin/fastboot
❯ sudo ./fastboot_emmc.sh
boot.ext4.xz (1/1)
  100 %     8,690.8 KiB / 190.0 MiB = 0.045                                    
root.ext4.xz (1/1)
  100 %     780.7 MiB / 4,500.0 MiB = 0.173    83 MiB/s       0:53             
Warning: skip copying ram image avb footer (ram partition size: 0, ram image size: 963856).
Sending 'ram' (941 KB)                             OKAY [  0.249s]
Writing 'ram'                                      OKAY [  0.002s]
Finished. Total time: 0.263s
Rebooting                                          OKAY [  0.001s]
Finished. Total time: 0.353s
OKAY [  0.015s]
Finished. Total time: 0.015s
Warning: skip copying uboot image avb footer (uboot partition size: 0, uboot image size: 963856).
Sending 'uboot' (941 KB)                           OKAY [  0.047s]
Writing 'uboot'                                    OKAY [  0.083s]
Finished. Total time: 0.174s
Warning: skip copying boot image avb footer (boot partition size: 409600, boot image size: 929792).
Sending sparse 'boot' 1/1 (21500 KB)               OKAY [  0.864s]
Writing 'boot'                                     OKAY [  2.000s]
Finished. Total time: 3.005s
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::compare: __pos (which is 929728) > this->size() (which is 0)
./fastboot_emmc.sh: line 23:  5193 Aborted                 (core dumped) fastboot flash root ./root.ext4
Rebooting                                          OKAY [  0.006s]
Finished. Total time: 0.106s

The yocto flash doesn’t work either - I’m going to try from a Raspberry Pi CM4 running Ubuntu 22.04 LTS tomorrow.

❯ sudo ./fastboot_emmc.sh
boot.ext4.xz (1/1)
  100 %     8,714.7 KiB / 190.0 MiB = 0.045                                    
root.ext4.xz (1/1)
  100 %       153.7 MiB / 664.0 MiB = 0.231    69 MiB/s       0:09             
Warning: skip copying ram image avb footer (ram partition size: 0, ram image size: 963760).
Sending 'ram' (941 KB)                             OKAY [  0.253s]
Writing 'ram'                                      OKAY [  0.002s]
Finished. Total time: 0.267s
Rebooting                                          OKAY [  0.001s]
Finished. Total time: 0.202s
OKAY [  0.015s]
Finished. Total time: 0.016s
Warning: skip copying uboot image avb footer (uboot partition size: 0, uboot image size: 963760).
Sending 'uboot' (941 KB)                           OKAY [  0.052s]
Writing 'uboot'                                    OKAY [  0.082s]
Finished. Total time: 0.179s
Warning: skip copying boot image avb footer (boot partition size: 409600, boot image size: 929792).
Sending sparse 'boot' 1/1 (21760 KB)               OKAY [  0.771s]
Writing 'boot'                                     OKAY [  2.122s]
Finished. Total time: 3.035s
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::compare: __pos (which is 929728) > this->size() (which is 0)
./fastboot_emmc.sh: line 23:  7978 Aborted                 (core dumped) fastboot flash root ./root.ext4
Rebooting                                          OKAY [  0.006s]
Finished. Total time: 0.056s

I tried this one from last year. It worked for me, i.e. especially after goofing with other OSs and trying random things…

Seth

P.S. If that one does not work and you have a Debian or Ubuntu system to upload the image via USB, please return service. I can keep trying to help out a bit.

That looks like the same one I tried, but I didn’t do a checksum on the download. I’m going to modify the script for that; maybe wget is messing the download up.

OK … I have this working now! It appears to be a bug in the Android SDK Platform Tools that ship with Fedora 40, specifically version 34. I used the official tools from https://developer.android.com/tools/releases/platform-tools (version 35) and I now have Ubuntu running on my BeagleV Ahead!

This may actually be a known Android tools bug:

adb

    Switch to libusb as the default on Linux issue #270205252.
    Fix adb startup on hosts without USB.
    Fix adb hangs caused by USB devices incorrectly reporting zero-length descriptors issue #302212871.
    Fix return code of adb shell when device disconnects issue #321787891.

https://issuetracker.google.com/issues/302212871?pli=1

Now I can troubleshoot WiFi!!

1 Like