AppImage / AppImage/AppImageKit

Submit AppImage to file/libmagic

Aperta
#727 4 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
Nessun dato sulla lingua
Stelle
9.4k
Fork
588
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

Every developer and/or Linux user knows the command `file`, which can be used to display file types of arbitrary files.

At the moment, AppImages are recognized as ELF executables:

```
...AppImage: ELF 64-bit LSB executable, x86-64, version 1, dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, stripped
```

I experimented a bit, and with the following definition (incomplete type 1), I can get a result like:

```sh
# contents of file "appimage"
8 string AI\01 AppImage (type 1)
8 string AI\02 AppImage (type 2)
```

```sh
# compile definition file "appimage" to "appimage.mgc"
> file -C -m appimage
# now use it for type 1 AppImage
> file -z -m appimage.mgc ...AppImage
...AppImage: AppImage (type 1), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.18, BuildID[sha1]=[...], stripped
# type 2 AppImage
> file -z -m appimage.mgc ...AppImage
...AppImage: AppImage (type 2), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, stripped
```

Many tools use libmagic instead of the shared MIME database (`/usr/share/mime`, package `shared-mime-info`), and therefore don't recognize AppImages. We should submit the AppImage specification as a definition to the maintainers of `file`/libmagic.

See http://openpreservation.org/blog/2012/08/09/magic-editing-and-creation-primer/ on how to submit definitions.

Information missing in the example definition:

- the corresponding MIME types (so that libmagic can provide a MIME type when asked, e.g., through `file -i `)
- type 1 AppImages don't necessarily need to embed the magic bytes, i.e., any file that is an ISO9660 image _and_ an executable needs to be recognized as an AppImage

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.