Subject: re: weird kernfs behaviour.
To: None <eeh@netbsd.org>
From: matthew green <mrg@eterna.com.au>
List: tech-kern
Date: 12/17/2000 11:37:10
   	   
   	   > kernfs on the sparc64 port has started not working for rootdev & rrootdev:
   	   > 
   	   > # mount -t kernfs /kern /kern
   	   > # ls -l /kern/rootdev
   	   > ls: /kern/rootdev: Bad file descriptor
   	   > # ls -l /kern/rrootdev
   	   > ls: /kern/rrootdev: No such file or directory
   	   > 
   	   > 
   	   > this only happens with the `miniroot' (which is just a normal GENERIC kernel,
   	   > not an md_root using one), when loaded on sd0b/wd0b.  if i boot from sd0a it
   	   > works just fine.  why this matters i don't understand...
   	   > 
   	   > 
   	   > perhaps a UBC thing?  i don't recall when it started happening but it doesn't
   	   > happen in 1.5 or anything a couple of months after the branch (when i last
   	   > did real work on the installer).
   	   
   	   I've seen rrootdev not work on i386 systems in the past, and I was never
   	   able to figure out why.
   	   
   	   I'd say put some printfs in the code which tries to find the root device,
   	   and see what comes up.
   
   	my initial failure with kernfs were to do with this -- i just needed to add
   	wd to chrtoblk[] and it started working properly.  that part of it works.  it
   	makes a call to kernfs_lookup(), that seems to work... but it still fails..
   
   Um, I don't know what your problem is:
   
   nonplus.one-o.com:~: uname -a    
   NetBSD nonplus.one-o.com 1.5M NetBSD 1.5M (NONPLUS64) #255: Mon Dec 11 10:30:41 PST 2000     eeh@nonplus.one-o.com:/home4/src/sys/arch/sparc64/compile/NONPLUS64 sparc64
   nonplus.one-o.com:~: cd /kern    
   nonplus.one-o.com:/kern: ls  
   ./         boottime   hostname   loadavg    pagesize   rootdev    time
   ../        copyright  hz         msgbuf     physmem    rrootdev   version
   nonplus.one-o.com:/kern: cat boottime  
   0    
   nonplus.one-o.com:/kern: cat loadavg   
   588 311 205 2048
   nonplus.one-o.com:/kern: cat pagesize  
   8192
   nonplus.one-o.com:/kern: cat physmem   
   8192
   nonplus.one-o.com:/kern: cat version   
   NetBSD 1.5M (NONPLUS64) #255: Mon Dec 11 10:30:41 PST 2000
       eeh@nonplus.one-o.com:/home4/src/sys/arch/sparc64/compile/NONPLUS64
   nonplus.one-o.com:/kern: cat hz        
   100
   nonplus.one-o.com:/kern:     


three points:

	- this isn't the GENERIC kernel

	- this isn't booted from the swap partition

	- you didn't actually try to lookup "rootdev" or "rrootdev"


my *normal* kernels work.  it is only the GENERIC kernel in the miniroot
that fails for me.