File:  [NetBSD Developer Wiki] / wikisrc / ports / xen / howto-grub.mdwn
Revision 1.2: download - view: text, annotated - select for diffs
Wed Dec 24 01:05:19 2014 UTC (5 years, 3 months ago) by gdt
Branches: MAIN
CVS tags: HEAD
park more grub text

    1: Stray Grub notes
    2: ================
    3: 
    4: Now, the use of NetBSD's normal boot code is recommended.  This file
    5: exists to save stray text about grub.  Note that it is far far easier
    6: to use the native boot code, and that you probably should not be
    7: reading this.
    8: 
    9: Install
   10: -------
   11: 
   12: If you plan to use the `grub` boot loader, when partitioning the disk
   13: you have to make the root partition smaller than 512Mb, and formatted
   14: as FFSv1 with 8k block/1k fragments. If the partition is larger than
   15: this, uses FFSv2 or has different block/fragment sizes, grub may fail
   16: to load some files.
   17: 
   18: You'll also need `sysutils/grub` from pkgsrc.
   19: 
   20: Grub config
   21: -----------
   22: 
   23: 
   24:     #Grub config file for NetBSD/xen. Copy as /grub/menu.lst and run
   25:     # grub-install /dev/rwd0d (assuming your boot device is wd0).
   26:     #
   27:     # The default entry to load will be the first one
   28:     default=0
   29: 
   30:     # boot the default entry after 10s if the user didn't hit keyboard
   31:     timeout=10
   32: 
   33:     # Configure serial port to use as console. Ignore if you'll use VGA only
   34:     serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
   35: 
   36:     # Let the user select which console to use (serial or VGA), default
   37:     # to serial after 10s
   38:     terminal --timeout=10 serial console
   39: 
   40:     # An entry for NetBSD/xen, using /netbsd as the domain0 kernel, and serial
   41:     # console. Domain0 will have 64MB RAM allocated.
   42:     # Assume NetBSD is installed in the first MBR partition.
   43:     title Xen 3 / NetBSD (hda0, serial)
   44:       root(hd0,0)
   45:       kernel (hd0,a)/xen.gz dom0_mem=65536 com1=115200,8n1
   46:       module (hd0,a)/netbsd bootdev=wd0a ro console=ttyS0
   47: 
   48:     # Same as above, but using VGA console
   49:     # We can use console=tty0 (Linux syntax) or console=pc (NetBSD syntax)
   50:     title Xen 3 / NetBSD (hda0, vga)
   51:       root(hd0,0)
   52:       kernel (hd0,a)/xen.gz dom0_mem=65536
   53:       module (hd0,a)/netbsd bootdev=wd0a ro console=tty0
   54: 
   55:     # NetBSD/xen using a backup domain0 kernel (in case you installed a
   56:     # nonworking kernel as /netbsd
   57:     title Xen 3 / NetBSD (hda0, backup, serial)
   58:       root(hd0,0)
   59:       kernel (hd0,a)/xen.gz dom0_mem=65536 com1=115200,8n1
   60:       module (hd0,a)/netbsd.backup bootdev=wd0a ro console=ttyS0
   61:     title Xen 3 / NetBSD (hda0, backup, VGA)
   62:       root(hd0,0)
   63:       kernel (hd0,a)/xen.gz dom0_mem=65536
   64:       module (hd0,a)/netbsd.backup bootdev=wd0a ro console=tty0
   65: 
   66:     #Load a regular NetBSD/i386 kernel. Can be useful if you end up with a
   67:     #nonworking /xen.gz
   68:     title NetBSD 5.1
   69:       root (hd0,a)
   70:       kernel --type=netbsd /netbsd-GENERIC
   71: 
   72:     #Load the NetBSD bootloader, letting it load the NetBSD/i386 kernel.
   73:     #May be better than the above, as grub can't pass all required infos
   74:     #to the NetBSD/i386 kernel (e.g. console, root device, ...)
   75:     title NetBSD chain
   76:       root        (hd0,0)
   77:       chainloader +1
   78: 
   79:     ## end of grub config file.
   80:           
   81: 
   82: Install grub with the following command:
   83: 
   84:     # grub --no-floppy
   85: 
   86:     grub> root (hd0,a)
   87:      Filesystem type is ffs, partition type 0xa9
   88: 
   89:     grub> setup (hd0)
   90:      Checking if "/boot/grub/stage1" exists... no
   91:      Checking if "/grub/stage1" exists... yes
   92:      Checking if "/grub/stage2" exists... yes
   93:      Checking if "/grub/ffs_stage1_5" exists... yes
   94:      Running "embed /grub/ffs_stage1_5 (hd0)"...  14 sectors are embedded.
   95:     succeeded
   96:      Running "install /grub/stage1 (hd0) (hd0)1+14 p (hd0,0,a)/grub/stage2 /grub/menu.lst"...
   97:      succeeded
   98:     Done.

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb