请问grub2如何隐藏启动菜单?

75 views
Skip to first unread message

窦培琪

unread,
Nov 21, 2009, 2:59:56 AM11/21/09
to debian-chinese
如题。
谢谢

ganquan

unread,
Nov 21, 2009, 3:01:21 AM11/21/09
to debian-c...@lists.debian.org
去/boot/grub/menu.list里面把你不想要的东西注释掉就可以了。
或者直接把timeout设置为0,这样就不用显示菜单,直接启动第一个启动项了
On Sat, Nov 21, 2009 at 03:59:56PM +0800, 窦培琪 wrote:
> 如题。
> 谢谢

--
Hi! I'm Ganquan.
http://imganquan.org


--
To UNSUBSCRIBE, email to debian-chine...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

窦培琪

unread,
Nov 21, 2009, 3:07:30 AM11/21/09
to debian-c...@lists.debian.org
我想要的效果是 用像老版grub那样的命令:hiddenmenu,这个命令在grub2中没有了。grub2默认配置文件是:/boot/grub/grub.cfg。
我电脑里还装有win。

2009/11/21 ganquan <imga...@gmail.com>

ganquan

unread,
Nov 21, 2009, 3:11:42 AM11/21/09
to debian-c...@lists.debian.org
sorry,怪我太粗心,没看到是grub2。
我不清楚grub2的配置,抱歉。
On Sat, Nov 21, 2009 at 04:07:30PM +0800, 窦培琪 wrote:
> 我想要的效果是用像老版grub那样的命令:hiddenmenu,这个命令在grub2中没有了。

Alyex Ye

unread,
Nov 22, 2009, 8:02:07 PM11/22/09
to debian-c...@lists.debian.org
这个版本的变化还是很大的,在Grub2中是不可以直接编辑/boot/grub/grub.cfg的,否则在下次升级或者其他变化的时候,update-grub命令(手动或自动)会将其覆盖。

正确的方法是修改/etc/default/grub文件,其中有2个参数
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
可以隐藏倒计时

修改完成后sudo update-grub即可。

2009/11/21 ganquan <imga...@gmail.com>



--
Best Regards,
Alex

窦peiqi

unread,
Nov 22, 2009, 8:48:29 PM11/22/09
to debian-chinese
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=3
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
这是我的/etc/default/grub 文件内容,update-grub后不管用。

Alyex Ye

unread,
Nov 22, 2009, 9:03:48 PM11/22/09
to debian-c...@lists.debian.org, debian-chinese
我手边没有可以重启的linux。不过从ubuntu上的简介来看,应该是这样没有错。
http://ubuntuforums.org/showthread.php?t=1195275

  • GRUB_HIDDEN_TIMEOUT=0
    • The menu will be hidden unless a # symbol is present at the beginning of this line. ( # GRUB_HIDDEN_TIMEOUT=0 )
    • The default setting initially depends on the presence of other operating systems.
      • Another OS Detected: The menu will be displayed. ( The line will begin with a # symbol. )
      • No other OS Detected: The menu will be hidden.
    • For integers greater than 0, the system will pause, but not display the menu, for the entered number of seconds.
    • 0 The menu will not be displayed. There will be no delay. When this entry is set to 0:
      • The user may force displaying the menu as the computer boots by holding down the SHIFT key.
      • During boot, the system will check the SHIFT key status. If it cannot determine the key status, a short delay will enable the user to display the menu by pressing the ESC key.
    • If enabled, the splash screen designated in 05_debian_theme will be displayed. This setting hides the menu only.
  • GRUB_HIDDEN_TIMEOUT_QUIET=true
    • true - No countdown is displayed. The screen will be blank.
    • false - A counter will display on a blank screen for the duration of the GRUB_HIDDEN_TIMEOUT value.
当GRUB_HIDDEN_TIMEOUT=0时,菜单不会显示,也不会有延迟,用户可以按下shift键(grub-legacy中是Esc)强制显示菜单,如果系统在启动过程中不能确定shift键的状态,会有一个短暂的延迟让用户按下Esc键来显示菜单。

GRUB_HIDDEN_TIMEOUT_QUIET=true是不显示倒计时。

你修改了文件之后执行update-grub命令的输出是否正常?有没有报错信息?执行命令之后的/boot/grub/grub.cfg文件和之前有没有区别?启动的时候是否按下了Shift键或者Esc键?

2009/11/23 窦peiqi <doup...@gmail.com>



--
Best Regards,
Alex

LI Daobing

unread,
Nov 22, 2009, 10:44:16 PM11/22/09
to Alyex Ye, debian-c...@lists.debian.org
另: grub2 的包已经开放翻译了, 有心人士可以参考网页: http://translationproject.org/domain/grub.html

2009/11/23 Alyex Ye <alye...@gmail.com>:

>> 2009/11/23 Alyex Ye <alye...@gmail.com>

--
Best Regards
LI Daobing

窦peiqi

unread,
Nov 23, 2009, 12:09:45 AM11/23/09
to debian-chinese
update-grub输出正常:
Generating grub.cfg ...
Found Debian background: moreblue-orbit-grub.png
Found linux image: /boot/vmlinuz-2.6.30-2-686
Found initrd image: /boot/initrd.img-2.6.30-2-686
Found linux image: /boot/vmlinuz-2.6.30-1-686
Found initrd image: /boot/initrd.img-2.6.30-1-686
done

还是不能隐藏菜单,奇怪。

2009/11/23 LI Daobing <lida...@gmail.com>
 另: grub2 的包已经开放翻译了, 有心人士可以参考网页: http://translationproject.org/domain/grub.html

Reply all
Reply to author
Forward
0 new messages