NetBSD-Bugs archive

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

Re: kern/46732: setroot(9) is called twice after "MI root on wedges"changes



The following reply was made to PR kern/46732; it has been noted by GNATS.

From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: mlelstv%serpens.de@localhost
Cc: gnats-bugs%NetBSD.org@localhost, mlelstv%NetBSD.org@localhost, 
tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: kern/46732: setroot(9) is called twice after "MI root on 
wedges"changes
Date: Mon, 23 Jul 2012 23:55:46 +0900

 mlelstv@ wrote:
 
 > On Mon, Jul 23, 2012 at 12:15:24AM +0900, Izumi Tsutsui wrote:
 > > >  I see three possible solutions.
 > > >  
 > > >  Drop setroot calls in MD code and adjust documentation 
 > > > (cpu_rootconf(9)).
 > > >  cpu_rootconf is then only a hook that lets MD code set the variables
 > > >  booted_device, booted_partition, booted_startblk, booted_blks.
 > > 
 > > I like this one.
 > 
 > I have prepared a patch and will test this on amd64 and amiga.
 > See f.n.o:/pub/NetBSD/misc/mlelstv/setroot.diff.
 > 
 > There is an issue with hp300 and hp700. In cpu_rootconf() they
 > call setroot() and then catch the root device and partition
 > so that the MD code can later reboot from the same device.
 
 Only hp300?
 
 > This can't work when setroot is only called later.
 > Maybe the code could be moved into cpu_reboot().
 
 It would work, but it also keeps unnecessary malloc'ed memories
 for boot_dev info until reboot.
 
 How about:
 
 - call MD cpu_rootconf() from main() (where currently it calls MI rootconf())
 - change MD cpu_rootconf() to set booted_foo variables as the above
 - also make MD cpu_rootconf() call MI rootconf() (for wedge)
   instead of setroot()
 
 so that we could have post setroot() MD ops as before.
 
 BTW, I wonder if booted_device == NULL check in rootconf() is appropriate.
 Shouldn't setroot() be called for RB_ASKNAME even in that case?
 
 ---
 Izumi Tsutsui
 


Home | Main Index | Thread Index | Old Index