Re: Patch for boot loader: menu command

2013-07-26 Thread Eric Haszlakiewicz
On Fri, Jul 26, 2013 at 01:09:27AM +0200, Havard Eidnes wrote:
 Eric wrote:
  How about change boot to use whatever boot.cfg says is the default
  boot option, and boot ...anything... to be the override-the-menu
  command?
 
 How does the attached look?  It should implement the suggested idea.

That looks like a pretty simple change.

 diff -u -r1.58 boot2.c
...
 +#ifndef SMALL
 + if (bootconf.nummenu  0)
 + bootdefault();
 +#endif

Is this nummenu0 condition needed both here an inside bootdefault()?

Eric


Re: Patch for boot loader: menu command

2013-07-26 Thread Eric Haszlakiewicz
On Fri, Jul 26, 2013 at 05:34:49PM +0200, Havard Eidnes wrote:
 I guess the one inside bootdefault() will do.
 
 Come to think of it, I thought of printing the boot command in
 this instance -- how does that sound?

It's usually better to know what's going on, so I say that'd be good.

Eric


Re: Patch for boot loader: menu command

2013-07-26 Thread David Young
On Fri, Jul 26, 2013 at 01:09:27AM +0200, Havard Eidnes wrote:
  On Thu, Jul 25, 2013 at 02:24:29PM +0200, Havard Eidnes wrote:
  Now, there are probably several ways to go around mending this.
  Some of them are:
 
  1) provide a way to display the contents of boot.cfg (but need to
 prevent showing the contents of /netbsd...)
  2) provide a way to recall and edit one of the boot commands from
 boot.cfg (sounds complicated, and more than I intended to chew
 off in this round)
  3) provide a way to re-enter the boot menu you dropped from in
 the first step in the procedure above, and then allow to
 select one of the boot methods already specified in boot.cfg
 
  How about change boot to use whatever boot.cfg says is the default
  boot option, and boot ...anything... to be the override-the-menu
  command?
 
 How does the attached look?  It should implement the suggested idea.

The changes you propose sound like a good idea, however, I'm not sure
I completely understand how the bootloader is changing.  Do you mind
prototyping the interaction in an email?  I.e., simulate a typescript
of someone operating bootloader with the changes in place?  [It may be
less trouble to create an actual typescript. :-)]

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: Patch for boot loader: menu command

2013-07-26 Thread Havard Eidnes
  How about change boot to use whatever boot.cfg says is the default
  boot option, and boot ...anything... to be the override-the-menu
  command?

 How does the attached look?  It should implement the suggested idea.

 The changes you propose sound like a good idea, however, I'm not sure
 I completely understand how the bootloader is changing.  Do you mind
 prototyping the interaction in an email?  I.e., simulate a typescript
 of someone operating bootloader with the changes in place?  [It may be
 less trouble to create an actual typescript. :-)]

Sure, I'll give it a try:

[ First boot-up will display on VGA: ]

Welcome to the NetBSD 5.3 installation CD
=

ACPI should work on all modern and legacy hardware, however if you have 
problems, please try disabling it.

If you encounter problems on hardware manufactured after 1998 with ACPI
enabled, please file a problem report including output from the 'dmesg'
command.

1) Install NetBSD
2) Install NetBSD (no ACPI)
3) Install NetBSD (no ACPI, no SMP)
4) Drop to boot prompt

Choose an option; RETURN for default; SPACE to stop countdown.

Option 1 will be chosen in 30

[ press 4 using the PC keyboard ]

type ? or help for help.
 consdev com0

[ ...and on the com0 serial port you will get: ]

Welcome to the NetBSD 5.3 installation CD
===

ACPI should work on all modern and legacy hardware, however if you have 
problems, please try disabling it.

If you encounter problems on hardware manufactured after 1998 with ACPI
enabled, please file a problem report including output from the 'dmesg'
command.
 

[ Now, with my diff, if you simply do boot, you will instead of
  just cycling through the kernel names the boot loader knows
  about, you will instead get the command from the default menu
  entry: ]

 boot
command(s): load /miniroot.kmod;boot netbsd
booting cd0a:netbsd
10089136+518916+618576 [521152+509152]=0xbb28d8
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010
The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California.  All

etc.


This is with the slightly modified diff, attached.

One problem is that if boot.cfg only contains boot as a
command, that will create an infinite loop in the boot loader.  I
can add a static int to allow bootdefault()'s body only to be
invoked once, breaking this loop.

I still think it's a good idea to add the menu command, in that
case the interaction could go something like this:


[ First boot-up will display on VGA: ]

Welcome to the NetBSD 5.3 installation CD
=

ACPI should work on all modern and legacy hardware, however if you have 
problems, please try disabling it.

If you encounter problems on hardware manufactured after 1998 with ACPI
enabled, please file a problem report including output from the 'dmesg'
command.

1) Install NetBSD
2) Install NetBSD (no ACPI)
3) Install NetBSD (no ACPI, no SMP)
4) Drop to boot prompt

Choose an option; RETURN for default; SPACE to stop countdown.

Option 1 will be chosen in 30

[ press 4 using the PC keyboard ]

type ? or help for help.
 consdev com0

[ ...and on the com0 serial port you will get: ]

Welcome to the NetBSD 5.3 installation CD
===

ACPI should work on all modern and legacy hardware, however if you have 
problems, please try disabling it.

If you encounter problems on hardware manufactured after 1998 with ACPI
enabled, please file a problem report including output from the 'dmesg'
command.
 
 menu
Welcome to the NetBSD 5.3 installation CD
=

ACPI should work on all modern and legacy hardware, however if you have 
problems, please try disabling it.

If you encounter problems on hardware manufactured after 1998 with ACPI
enabled, please file a problem report including output from the 'dmesg'
command.

1) Install NetBSD
2) Install NetBSD (no ACPI)
3) Install NetBSD (no ACPI, no SMP)
4) Drop to boot prompt

Choose an option; RETURN for default; SPACE to stop countdown.

Option 1 will be chosen in 30

[ and you can then chose whichever option you want ]

Regards,

- HÃ¥vard
Index: boot/boot2.c
===
RCS file: /cvsroot/src/sys/arch/i386/stand/boot/boot2.c,v
retrieving revision 1.58
diff -u -r1.58 boot2.c
--- boot/boot2.c4 Aug 2012 03:51:27 -   1.58
+++ boot/boot2.c26 Jul 2013 18:26:50 -
@@ -439,6 +439,10 @@
bootit(filename, howto, tell);
} else {
int i;
+
+#ifndef SMALL
+   bootdefault();
+#endif
for (i = 0; i  NUMNAMES; i++) 

Re: Patch for boot loader: menu command

2013-07-25 Thread Eric Haszlakiewicz
On Thu, Jul 25, 2013 at 02:24:29PM +0200, Havard Eidnes wrote:
 Now, there are probably several ways to go around mending this.
 Some of them are:
 
 1) provide a way to display the contents of boot.cfg (but need to
prevent showing the contents of /netbsd...)
 2) provide a way to recall and edit one of the boot commands from
boot.cfg (sounds complicated, and more than I intended to chew
off in this round)
 3) provide a way to re-enter the boot menu you dropped from in
the first step in the procedure above, and then allow to
select one of the boot methods already specified in boot.cfg

How about change boot to use whatever boot.cfg says is the default
boot option, and boot ...anything... to be the override-the-menu
command?

Eric