[PC-BSD Dev] Squashfs for LiveCDs

Dave Vasilevsky dave at vasilevsky.ca
Wed Jun 27 13:33:49 PDT 2012


Hi there,

I recently wrote squashfuse[1], a port of Linux's squashfs[2]
compressed filesystem to FUSE.

It could be useful for PC-BSD liveCDs, since it compresses better and
faster than ulzma. When I take the .uzip file inside
PCBSD9.0-x64-DVD-live.iso and recompress with ulzma and squashfs,
squashfs saves about 300 MB over ulzma, a 21% savings. I can go into
other advantages/disadvantages in more detail if anyone is interested.

Based on the above ISO, I tried building a squashfuse version, a short
outline of how I did it is below[3]. When I tested in VMware, it
booted, mounted the squashfs image, and command-line programs ran just
fine. However, X failed to start, with the error:

   vm_fault: "pager read error, pid 1814 (Xorg)"

Adding RAM to the VM, as suggested in IRC, didn't seem to help at all.
Any ideas what could be going wrong?


Bonus! While testing this out, I created a couple of utilities you might like:

* fuse-uzip: Makes what's inside a uzip or ulzma image accessible to
any OS that has FUSE, not just FreeBSD. You'll still need a driver for
the filesystem, of course.[4]

* uzip2ulzma: Converts a uzip image directory to ulzma, without
needing to attach it with mdconfig first. Multi-threaded, for fast
parallel compression.[5]

Cheers,
Dave Vasilevsky



[1] https://github.com/vasi/squashfuse
[2] http://squashfs.sourceforge.net/

[3] Building a squashfs ISO:

* Build the FUSE kernel module using the patch here:
http://people.freebsd.org/~gnn/ . (The version in ports is no good,
it's missing mmap support.) Place fuse.ko in the CD's /boot/kernel/.

* Build squashfuse, making sure to statically link to most libraries.
Place the executable in the mfsroot.

* Create a squashfs image: Install the squashfs-tools port, mount
PCBSD.ufs.uzip, run 'mksquashfs /mnt/point PCBSD.squashfs -comp xz -b
1m'. Replace the .uzip file with the .squashfs one on the CD.

* Modify SetupLive.sh in the mfsroot so it uses squashfs instead of uzip.

[4] https://github.com/vasi/fuse-uzip
[5] https://github.com/vasi/uzip2ulzma


More information about the Dev mailing list