Project

General

Profile

Actions

Submit #1700

open

skip boot2 menu on <enter>

Added by Johannes.Hofmann almost 14 years ago. Updated almost 2 years ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Hi,

tuxillo noticed that the trick to speedup booting by hitting <enter>
does not work with default UFS-based installations, as those have no
separate /boot partition, and therefore the default location for the
loader is wrong (it had been changed to match default HAMMER
installations in 3735e368a1bdbe773c79c34512f49c905ff77bd7)

We could change boot2 to just continue it's normal operation without
entering the prompt when the user hits <enter>. That way one can avoid
the delay on UFS and HAMMER systems:

diff --git a/sys/boot/pc32/boot2/boot2.c b/sys/boot/pc32/boot2/boot2.c
index 459436f..55516be 100644
--- a/sys/boot/pc32/boot2/boot2.c
+++ b/sys/boot/pc32/boot2/boot2.c
@@ -346,7 +346,7 @@ main(void)
      */
     if (autoboot && !*kname) {
     memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3));
-    if (!keyhit(3*SECOND)) {
+    if (!keyhit(3*SECOND) || xgetc(0) == '\r') {
         load();
         memcpy(kname, PATH_BOOT3_ALT, sizeof(PATH_BOOT3_ALT));
         load();


To actually enter the prompt one has to hit any other key (e.g. Esc).

The check for '\r' works ok for me, but maybe we also need to check
for '\n'?

Cheers,
Johannes

Actions #1

Updated by tuxillo over 13 years ago

Johannes,

Is this still present? I see there was a commit related to this in
3735e368a1bdbe773c79c34512f49c905ff77bd7

Cheers,
Antonio Huete

Actions #2

Updated by Johannes.Hofmann over 13 years ago

"Antonio Huete Jimenez \(via DragonFly issue tracker\)" <> wrote:

Antonio Huete Jimenez <> added the comment:

Johannes,

Is this still present? I see there was a commit related to this in
3735e368a1bdbe773c79c34512f49c905ff77bd7

That commit changed things, so on installations with dedicated /boot
partition the speed up by hitting return works ok.
However it no longer works on installations that don't have a /boot
partition.
The patch I proposed in msg8262 makes it work on both kinds of
installations, but it's sort of a hack.

Cheers,
Johannes

Actions #3

Updated by tuxillo almost 2 years ago

  • Tracker changed from Bug to Submit
  • Description updated (diff)
  • Status changed from New to In Progress
  • Assignee changed from 0 to tuxillo
Actions #4

Updated by tuxillo almost 2 years ago

I've created a VM with a UFS installation and no dedicated /boot partition:

root@:~ # df -h /boot 
Filesystem     Size   Used  Avail Capacity  Mounted on
/dev/vbd0s1d  32.5G  1575M  28.3G     5q    /

I'm unable to reproduce this issue. Could it be that it happens only in some hardware because pressing the Enter key produces a different character?

Actions

Also available in: Atom PDF