Jeff Dike wrote:
> Right idea, wrong implementation. Al Viro would shoot me if I tried to get
> that in.
> As far as I'm concerned, the right way would be to do the following:
> register a "root_hostfs" filesystem with a read_super that recognizes a
> superblock that says "hostfs"
> change the ubd driver to have it produce that fake superblock, by having it
> recognize that the file it was given is a directory (i.e.
> ubd0=/path/to/hostfs/root), and putting something like
> "HOSTFS:/path/to/hostfs/root" in the buffers passed in to contain the
> the hostfs_root_read_super proc recognizes the "HOSTFS:/path/to/hostfs/root",
> extracts the directory and does the same thing as the current read_super with
> it, and says "I own this fs"
> Nice, simple, clean, and it won't get me yelled at by Al Viro.
I did first look into doing something like that, but fail to find any viable approaches
without having to rewrite bost of the root initialization code. The whole root
initialization block uses "block device numbers", not paths, and is why NFS (and here
hostfs) is dealt with separately. Sure, it would be wonderful if a good generic
mechanism how to deal with root-filesystems without block devices could be found, but
I am not sure if it is within the scope of uml...
Registering a "root_hostfs" filesystem does NOT look like a good approach. This is
initialization code, not permanent code, and having a registered filesystem as
initialization code feels both messy and dangerous..