[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

initramfs-tools & nbd



Hi,

I've been looking into writing the necessary code to support doing root
on NBD. After reading initramfs-tools(8), I think I understand that
there will be no networking unless the system is configured for an NFS
root setup.

One way to work around that problem would be to trick initramfs-tools'
'init' script into believing that we're trying to do an NFS mount, only
to change the world from under it at the very last moment and to tell it
that we're actually going to do a somewhat local mount, triggering the
regular "local" block device handling in the process.

Since that sounds incredibly ugly, I think it's probably best if I just
make sure that the configure_networking function from /scripts/functions
is called from my nbd boot script, which should be in local-top.

This is much cleaner, but there are still some minor issues:

- configure_networking needs IPOPTS to be set, which is not exported
  into the environment. Re-parsing the commandline from my boot script
  to make sure IPOPTS is set would obviously work, but that seems
  somewhat brittle. Would it make sense to export this variable from
  /init, so that my boot script can call it if necessary?
- I would need to somehow set the server we're connecting to, and the
  port on which we're trying to connect to that server; it seems to me
  that the best way to do this is to create more commandline variables;
  I suggest "nbdsrv=" for the server, and "nbdport=" for the port.
  Perhaps you might want to add those to your documentation (once the
  support is actually there, that is)
- It would appear that currently, if you want to figure out whether
  something uses a specific block device (or even a block device of
  which the name matches a regular expression) under some layers of lvm
  or other device-mapper trickery, you need to script that on your own.
  Is this true? If not, what function should I be calling? If so,
  wouldn't it be interesting to add such a function?

Comments?

Thanks,

-- 
<Lo-lan-do> Home is where you have to wash the dishes.
  -- #debian-devel, Freenode, 2004-09-22


Reply to: