Package Details: python-pyamlboot-git r91.d7806ac-2

Git Clone URL: https://aur.archlinux.org/python-pyamlboot-git.git (read-only, click to copy)
Package Base: python-pyamlboot-git
Description: Amlogic USB Boot Protocol Library
Upstream URL: https://github.com/superna9999/pyamlboot
Licenses: MIT
Conflicts: python-pyamlboot
Provides: python-pyamlboot
Submitter: userbyte
Maintainer: userbyte
Last Packager: userbyte
Votes: 0
Popularity: 0.000000
First Submitted: 2024-12-12 04:53 (UTC)
Last Updated: 2025-04-23 03:08 (UTC)

Latest Comments

userbyte commented on 2025-04-23 03:07 (UTC)

silly mistake on my part! ive added pyusb as a dependency. thanks :)

compgamer89 commented on 2025-04-22 00:12 (UTC)

Looks like it's missing a dependency on python-pyusb:

/usr/bin/boot-g12.py:8: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
Traceback (most recent call last):
  File "/usr/bin/boot-g12.py", line 9, in <module>
    from pyamlboot import pyamlboot
  File "/usr/lib/python3.13/site-packages/pyamlboot/pyamlboot.py", line 14, in <module>
    import usb.core
ModuleNotFoundError: No module named 'usb'

userbyte commented on 2025-04-14 05:35 (UTC)

just now saw your comments, sorry!

i dont maintain the upstream package, i believe your issue is related to pyamlboot itself, you may have better luck creating an issue on their GH repo. i am not well versed enough in low level USB stuff to troubleshoot your issue, havent had anything like that occur in my testing, what i will say is USB can be finicky with permissions so maybe its a udev thing.

as for the deprecation notice, this package is tied to the git and is currently on the latest commit. a PR to upstream could resolve that.

xenobro commented on 2025-04-08 17:57 (UTC) (edited on 2025-04-08 18:13 (UTC) by xenobro)

Update: after rerunning "boot.py" with an "armbian" image, it seemed to work for a while, then almost the same error messages appeared, except different at the end:

...
  File "/usr/lib/python3.13/site-packages/usb/backend/libusb1.py", line 604, in _check
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 5] Input/Output Error

Are those messages related to the python-pyusb-git I had to install manually to get pyamlboot running?

xenobro commented on 2025-04-07 21:34 (UTC) (edited on 2025-04-08 17:44 (UTC) by xenobro)

When trying to burn a tanix image, there is seemingly no errors on screen, but the box doesn't boot:

[x@archlinux tanixtx5pro]$ boot.py --image tanix-tx5-pro-20170628.img --fdt gxl_p212_2g.dtb p212
/usr/bin/boot.py:9: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
Using GX Family boot parameters
ROM: 2.2 Stage: 0.0
Writing /usr/lib/python3.13/site-packages/files/p212/u-boot.bin.usb.bl2 at 0xd9000000...
[DONE]
Writing /usr/lib/python3.13/site-packages/files/usbbl2runpara_ddrinit.bin at 0xd900c000...
[DONE]
Running at 0xd9000000...
[DONE]
Waiting...
[DONE]
ROM: 2.2 Stage: 0.0
Writing /usr/lib/python3.13/site-packages/files/p212/u-boot.bin.usb.bl2 at 0xd9000000...
[DONE]
Writing /usr/lib/python3.13/site-packages/files/usbbl2runpara_runfipimg.bin at 0xd900c000...
[DONE]
Writing /usr/lib/python3.13/site-packages/files/p212/u-boot.bin.usb.tpl at 0x200c000...
[DONE]
Writing tanix-tx5-pro-20170628.img at 0x8080000...
[DONE]
Writing gxl_p212_2g.dtb at 0x8008000...
[DONE]
Running at 0xd9000000...
[DONE]

When trying an armbian image (that used to work) however, this appears immediately on screen:

