The compilation of the entire FreeNOS system can currently be
done as a regular user. FreeNOS supports a few filesystems already, including
for example extended 2. Before the Ext2FileSystem server is able to mount
a ext2 filesystem, it must first be created and filled. FreeNOS now uses
genext2fs(1) to achieve this.
Thus in the case of ext2 we are lucky: we have a command which allows us
to create and fill a filesystem inside a local file under a regular user
account.
However, some filesystems don't have such a command available, for example
XFS, FreeBSD's UFS,
ReiserFS, FAT16/32, etc. This is a problem in case we want to support such
filesystems
in the future.
A better alternative as using an external command to create the filesystems
may be
to add a virtual function create() to the FileSystem class, which will
create an empty
filesystem on any Storage. We then implement a LocalFile class which
inherits Storage, and
uses standard I/O functions. This way, we can create a /sbin/mkfs command
for the target
and more important the host system, which is uses a LocalFile and feeds it
to any
of the chosen FileSystem, invokes create() on it, and creates any file
and/or directories read
from the command-line or standard input in the newly created FileSystem.
Original issue reported on code.google.com by coenbijlsma on 7 Aug 2009 at 11:29
Original issue reported on code.google.com by
coenbijlsma
on 7 Aug 2009 at 11:29