Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Nov 2000 17:55:08 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Matthew Jacob <mjacob@feral.com>
Cc:        current@FreeBSD.org, John Polstra <jdp@polstra.com>
Subject:   Re: savecore broken because kern.bootfile is set wrong
Message-ID:  <XFMail.001110175508.jhb@FreeBSD.org>
In-Reply-To: <Pine.LNX.4.21.0011101734230.31159-100000@zeppo.feral.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 11-Nov-00 Matthew Jacob wrote:
> 
> 
>> Savecore isn't working in -current, dying in my case with "read:
>> invalid argument".  (This is on an Alpha -- I don't have an i386
>> -current machine to test it on at the moment.)  I traced it down to
>> the fact that getbootfile() is returning "kernel" -- not the full
>> pathname as the man page promises.  This seems to be because the
>> "kern.bootfile" sysctl variable isn't getting set correctly:
>> 
>>     alpha# sysctl kern.bootfile
>>     kern.bootfile: kernel
>> 
>> Because I had an old "/kernel" file and savecore runs in "/", it was
>> finding the wrong kernel.
>> 
>> This seems to be some sort of coordination problem between the loader
>> and the kernel and, maybe, the Alpha SRM.  Can anybody shed some light
> 
> Not SRM. SRM cares not.
> 
> 
>> on it?
>> 
>> Also, in "src/sys/boot/common/boot.c" we still have this:
>> 
>>     static const char *default_bootfiles = "kernel.ko";
>> 
>> which isn't right any more.
> 
> 
> Absolutely wrong, yes.
> 
> Look at kern_mib.c:
> 
>  
> char kernelname[MAXPATHLEN] = "/kernel";        /* XXX bloat */
>  
> SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW,
>     kernelname, sizeof kernelname, "Name of kernel file booted");
> 
> 
> This is also wrong now.
> 
> It's somewhat problematic in that the actual kernel name is kernel, still,
> but
> the path that it is found in depends on where the loader actually found it-
> that's contingent on module_path.
> 
> I don't know whether the loader is supposed to modify kernelname in the
> loaded
> kernel to have the actual path or not. 

It is supposed to.  Looks like a bug in the alpha startup code somewhere:

> uname -a
FreeBSD laptop.baldwin.cx 5.0-CURRENT FreeBSD 5.0-CURRENT #40: Fri Nov 10
15:17:48 PST 2000     john@laptop.baldwin.cx:/usr/src/sys/compile/LAPTOP-card 
i386
> sysctl kern.bootfile
kern.bootfile: /boot/kernel.card/kernel
> uname -a
FreeBSD baz.osd.bsdi.com 5.0-CURRENT FreeBSD 5.0-CURRENT #48: Fri Nov  3
12:37:16 PST 2000     root@baz.osd.bsdi.com:/usr/src/sys/compile/BAZ  alpha
> sysctl kern.bootfile
kern.bootfile: kernel

> -matt

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.001110175508.jhb>