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

Installing to NBD



Hi,

A while back, I blogged about success in installing to an NBD device[1].
Unfortunately, that was only partial success; that is, while it works
perfectly well as far as partman is concerned (and therefore also the
base-installer step), beyond that things go a bit wrong:

- /usr/lib/finish-install.d has 50release-dhcp-lease and 95umount.
  Obviously, if /target is mounted over the network somehow (through
  NBD, but we might have support for installing to, say, NFS or iSCSI in
  the future too, which would run into the same problem), umount (and
  anything that wants to access anything under /target, really) is going
  to fail if there's no network anymore. This obviously means that
  whatever is between priority 50 and 95 that wants to access /target is
  going to fail too.
  I would like to fix this by moving release-dhcp-lease to priority 97,
  so it sits between umount and reboot. Any objections to that? If I
  hear none within the next few days, expect a commit to that effect
  near the end of the week (or sooner if I get a go-ahead :).
- Once the installatoin is complete, the installer will attempt to
  install grub to the local hard disk. If we've installed Debian to a
  network target, this is Wrong(TM); we've not touched the local hard
  disk for the rest of the installation, so I believe the boot loader
  shouldn't do so either. Indeed, if you're installing to an NBD device,
  you might not even *have* a local hard disk. So when the user installs
  to a network device, I believe the installer should default to
  nobootloader, rather than grub, lilo, or whatever boot loader is used
  on the architecture we're using; but if the user still wants to
  install a boot loader anyway, that should probably also be possible.
  Can this be done? If so, how do I do that? Also, note that this
  shouldn't be hardcoded; if we're installing to root-on-NBD we don't
  want to touch the local hard disk, but if we're doing, say, root on
  local hard disk but /usr on NBD, then we /do/ want to install the
  bootloader to the local hard disk.
- The nbd-client package has an extensive debconf configuration
  interface. Would it be considered good form to programmatically
  preseed the answers to that debconf interface from partman-nbd, or
  should I find another way?
- Finally, in order for root-on-NBD to work properly, the kernel needs
  to specify an extra boot parameter that tells the nbd initramfs script
  where the server is. I couldn't find any interface to specify random
  extra kernel parameters for the installed system; did I miss
  something?

At any rate, if I ignore the hang due to the network going down
prematuraly, manually make sure the initrd is copied to my tftp server,
and make sure to enter the correct values in the nbd-client debconf
interface, the system will correctly boot off NBD to a login prompt, so
I guess I'm almost there :-)

For those who want to try, I've put an installer image for
2.6.39-2-amd64 up on <http://people.debian.org/~wouter/d-i/initrd.gz>[2].
Note that this is still slightly broken in that it doesn't run
'apt-install nbd-client' yet, but I'm working on that.

Regards,

[1] http://grep.be/blog/en/computer/debian/d-i/nbd
[2] If you want to try on a different architecture, you'll need to do
    the following:
    - get <http://people.debian.org/~wouter/d-i/partman-nbd_0.1_all.udeb>
      and put it in localudebs

    - Add

    Package: nbd-modules
    Depends: kernel-image

      to .../packages/linux-kernel-di-<arch>-2.6/package-list

    - Create a file
      .../packages/linux-kernel.../modules/<flavour>/nbd-modules with as
      contents

    #include <nbd-modules>

    - build the l-k-di package, and put nbd-modules-<version> in localudebs,
      too.

    - add partman-nbd to .../installer/build/pkg-lists/monolithic/<arch>.cfg
    
    Then, build the monolithic flavour as usual.

-- 
The volume of a pizza of thickness a and radius z can be described by
the following formula:

pi zz a

Attachment: signature.asc
Description: Digital signature


Reply to: