tech-kern archive

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

Re: Multiboot a NetBSD kernel with Grub2: it works



On 09/13/2011 03:00 PM, Emmanuel Kasper wrote:
I tried booting the NetBSD kernel with grub2, and it works (tm)

#To add IN /etc/grub.d/40_custom
#Boot netbsd from First DOS partition

menuentry "NetBSD on sda1" {
insmod ufs2
set root=(hd0,msdos1)
multiboot /netbsd
}

Remarks:
* boot parameters like -s are ignored

This comes from the fact that GRUB (Legacy) passed the booted file as first
argument of the multiboot command-line whereas GRUB 2 doesn't, see for
instance http://lists.gnu.org/archive/html/grub-devel/2010-01/msg00146.html.

The NetBSD kernel assumes the behavior of GRUB Legacy and drops the first
argument.  So you should use:

multiboot /netbsd /netbsd -s

* grub2 does not need to know about labels, it needs the MS DOS
NetBSD partition and seems to be fine with that.

It's true when the booted kernel is on a partition (a:) that starts
at the same sector as an MS-DOS partition, which is often the case.
But GRUB (2) is also able to access partitions in a NetBSD disklabel
(provided that you load the appropriate module: insmod part_bsd).

* grub2 also has a knetbsd option to boot a NetBSD kernel, which loads
the kernel fine, but might pass wrong argument, as the
kernel does not find the rootfs and /sbin/init.

Right, I remember facing the same issue.  The option -r of the knetbsd
command lets you specify the root device (e.g., -r wd0a), but, ideally,
this should not be needed.

Grégoire



Home | Main Index | Thread Index | Old Index