Subject: Re: What to do when generic kernel won't boot successfully
To: Thomas Mueller <tmueller@bluegrass.net>
From: Frederick Bruckman <fredb@immanent.net>
List: netbsd-help
Date: 05/18/2002 20:20:44
On Sat, 18 May 2002, Thomas Mueller wrote:

> Is there any way to recover, to compile a custom kernel when the generic kernel
> fails to boot successfully but the installation kernel boots, and allows
> installation of NetBSD?  Is there any way to mount the hard disk partitions and
> run the compiler on syssrc, using shell sh, having booted the installation
> kernel?  Or are too many things missing?

Sure you can. Use "-a" from the boot menu, so you'll be asked to
choose a root file system. So for example, you boot as "boot
fd0a:netbsd -as", and then when prompted, choose "wd0a:", then

	swapctl -A
	fsck -p
	mount -a -tnonfs
	su -l

puts you in your root shell with all local file systems mounted. From
there, you can easily run "config" and compile a kernel.

> Only other way I can think of is to cross-compile from a Linux system, but I
> remember being told that was impossible or next to impossible.  Any way to
> telnet to a remote NetBSD system and compile a kernel there?  That does not seem
> likely to me.

That might work, too. Whereas most of the tree assumes BSD make, the
kernel "Makefile" supplies all of it's targets explicitly, so as to
support cross-building. Moreover with current (but not 1.5.X), you can
cross-build a toolchain with which to build the whole tree. That's
reported to work on Cygwin, so it really should work on linux.

Frederick