[x@archlinux ~]$ boot.py --image Armbian_25.05.0_amlogic_s905x_bookworm_6.12.21_server_2025.04.01.img --fdt gxl_p212_2g.dtb p212
/usr/bin/boot.py:9: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
Using GX Family boot parameters
ROM: 2.2 Stage: 0.0
Writing /usr/lib/python3.13/site-packages/files/p212/u-boot.bin.usb.bl2 at 0xd9000000...
[DONE]
Writing /usr/lib/python3.13/site-packages/files/usbbl2runpara_ddrinit.bin at 0xd900c000...
[DONE]
Running at 0xd9000000...
[DONE]
Waiting...
[DONE]
ROM: 2.2 Stage: 0.0
Writing /usr/lib/python3.13/site-packages/files/p212/u-boot.bin.usb.bl2 at 0xd9000000...
[DONE]
Writing /usr/lib/python3.13/site-packages/files/usbbl2runpara_runfipimg.bin at 0xd900c000...
[DONE]
Writing /usr/lib/python3.13/site-packages/files/p212/u-boot.bin.usb.tpl at 0x200c000...
[DONE]
Writing Armbian_25.05.0_amlogic_s905x_bookworm_6.12.21_server_2025.04.01.img at 0x8080000...
Traceback (most recent call last):
  File "/usr/bin/boot.py", line 148, in <module>
   usb.write_file(args.imagefile, usb.UBOOT_IMAGEADDR, 512, True)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/boot.py", line 67, in write_file
    self.dev.writeLargeMemory(addr, b, large, fill)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/pyamlboot/pyamlboot.py", line 255, in writeLargeMemory
    self._writeLargeMemory(address+offset, data[offset:offset+writeLength], \
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                           blockLength, appendZeros)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/pyamlboot/pyamlboot.py", line 236, in _writeLargeMemory
    ep.write(data[offset:offset+blockLength], 1000)
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/usb/core.py", line 416, in write
    return self.device.write(self, data, timeout)
           ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/usb/core.py", line 1003, in write
    return fn(
            self._ctx.handle,
    ...<3 lines>...
            self.__get_timeout(timeout)
        )
  File "/usr/lib/python3.13/site-packages/usb/backend/libusb1.py", line 841, in bulk_write
    return self.__write(self.lib.libusb_bulk_transfer,
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                        dev_handle,
                        ^^^^^^^^^^^
    ...<2 lines>...
                        data,
                        ^^^^^
                        timeout)
                        ^^^^^^^^
  File "/usr/lib/python3.13/site-packages/usb/backend/libusb1.py", line 942, in __write
    _check(retval)
    ~~~~~~^^^^^^^^
  File "/usr/lib/python3.13/site-packages/usb/backend/libusb1.py", line 602, in _check
    raise USBTimeoutError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBTimeoutError: [Errno 110] Operation timed out

Any ideas? Thank you very much.

xenobro commented on 2025-04-07 20:11 (UTC) (edited on 2025-04-07 20:29 (UTC) by xenobro)

I'm trying to unbrick a Tanix Tx5 Pro (S905X, gxl_p212_2g) with pyamlboot, but I'm running into some issues with the program. Initially t gave me errors about "usb.core" missing, but that was solved by installing python-pyusb-git. But now the box disappears from lsusb after "boot.py" until disconnected and reconnected, and I'm not even sure what "boot.py" did:

[x@archlinux ~]$ lsusb
...
Bus 003 Device 003: ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP)
Bus 003 Device 017: ID 1b8e:c003 Amlogic, Inc. GX-CHIP
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
...
[x@archlinux ~]$ boot.py p212
/usr/bin/boot.py:9: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
Using GX Family boot parameters
ROM: 2.2 Stage: 0.0
Writing /usr/lib/python3.13/site-packages/files/p212/u-boot.bin.usb.bl2 at 0xd9000000...
[DONE]
Writing /usr/lib/python3.13/site-packages/files/usbbl2runpara_ddrinit.bin at 0xd900c000...
[DONE]
Running at 0xd9000000...
[DONE]
Waiting...
[DONE]
ROM: 2.2 Stage: 0.0
Writing /usr/lib/python3.13/site-packages/files/p212/u-boot.bin.usb.bl2 at 0xd9000000...
[DONE]
Writing /usr/lib/python3.13/site-packages/files/usbbl2runpara_runfipimg.bin at 0xd900c000...
[DONE]
Writing /usr/lib/python3.13/site-packages/files/p212/u-boot.bin.usb.tpl at 0x200c000...
[DONE]
Running at 0xd9000000...
[DONE]
[x@archlinux ~]$ lsusb
...
Bus 003 Device 003: ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP)
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
...

There's also the deprecation warning, but the main issue is that, after the first "boot,py", this happens if it run it again, after the box is no longer in lsusb:

[x@archlinux ~]$ boot.py p212
/usr/bin/boot.py:9: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
Using GX Family boot parameters
Traceback (most recent call last):
  File "/usr/bin/boot.py", line 143, in <module>
    usb = BootUSB(args.board, fpath, args.upath)
  File "/usr/bin/boot.py", line 45, in __init__
    self.dev = pyamlboot.AmlogicSoC(timeout=args.timeout)
               ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/pyamlboot/pyamlboot.py", line 76, in __init__
    raise ValueError('Device not found')
ValueError: Device not found

Can somebody help? Thank you very much.