Bug 264941 - Ark should support squashfs to support Snap and AppImage-Type2 packages
Summary: Ark should support squashfs to support Snap and AppImage-Type2 packages
Status: CONFIRMED
Alias: None
Product: ark
Classification: Applications
Component: plugins (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: Ragnar Thomsen
URL:
Keywords:
: 413531 (view as bug list)
Depends on:
Blocks: 388612 413531
  Show dependency treegraph
 
Reported: 2011-01-31 12:41 UTC by dE
Modified: 2023-11-05 11:17 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dE 2011-01-31 12:41:15 UTC
Version:           unspecified (using KDE 4.4.5) 
OS:                Linux

Compression of the given rootfs using squashfs and extraction using unsquashfs with various options.

Reproducible: Didn't try
Comment 1 Raphael Kubo da Costa 2011-01-31 18:10:51 UTC
Can you attach a sample file, or link to instructions on how to build/extract them?
Comment 2 dE 2011-02-01 04:23:08 UTC
See man page of mksquashfs and unsquashfs from squashfs-tools package -- 

http://www.digipedia.pl/man/doc/view/mksquashfs.8/

http://www.digipedia.pl/man/doc/view/unsquashfs.8/

optionally ark should ask the root passwd (using kdesu or kdesudo) to see all the contents for that particular rootfs. After compression, it should change the ownership of the image to the user ark is currently running as.

Warning -- This program has a strange obsession with the squashfs-root directory, this is the email I wrote to the author - 

"
...
However there's a major problem, the executables have a strange obsession with the squashfs-root directory. Whenever you -

mksquashfs <directory>

In the image made, the first thing will be the squashfs-root directory, there's no way you can change that... you can't change it's name or have the OS tree put in the archive directly.

This results in major consequences when unsquashing the FS to a folder which has a tree with mounted block devices. For e.g, if I wanna extract the contents to /mnt/debian which has the directory /home and /mnt mounted.
Comment 3 Raphael Kubo da Costa 2011-02-06 05:34:02 UTC
At first, I'm more comfortable with adding read-only support for squashfs images to Ark (in the case we do add support for it, as I'm still not 100% convinced it is a valid use case for Ark), just like we do for ISO images -- there are too many important options for mksquashfs, and if someone is really creating a filesystem image with it, it can be safely assumed that the person is skilled at using a terminal.

There's one problem, though, in that there is no mimetype for squashfs images, so it is not easy to associate Ark to these files and make it open them.

Last but not least, I didn't understand this section you've written:

> optionally ark should ask the root passwd (using kdesu or kdesudo)
> to see all the contents for that particular rootfs.

Can you explain this further?
Comment 4 dE 2011-02-07 02:05:08 UTC
(In reply to comment #3)
> At first, I'm more comfortable with adding read-only support for squashfs
> images to Ark (in the case we do add support for it, as I'm still not 100%
> convinced it is a valid use case for Ark), just like we do for ISO images --
> there are too many important options for mksquashfs, and if someone is really
> creating a filesystem image with it, it can be safely assumed that the person
> is skilled at using a terminal.
> 
> There's one problem, though, in that there is no mimetype for squashfs images,
> so it is not easy to associate Ark to these files and make it open them.
> 
> Last but not least, I didn't understand this section you've written:
> 
Yup, that is true.

But I was wondering if it could help us get around the squashfs-root directory, anyway, we have a work around for that.

> > optionally ark should ask the root passwd (using kdesu or kdesudo)
> > to see all the contents for that particular rootfs.
> 
> Can you explain this further?

Many contents in the squashfs image are owned by root or often have o-rwx permission. Asking for password is necessary for certain files cause of the permission.
Comment 5 dE 2011-12-08 08:58:57 UTC
Another thing that came to my mind when I was filing a bug for a new mime type was that, compared to conventional archives, squashfs has some major advantage - 

1) Multithreaded compression using xz -- something which no other program does.
2) It's a mountable FS (using loop).

Thus ark may have a feature to mount the squashfs image somewhere.

This makes it a tempting FS not only for compressing OSs, but also general data.
Comment 6 probono 2018-08-28 19:59:40 UTC
application/vnd.squashfs has since been registered as the MIME type for squashfs files.
Comment 7 probono 2018-12-27 21:53:57 UTC
Now that there is a MIME type for squashfs files, what is holding this back?

As for type-2 AppImages, these are squashfs files appended to ELF files. So one needs to parse the ELF header to find out how long the ELF is, and open the squashfs with the corresponding offset. Let me know if you need more information on this.

Type-2 AppImage spec:
https://github.com/AppImage/AppImageSpec/blob/master/draft.md#type-2-image-format

Code:
https://github.com/AppImage/libappimage/blob/5d032421aef066e6e1c05b30a8006f0c84a02b71/src/libappimage_shared/elf.c#L120
Comment 8 Elvis Angelaccio 2018-12-30 18:39:32 UTC
(In reply to probono from comment #7)
> Now that there is a MIME type for squashfs files, what is holding this back?

squashfs support in libarchive. I see you already filed https://github.com/libarchive/libarchive/issues/792 a long time ago, so we probably already discussed this elsewhere (can't remember now).
Comment 9 Nate Graham 2019-11-04 18:19:20 UTC
*** Bug 413531 has been marked as a duplicate of this bug. ***
Comment 10 2wxsy58236r3 2020-09-02 06:06:14 UTC
p7zip seems have limited support for squashfs, but when listing the contents of the following test file (7z l -slt houdini_z.sfs), p7zip warns that "There are data after the end of archive".

Test file: https://github.com/redchenjs/aur-packages/raw/master/anbox-image/houdini_z.sfs