Module Name: src
Committed By: nisimura
Date: Thu Jan 19 07:38:06 UTC 2012
Modified Files:
src/sys/arch/sandpoint/sandpoint: autoconf.c
src/sys/arch/sandpoint/stand/altboot: dsk.c
Log Message:
Change BTINFO_ROOTDEV to include boot device partition number in
its cookie field to allow a kernel to determine rootdev correctly
when kernel image is loaded from other than 'a' partition.
To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/sandpoint/sandpoint/autoconf.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sandpoint/stand/altboot/dsk.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/sandpoint/sandpoint/autoconf.c
diff -u src/sys/arch/sandpoint/sandpoint/autoconf.c:1.23 src/sys/arch/sandpoint/sandpoint/autoconf.c:1.24
--- src/sys/arch/sandpoint/sandpoint/autoconf.c:1.23 Sat Jun 18 08:08:30 2011
+++ src/sys/arch/sandpoint/sandpoint/autoconf.c Thu Jan 19 07:38:06 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.23 2011/06/18 08:08:30 matt Exp $ */
+/* $NetBSD: autoconf.c,v 1.24 2012/01/19 07:38:06 nisimura Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.23 2011/06/18 08:08:30 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.24 2012/01/19 07:38:06 nisimura Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -138,8 +138,8 @@ device_register(device_t dev, void *aux)
}
if (bi_rdev != NULL && device_class(dev) == DV_DISK
&& device_is_a(dev, bi_rdev->devname)
- && device_unit(dev) == bi_rdev->cookie) {
+ && device_unit(dev) == (bi_rdev->cookie >> 8)) {
booted_device = dev;
- booted_partition = 0;
+ booted_partition = bi_rdev->cookie & 0xff;
}
}
Index: src/sys/arch/sandpoint/stand/altboot/dsk.c
diff -u src/sys/arch/sandpoint/stand/altboot/dsk.c:1.11 src/sys/arch/sandpoint/stand/altboot/dsk.c:1.12
--- src/sys/arch/sandpoint/stand/altboot/dsk.c:1.11 Sat Nov 12 16:56:12 2011
+++ src/sys/arch/sandpoint/stand/altboot/dsk.c Thu Jan 19 07:38:05 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: dsk.c,v 1.11 2011/11/12 16:56:12 phx Exp $ */
+/* $NetBSD: dsk.c,v 1.12 2012/01/19 07:38:05 nisimura Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -498,7 +498,7 @@ dsk_open(struct open_file *f, ...)
/* build btinfo to identify disk device */
snprintf(bi_rdev.devname, sizeof(bi_rdev.devname), "wd");
- bi_rdev.cookie = d->unittag; /* disk unit number */
+ bi_rdev.cookie = (d->unittag << 8) | d->part;
return 0;
}