skip boot2 menu on <enter>

看板DFBSD_submit作者時間15年前 (2010/03/22 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
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
文章代碼(AID): #1BfbxvTj (DFBSD_submit)