bootlin / snagboot

Generic recovery and reflashing tool for embedded platforms
GNU General Public License v2.0
209 stars 26 forks source link

snagrecover: undefined symbol old LTS ubuntu #7

Closed kmaincent closed 1 year ago

kmaincent commented 1 year ago

Distro: Ubuntu 20.04.5 Small error snagrecover. Should we support old Ubuntu LTS releases? Yes, I know I need to update my distro!!

$ snagrecover -h
Traceback (most recent call last):
  File "/home/kmaincent/.local/bin/snagrecover", line 5, in <module>
    from snagrecover.cli import cli
  File "/home/kmaincent/.local/lib/python3.8/site-packages/snagrecover/cli.py", line 24, in <module>
    from snagrecover.recoveries.imx import main as imx_recovery
  File "/home/kmaincent/.local/lib/python3.8/site-packages/snagrecover/recoveries/imx.py", line 50, in <module>
    import hid
  File "/home/kmaincent/.local/lib/python3.8/site-packages/hid/__init__.py", line 83, in <module>
    hidapi.hid_get_input_report.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_size_t]
  File "/usr/lib/python3.8/ctypes/__init__.py", line 386, in __getattr__
    func = self.__getitem__(name)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 391, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/x86_64-linux-gnu/libhidapi-hidraw.so: undefined symbol: hid_get_input_report
rgantois commented 1 year ago

I'll have to look more into that. In the meantime, I've restructured imports so that you don't get this error with stm32mp1 SoCs anymore.

rgantois commented 1 year ago

This issue has been brought up here it seems that hid==1.0.5 uses a symbol which isn't supported in your older version of libhidapi-hidraw0. Downgrading to hid==1.0.4 should apparently fix the issue. I'll add a section to the troubleshooting docs and change the minimum required hid version to 1.0.4.

rgantois commented 1 year ago

This fix seems to work.