AppImage / AppImage/AppImageKit

Submit AppImage to file/libmagic

Open
#727 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
No language data
Stars
9.4k
Forks
588
PR merge metrics
PR metrics pending

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.