Re: [RFC PATCH] Move actually mounting the root filesystem into its own series of hooks.

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

 



On Mon, 2009-02-23 at 15:07 -0500, Warren Togami wrote:
> Hi Victor,
> 
> I didn't test this patch yet, but I need this kind of structure in order 
> to implement different kinds of netboot.

I fugured it would be needed, and I certainly don't want to bloat up the
main init script with code that will not be needed on most systems. :) 

> root=dhcp is a kernel cmdline given by the bootloader (syslinux, grub, 
> pxelinux, etc.) which directs the initrd during runtime to bring up eth0 
> and do DHCP.  It then mounts the rootfs depending on options given by 
> the DHCP server.  Fedora 10 mkinitrd implements the following two types 
> of mounts with root=dhcp.
> 
>          option root-path "172.31.100.254:/path/to/target_root";
>          option root-path "nbd:172.31.100.254:2000:squashfs:ro";

Interesting -- I have been working on implementing code to detect and
configure network interfaces according to the netboot.txt kernel
document. The code I have written so far is browseable at
http://git.fnordovax.org/dracut/log/?h=network-configurability
(and it even works some of the time), and I would appreciate input from
someone who actually uses that functionality on a daily basis.
  
> An existing RFC specifies syntax for iscsi that could be implemented as 
> well.  (Although iscsi is problematic because some types require 
> authentication.)  

Yeah, I was thinking of what sort of structure would be needed to let
someone else write code to handle multipath iscsi over teamed nics
without having to patch the main init script.

> Arbitrary types of root=dhcp rootfs mounts can be 
> implemented with hooks made possible with your patch.
> 
> Generation
> ==========
> ∘ read mode from dracut.conf i.e. MODE=network
> ∘ if network
> 	‣ install network modules
> 	‣ install tools (mount.nfs, nbd, etc.)
> 	‣ install squashfs.ko
> 	‣ install custom udev rules to handle network

Not a problem -- I have not gotten to the nfs stuff yet, but the above
branch already works well enough let udev bring network interfaces up
according to what is passed on the kernel command line (assuming I did
not break it again, and assuming you are using dhcp or statically
configuring your interfaces -- I have no plans for adding bootp or rarp
support, but patches to do so are happily accepted).

> Boot (contents of udev rule)
> ============================
> ∘ if root=dhcp (or later hard coded network)
> 	‣ ifup eth0
> 	‣ dhclient

The above branch already knows how to do this stuff. 

> 	‣ parse root-path

Probably cannot do this in udev, but easily doable from a mount hook.

> 	‣ if nbd
> 		• modprobe nbd
> 		• nbd-client with parameters
> 		• (mount rootfs)
> 	‣ if nfs
> 		• (mount rootfs)


I was planning to handle nfsroot in a mount hook as well, extending it
to handle nbd should not be a problem.


> Warren Togami
> wtogami@xxxxxxxxxx
> --
> To unsubscribe from this list: send the line "unsubscribe initramfs" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
Victor Lowther
RHCE# 805008539634727
LPIC-2# LPI000140019

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux