Subject: Re: boot vs. boot.net
To: Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>
From: Paul Kranenburg <pk@cs.few.eur.nl>
List: port-sparc
Date: 01/30/2003 08:46:44
> Because I want to easily switch between "do a netboot" and "boot from
> local disk". My idea thus far was to grab the bootloader via tftp all the
> time, and then just hand out one bootloader for net, and one for disk.
> Seems that's not that easy.

There's currently no way to pass such arguments to the boot program.
But it's fairly easy to customise the code. Here's a quick and dirty
solution: provide two patchable variables, say 

char fixed_bootdev[N];
char fixed_kernel[N];

and use those instead of the prom derived boot args if they are not
nul strings. You can then provide differently patched `boot.net'
versions to each individual tftp client.

This may not work if the machine should boot some other system than NetBSD.
In that case, you might use those arguments to actually reboot the machine,
this time providing the desired boot device to the machine's prom, e.g.
by doing `prom_boot(fixed_bootdev)'.


> I wonder if some bootp/dhcp option would make sense to tell the loader
> "even if you were loaded from net, continue by booting from disk".

This can be done too by customizing the boot program to interpret the
`rootpath' DHCP option differently. For instance, if you take it to
be a prom device path, you can again play either of the tricks mentioned above.

-pk