Skip to contentSkip to conversation

gzipped executables

DISCUSSION [email protected] 5 participants 5 messages Feb 13, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 11 lines · On Mon, 12 Feb 2001 23:09:39 -0600 (CST) Matt Stegman <[email protected]> wrote:

Is there any kernel patch that would allow Linux to properly recognize, and execute gzipped executables?

I know I could use binfmt_misc to run a wrapper script:

decompress to /tmp/prog.decompressed
execute /tmp/prog.decompressed
rm /tmp/prog.decompressed

But that's not as clean, secure, or fast as the kernel transparently decompressing & executing. Is there a better way to do this?

Perhaps you could put it in the filesystem. Look at the "chattr" manpage, which shows how this is meant to work with ext2. It seems not to have been implemented yet. This way you could also compress any files, not just executables.

Ketil

Signature · 1 line
Get your firstname@lastname email for FREE at http://Nameplanet.com/?su
#1 lore raw
Quoted 8 lines · On Tue, Feb 13, 2001 at 08:40:31AM -0000, [email protected] wrote:
Quoted 2 lines · On Mon, 12 Feb 2001 23:09:39 -0600 (CST) Matt Stegman <[email protected]> wrote:

Is there any kernel patch that would allow Linux to properly recognize, and execute gzipped executables?

Perhaps you could put it in the filesystem. Look at the "chattr" manpage, which shows how this is meant to work with ext2. It seems not to have been implemented yet. This way you could also compress any files, not just executables.

A nice way already implemented in 2.4.x is cramfs. Many embedded people (like me) use it to fill up their flash disks.

Look at linux/Documentation/filesystems/cramfs.txt for more info.

Regards

Ingo Oeser

Signature · 2 lines
10.+11.03.2001 - 3. Chemnitzer LinuxTag <http://www.tu-chemnitz.de/linux/tag>
         <<<<<<<<<<<<       come and join the fun       >>>>>>>>>>>>
#2 lore raw

Hello,

Anything in 2.4 isn't an option right now. I'm using, and am really happy with, the ext3 journalling patch. I'm not planning on a 2.4 upgrade until ext3 has been ported. Damn shame I don't have the skill to do that myself...

ext2 compression would be great. First off, though, I'm already using the ext3 patch. Would ext2 compression be compatible, and take effect for ext3 (ext3 support is a separate option in the kernel from ext2)? Also, I can't even get to the ext2 compression page
http://e2compr.memalpha.cx/e2compr/.

UPX looks interesting; I'll have to check it out in depth. Thanks, all!

-Matt

#3 lore raw
Quoted 13 lines · Matt Stegman

Hello,

Anything in 2.4 isn't an option right now. I'm using, and am really happy with, the ext3 journalling patch. I'm not planning on a 2.4 upgrade until ext3 has been ported. Damn shame I don't have the skill to do that myself...

ext2 compression would be great. First off, though, I'm already using the ext3 patch. Would ext2 compression be compatible, and take effect for ext3 (ext3 support is a separate option in the kernel from ext2)? Also, I can't even get to the ext2 compression page
http://e2compr.memalpha.cx/e2compr/.

Quoted 3 lines

UPX looks interesting; I'll have to check it out in depth. Thanks, all!

-Matt

If you're really adventurous, I've once done a patch for uClinux to enable a compressed (gzip) executable format (not ELF, way lighter). It should be at http://aplionet.aplio.fr/uclinux (the kernel loader is linux/fs/binfmt_flat.c, the tools to generate the execs are in tools/elf2flt)

Xav

#4 lore raw
In reply to [email protected]

You might consider UPX (http://upx.tsx.org)
Very cool. The beta version supports compressing the kernel and "direct-to-memory" compression. I think it still has the disadvantage of not sharing segments between many instances of the same program. Is there any way of fixing this? (probably would have to hack a bit with the loader?)

For a general solution I would look @ changing the filesystem so that particular files (not just executables) can be compressed/ decompressed transparently. (I.E. for ext2 implement chattr +c).

Padraig.

Quoted 21 lines · Ingo Oeser
Quoted 9 lines · On Tue, Feb 13, 2001 at 08:40:31AM -0000, [email protected] wrote:
Quoted 2 lines · On Mon, 12 Feb 2001 23:09:39 -0600 (CST) Matt Stegman <[email protected]> wrote:

Is there any kernel patch that would allow Linux to properly recognize, and execute gzipped executables?

Perhaps you could put it in the filesystem. Look at the "chattr" manpage, which shows how this is meant to work with ext2. It seems not to have been implemented yet. This way you could also compress any files, not just executables.

A nice way already implemented in 2.4.x is cramfs. Many embedded people (like me) use it to fill up their flash disks.

Look at linux/Documentation/filesystems/cramfs.txt for more info.

Regards

Ingo Oeser