Subject: re: RAIDframe auto root
To: Alex Barclay <alex@planet-barclay.com>
From: matthew green <mrg@eterna.com.au>
List: port-sparc64
Date: 08/15/2003 10:08:45
I've been investigating further why my RAID root autoconfiguration
doesn't work when booting.
I can see in the i386 port that if boot_device is non-null in the
cpu_rootconf() (actually findroot() for i386) then it will assume that
it is already set, which is what RAIDframe does for autoroot.
On sparc64 we don't pay any attention that I can see if this has already
been set so it looks like the value is set correctly by RAIDframe and
then overwritten by cpu_rootconf based on what the prom code gave us.
I'm running 1.6.1 but would assume that this is still an issue in current.
Am I completely off base here or did we miss something?
i have this feeling that it's fixed in -current actually... yup:
revision 1.71
date: 2003/01/04 17:00:27; author: mrg; state: Exp; lines: +8 -5
use "booted_device" when calling setroot(), so that raidframe autoconfigured
root works... now with a "/boot" partition holding /ofwboot & /netbsd i can
have a raidframe root without hard coding root at in my kernel.
try applying this patch to your kernel..
Index: autoconf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc64/sparc64/autoconf.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -p -c -r1.70 -r1.71
*** autoconf.c 2003/01/01 02:22:57 1.70
--- autoconf.c 2003/01/04 17:00:27 1.71
***************
*** 1,4 ****
! /* $NetBSD: autoconf.c,v 1.70 2003/01/01 02:22:57 thorpej Exp $ */
/*
* Copyright (c) 1996
--- 1,4 ----
! /* $NetBSD: autoconf.c,v 1.71 2003/01/04 17:00:27 mrg Exp $ */
/*
* Copyright (c) 1996
*************** void
*** 492,505 ****
cpu_rootconf()
{
struct bootpath *bp;
- struct device *bootdv;
int bootpartition;
bp = nbootpath == 0 ? NULL : &bootpath[nbootpath-1];
! bootdv = bp == NULL ? NULL : bp->dev;
! bootpartition = bootdv == NULL ? 0 : bp->val[2];
! setroot(bootdv, bootpartition);
}
/*
--- 492,508 ----
cpu_rootconf()
{
struct bootpath *bp;
int bootpartition;
bp = nbootpath == 0 ? NULL : &bootpath[nbootpath-1];
! if (bp == NULL)
! bootpartition = 0;
! else if (booted_device != bp->dev)
! bootpartition = 0;
! else
! bootpartition = bp->val[2];
! setroot(booted_device, bootpartition);
}
/*