Help - Search - Members - Calendar
Full Version: Tcc Base + Include Cramfs (squashfs?)
OESF Forums > Distros, Development, and Model Specific Forums > Distro Support and Discussion > pdaXrom
ScottYelich
Hi --

Anyone have a link on how to do cramfs and/or squashfs (for pdaXrom)?

Which is beter, cramfs or squashfs? sq looks like it might be better
compression -- but does this come at the price of compatibility and cpu
speed?

I'd like to make a cramfs, say, 300 mb, but if I only put 20 MB in it -- will
it only be the compression size of that 20mb (should be 95-98% for
the text that I want...) plus some cramfs overhead?

I want to put all the .h files into a cramfs so this can be mounted and added to...
and then use tcc to run simple c programs -- including gtk c progs, etc.

Scott
rgrep
QUOTE(ScottYelich @ Jan 1 2005, 09:26 AM)
Hi --

Anyone have a link on how to do cramfs and/or squashfs (for pdaXrom)?

Which is beter, cramfs or squashfs?  sq looks like it might be better
compression -- but does this come at the price of compatibility and cpu
speed?

I'd like to make a cramfs, say, 300 mb, but if I only put 20 MB in it -- will
it only be the compression size of that 20mb (should be 95-98% for
the text that I want...) plus some cramfs overhead?

I want to put all the .h files into a cramfs so this can be mounted and added to...
and then use tcc to run simple c programs -- including gtk c progs, etc.

Scott

squashfs was created by Phillip Lougher to be better than cramfs. It has the advantage that metadata is compressed, the file compression block size is larger, full uid/gid and file creation times are stored, and it supports files up to 4GB (the maximum size of a squashfs filesystem is also 4GB). My biggest gripe about cramfs is that it only supports files up to 16MB although the filesystem can be up to ~256MB (this has stopped me being able to create a cramfs image of the BASS Talkie for ScummVM mad.gif).

Unfortunately squashfs isn't supported by the pdaXrom kernel, although someone should be able to compile the module pretty easily. So for now you're stuck with cramfs. You can create a cramfs filesystem very easily (note that cramfs and squashfs filesystems are read-only so you can only build them once). The mkcramfs command takes a directory containing your files and creates a file that holds the cramfs filesystem. For example if you want to package up all the files and directories in /opt/tcc into a file called tcc.cramfs you would run the following:
CODE
mkcramfs /opt/tcc tcc.cramfs

You could then mount this filesystem on your Zaurus using the following:
CODE
mkdir /opt/tcc
mount -t cramfs /mnt/card/tcc.cramfs /opt/tcc -o loop,ro

Hopefully we'll get squashfs support shortly.

Matt
rgrep
I tried to compile the squashfs module but unfortunately the patch (for 2.4.20) doesn't work on the pdaXrom kernel (2.4.18) due to a missing do_mounts.c file. Hopefully I can either fix the patch (unlikely) or find one that works.

However in searching for squashfs info I came across a different compressed filesystem that is already supported by pdaXrom. It's called zisofs and is basically a compressed layer on top of an ISO9660 (CD-ROM) filesystem. Support for it under pdaXrom is included in the isofs module ("ipkg install kernel-modules-isofs"). Its performance (compression and speed) isn't as good as squashfs but the filesystem can be read by legacy systems that don't have kernel support for zisofs (a userland tool is just required to read the compressed files). Phillip Lougher from the squashfs project has done some benchmark comparisons of squashfs, cramfs, cloop and zisofs: http://kerneltrap.org/files/PERFORMANCE.README.txt

To make a zisofs image you need mkzftree from zisofs-tools (if you use Debian it's included in the mkisofs package) and a zisofs-patched version of mkisofs (also included in the Debian mkisofs package). mkzftree takes an input file tree and creates a corresponding compressed file tree ready for mkisofs to build the ISO image. For example to build a zisofs image of Sam & Max Hit the Road for ScummVM I did the following:
CODE
mkzftree samnmax-talkie samnmax-talkie.zftree
mkisofs -z -r -o samnmax-talkie.ziso samnmax.zftree

To mount it on my Zaurus I just type:
CODE
mount -t iso9660 /mnt/card/samnmax-talkie.ziso /opt/scummvm/samnmax-talkie -o loop,ro

The compression was pretty good in this case, bringing samnmax down from 190MB to 113MB. For Beneath a Steal Sky it only saved me 3MB but I find it more convenient to have the games in single files I mount automatically before running ScummVM.

I am still hanging out for squashfs support but this suits me fine for now.

Matt
ScottYelich
ya
squash looks like the way to go.

ziso was at least 2x slower, etc.

:-/

Scott
iamasmith
QUOTE(rgrep @ Jan 2 2005, 09:24 AM)
I tried to compile the squashfs module but unfortunately the patch (for 2.4.20) doesn't work on the pdaXrom kernel (2.4.18) due to a missing do_mounts.c file. Hopefully I can either fix the patch (unlikely) or find one that works.

rgrep,

I patched this to the 2.4.18 kernel for the Cacko/Sharp ROM some time ago.

Just tried it with the 2.1r2 patch set and it works fine.

Steps. (backup the source tree first just in case !)

i. Apply the patch with -p1, hit return when the prompt about do_mounts.c is shown. - You don't need this (more later).
ii. Go to linux/fs and you will have a Makefile.rej containing the offending DIFF that didn't apply. Basically just adds the line...

subdir-$(CONFIG_SQUASHFS) + = squashfs

So edit the Makefile, find an appropriate spot and add the line manually.

iii. Create your .config file or edit an existing one and add CONFIG_SQUASHFS=m

iv. Run make oldconfig, make dep & make modules.

You should find squashfs.o in the linux/fs/squashfs directory.

v. Put the file in the /lib/modules/`uname -r`/fs directory on your Z (create the directory first).

vi. Run depmod and away you go.

mount file systems with...

mount -t squashfs <squash file> <mount point> -o loop

...Now all this works fine for Cacko/Sharp so I think this should work for PDAXROM but I don't have a build environment for the Kernel set up to try it.

do_mounts.c is part of the init code and as far as I can tell the patch is mainly aimed at adding some structures to init so that the file system can be used for initrd (load from a file then RAM drive specific stuff). You shouldn't need it for normal utility type use.

Let me know how you get on.

- Andy
iamasmith
Actually just tried the squashfs module on Kathrin RC8, seems to work a treat.

Will post it when it's had some testing.
ScottYelich
Hmmmm. this is interesting.
maslovsky
QUOTE(iamasmith @ Jan 4 2005, 04:16 PM)
Steps. (backup the source tree first just in case !)
...

There is an easier way to do this - use my patch, whch I created specificaly for 2.4.18 Zaurus kernel based on 2.4.20 squashfs patch (which doesn't apply cleanly).

You can download the whole set of patches used in Cacko 1.22 kernel at Cacko home page or here: http://web.mol.ru/~zaurus/cacko-1.22-kernel.tar.gz
iamasmith
Actually I have already built the module and the mksquashfs tool.

They are on the unstable feed. Anton's patch would be good though if this is going to move to the stable base.

- Andy
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.