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

Re: [Xen-devel] What is the implication to use 'module'directive instead of 'initrd' to load ramdis



On Thu, 2007-01-11 at 08:49 +0000, Jan Beulich wrote:
> >I used SINGLE module to load kernel and SINGLE intird to load ramdisk in 
> >grub.conf file.
> >
> >title Xen Unstable /Red Hat Enterprise Linux 2.6.16.33
> > kernel /xen.gz console=vga
> > module /vmlinuz-2.6-xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet 
> >console=tty0
> > initrd /initrd-2.6.16.33-xen.img
> >
> >Based on what you explained, this should be fine. However, Xen Linux still 
> >got a panic message: Linux kernel must be loaded before ramdisk.
> 
> No, it's not. I said that initrd and module are equivalents, except that 
> initrd
> can be specified just once. Hence, if there already was a module
> statement (being equivalent to initrd), there can't be a second initrd.

If your kernel uses the multiboot protocol (which Xen does) then initrd
is invalid, at least by my reading of the grub code, so you must use
module. From stage2/builtins.c:

        static int
        initrd_func (char *arg, int flags)
        {
          switch (kernel_type)
            {
            case KERNEL_TYPE_LINUX:
            case KERNEL_TYPE_BIG_LINUX:
              if (! load_initrd (arg))
                return 1;
              break;
        
            default:
              errnum = ERR_NEED_LX_KERNEL;
              return 1;
            }
        
          return 0;
        }
        
compared with module_func:

        static int
        module_func (char *arg, int flags)
        {
          int len = grub_strlen (arg);
        
          switch (kernel_type)
            {
            case KERNEL_TYPE_MULTIBOOT:
              if (mb_cmdline + len + 1 > (char *) MB_CMDLINE_BUF + 
MB_CMDLINE_BUFLEN)
                {
                  errnum = ERR_WONT_FIT;
                  return 1;
                }
              grub_memmove (mb_cmdline, arg, len + 1);
              if (! load_module (arg, mb_cmdline))
                return 1;
              mb_cmdline += len + 1;
              break;
        
            case KERNEL_TYPE_LINUX:
            case KERNEL_TYPE_BIG_LINUX:
              if (! load_initrd (arg))
                return 1;
              break;
        
            default:
              errnum = ERR_NEED_MB_KERNEL;
              return 1;
            }
        
          return 0;
        }

If your kernel is using the Linux kernel boot protocol then Jan is
correct that module and initrd are interchangeable and only one may be
used (in fact it looks to me as if simply the last one takes
precedence).


Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.