AsahiLinux / asahi-installer

Asahi Linux installer
MIT License
824 stars 113 forks source link

Feature request: Use pyliblzfse #132

Closed cy8aer closed 2 years ago

cy8aer commented 2 years ago

Would it be possible to use pyliblzfse instead of self implementing the lzfse library bindings in asahi_firmware/img4.py?

https://github.com/ydkhatri/pyliblzfse

This library can be installed via pip3 and is available for macOS and linux. Then it is also possible to decompress the firmware from linux without any further compiling for the end user (library is provided with the pip image)

marcan commented 2 years ago

pyliblzfse just embeds lzfse, so the question is whether it is packaged by any distributions over plain lzfse. If it is, it might be worth using. If it isn't, there's not much point.

On macOS we will use neither; I intend to have an alternate ctypes binding for the native libraries that are already there. This isn't done yet (which is why this isn't tagged as a release yet).

cy8aer commented 2 years ago

I just check up what to docuument in https://g3la.de/hedgedoc/buDIXGBuRzKMwUnYOpStuw?view#Bluetooth (firmware update recipe). And I understood that the lsze lib is used for some firmware decompression. I will wait until version tagging and decide what to document then.

Nevertheless: I also checked up:

and did not find a *lsze* package in the actual stable versions.

marcan commented 2 years ago

I think there isn't much point then, we might as well ask people to package liblzfse and just keep using ctypes.

marcan commented 2 years ago

Closing since we're good with ctypes on both macOS and Linux. If you have a good use case to support both the ctypes approach and pyliblzfse (e.g. a distro that has the latter in repos and has a current or upcoming port to the platform), feel free to submit a PR to add it :)