Port SquashFuse To The FreeBSD Kernel
SquashFS is a read-only file system that lets you compress whole file systems or single directories, write them to other devices/partitions or to ordinary files, and then mount them directly.
When creating tiny-sized and embedded systems, every byte of the storage device (floppy, flash disk, etc.) is very important, so compression is used everywhere possible. Also, compressed file systems are frequently needed for archiving purposes. For huge public archives, as well as for personal media archives, this is essential.
The goal of this project is to add SquashFS support for the FreeBSD kernel, with the aim of being able to boot FreeBSD from an in-memory SquashFS file system.
Approach to solving the problem
Since writing file system driver to the kernel is a large task I will divide the project into various small goals, which include:
- Setting up development and testing environment, implementing test driver which will help to test Squashfs code without mount(8).
- Implementing Mount() hook and publishing root inode of system.
- Adding directories read support.
- Adding files read support.
These goals could again be broken down into small steps like first reading files without compression and then with compression.
This list is not concrete and might change as the project progresses.
Basic SquashFS functionality
- Get squashfs_mount() hook working with the publishing of root inode.
- Add directories read support without compression and with compression.
- Add files read support without compression and with compression.
- Perform file system performance testing.
- Writing documentation for FreeBSD implementation of squashfs.
Extra SquashFS features
- Adding extended attributes(xattrs) read support.
- Adding cache support.
This list is not concrete and could change after a discussion with my mentor.
Week 1 (start of coding): Development and testing environment setup, implementation of a testing driver(for testing basic file system metadata)
- Week 2: Implementation of squashfs_mount() hook with superblock and root inode support.
- Week 3: Adding squashfs to mount(8) and testing for kernel panics, lags etc...
- Week 4: squashfs directories read support.
- Week 5: squashfs files read support.
Week 6 (mid-term evaluations): buffer period.
- Week 7: Perform more testing directly by mounting the squashfs disk image to the FreeBSD kernel.
- Week 8: Implement xattrs read support.
- Week 9: Buffer week.
- Week 10: If everything goes as per plan try to implement caching or complete pending tasks.
- Week 11: Buffer week.
Week 12 (final evaluations): write documentation for code and how users can use squashfs on FreeBSD.
Buffer weeks are allocated to ensure progress is on the right track even if somehow milestones aren't met as per schedule.
Testing for file system performance will be done in two steps :
- Initially compiling file system image directly into the driver and testing if it correctly parses disk, this will help us to initially avoid testing directly from the kernel causing panics, corruption, etc...
- Once the above testing passes we will mount squashfs disk directly to the FreeBSD kernel for performance testing, kernel lags or panics, etc...
Currently, the driver is compatible with the 13.2 FreeBSD release.