|
& |
|
Mentor : Antti Kantee
Student : Arnaud Ysmal
The aim of this project is to write a set of utilities to access and modify a file system image without having to mount it (you do not have to be root, you just need read/write access to the image).
It relies on the ukfs library, so as to use the file systems source code from the kernel instead of duplicating it. By doing so, it benefits from the widely tested sources from the kernel. As mentioned by Antti Kantee, the kernel sources can also benefit from the testing and slightly different usage patterns provided by this project.
These programs have been, of course, released under the 2-clause BSD license.
A tarball of the latest cvs version is available here (20080925).
The last tarball of this project as a GSoC project here (20080818)
You can untar it wherever you want.
It requires a userland build from the source from August 2nd (20080802) or newer.
It needs at least read access to the image. There is no need to add specific options in the kernel.
I blog at blog.stacktic.org.
| Program | Options |
|---|---|
| cat | b, e, n, s, t, v |
| chflags | h, R, v |
| chmod | h, R, v |
| chown | h, R, v |
| cp | P, R, v |
| diff | (equivalent to diff -q) |
| ln | f, h, i, n, s, v |
| ls | A, a, c, F, l, n, p, R, r, S, T, t, u |
| mkdir | p |
| mkfifo | m |
| mknod | F, g, R, r, m, u |
| mv | i, v |
| rm | R, r, v |
| rmdir | p |
| touch | - |
Mandatory (must-have) components:
To use the programs, we need a file system image. For this example, we create a 100MB FFS image which contains all files and directory from /usr/src/sys/rump :
$ dd if=/dev/zero of=~/rump_ffs.img bs=1m count=100 $ newfs -F ~/rump_ffs.img
$ cd /usr/src/sys/rump && make $ su # make install $ cd /usr/src/lib/libukfs && make $ su # make install
$ cd ~/fs-utils/src/ && makeMost of the programs work like the classic one with a additional argument: the path to the image.
$ fsu_ls/fsu_ls ~/rump_ffs.img -l drwxr-xr-x 2 stacktic wsrc 512 Jul 2 12:57 CVS -rw-r--r-- 1 stacktic wsrc 112 Aug 6 2007 Makefile -rw-r--r-- 1 stacktic wsrc 527 May 31 21:28 Makefile.rump -rw-r--r-- 1 stacktic wsrc 1034 Aug 16 2007 README.dirs -rw-r--r-- 1 stacktic wsrc 453 Sep 10 2007 TODO drwxr-xr-x 5 stacktic wsrc 512 Jul 2 12:54 fs drwxr-xr-x 4 stacktic wsrc 512 Jul 2 12:54 include drwxr-xr-x 5 stacktic wsrc 512 Jul 2 13:21 librump $ fsu_ls/fsu_ls ~/rump_ffs.img -lS fs/lib/libukfs fs/lib/libukfs: -rw-r--r-- 1 stacktic wsrc 10614 Jul 4 19:24 ukfs.c -rw-r--r-- 1 stacktic wsrc 3991 Jul 4 19:24 ukfs.h drwxr-xr-x 2 stacktic wsrc 512 Jul 2 12:54 CVS -rw-r--r-- 1 stacktic wsrc 275 Sep 2 2007 Makefile lrwxr-xr-x 1 stacktic wsrc 32 Jul 2 13:21 obj -> /usr/obj/sys/rump/fs/lib/libukfs $ fsu_cp/fsu_cp ~/rump_ffs.img -v Makefile Makefile2 Makefile -> Makefile2 $ fsu_ls/fsu_ls ~/rump_ffs.img -l Makefile2 -rw-r--r-- 1 stacktic wsrc 112 Jul 5 12:01 Makefile2 $ fsu_rm/fsu_rm ~/rump_ffs.img Makefile2 $ fsu_ls/fsu_ls ~/rump_ffs.img -l Makefile2 fsu_ls: Makefile2: No such file or directory $ fsu_chown/fsu_chown ~/rump_ffs.img root:wheel TODO $ fsu_ls/fsu_ls ~/rump_ffs.img -l TODO -rw-r--r-- 1 root wheel 453 Sep 10 2007 TODO $ fsu_chmod/fsu_chmod ~/rump_ffs.img -Rvh 664 / / /CVS /CVS/Root /CVS/Repository ... $ fsu_ls/fsu_ls ~/rump_ffs.img -l drw-rw-r-- 2 stacktic wsrc 512 Jul 2 12:57 CVS -rw-rw-r-- 1 stacktic wsrc 112 Aug 6 2007 Makefile -rw-rw-r-- 1 stacktic wsrc 527 May 31 21:28 Makefile.rump -rw-rw-r-- 1 stacktic wsrc 1034 Aug 16 2007 README.dirs -rw-rw-r-- 1 root wheel 453 Sep 10 2007 TODO drw-rw-r-- 5 stacktic wsrc 512 Jul 2 12:54 fs drw-rw-r-- 4 stacktic wsrc 512 Jul 2 12:54 include drw-rw-r-- 5 stacktic wsrc 512 Jul 2 13:21 librump
Manpages:
These tools rely on the ukfs library which uses RUMPs (Runnable Userspace Meta Programs).
|
|
|