|
#24
简单的说那个菜单将作为下次启动被选中
******************************************************************************
*** New Syntax for the DEFAULT/SAVEDEFAULT Commands ***
******************************************************************************
DEFAULT 及 SAVEDEFAULT 命令的新语法
In addition to the original usage of "default NUM" and "default saved", now
there is a new usage of "default FILE", like this:
相对于原来的用法"default NUM"及"default saved "增加的部分,现在有一个新用
法"default FILE",象这样:
default (hd0,0)/default
Note that FILE must have a valid DEFAULT file format. A sample DEFAULT file
is included in the release. You may copy it to wherever you like, but you
should avoid modifying its content manually. The DEFAULT file may be used
in this way:
注意参数FILE必须是一个有效的DEFAULT文件格式。一个简单的DEFAULT文件就包含
在发行版中。你可以复制它到你希望的地方,但是你应该避免手工修改它的容量。
DEFAULT文件可以按以下方法使用:
(1) First, you should copy a default file with valid format to somewhere in
your operating system.
首先,你要复制一个格式有效的default文件到你运行的系统上。
(2) Secondly, you should use the "default FILE" command of GRUB to announce
the use of FILE as our new default file for being written by "savedefault".
其次,你要使用GRUB中的"default FILE"命令来表明是使用这个FILE作为我们新
的预设文件,以便"savedefault"命令执行时写入它。
(3) Then, you may use "savedefault" command to save the desired entry number
into this new default file.
然后,你可以使用"savedefault"命令来把想要的入口数字保存到这个新的预设文
件中。
(4) OK, at next boot, you may read the saved entry number by using the same
"default FILE" command as mentioned in above (2).
好了,下次启动时,你可以通过使用类似上面第二步骤中的"default FILE"一样的
命令来读取已保存的入口数字。
And the SAVEDEFAULT command now accept an options `--wait=T', like this:
同时,SAVEDEFAULT 命令增加了一个选项 --wait=T ,象这样:
savedefault --wait=5
If `--wait=T' is specified and T is non-zero, savedefault will prompt
the user with a message just before it writes to disk. The write operation
will be cancelled in T seconds if the `Y' key was not pressed.
如果`--wait=T' 选项被指定而且 T 非零,savedefault 命令将在它就要写入磁盘
前,给使用者一个提示信息。
Here is a sample menu.lst file:
这里是一个简单的menu.lst文件:
#--------------------begin menu.lst---------------------------------------
color black/cyan yellow/cyan
timeout 30
default /default
title find and load NTLDR of Windows NT/2K/XP
find --set-root /ntldr
chainloader /ntldr
savedefault --wait=2
title find and load CMLDR, the Recovery Console of Windows NT/2K/XP
fallback 2
find --set-root /cmldr
chainloader /cmldr
#####################################################################
# write string "cmdcons" to memory 0000:7C03 in 2 steps:
#####################################################################
# step 1. Write 4 chars "cmdc" at 0000:7C03
write 0x7C03 0x63646D63
# step 2. Write 3 chars "ons" and an ending null at 0000:7C07
write 0x7C07 0x00736E6F
savedefault --wait=2
title find and load IO.SYS of Windows 9x/Me
find --set-root /io.sys
chainloader /io.sys
savedefault --wait=2
title floppy (fd0)
chainloader (fd0)+1
rootnoverify (fd0)
savedefault --wait=2
title find and boot Linux with menu.lst already installed
find --set-root /sbin/init
savedefault --wait=2
configfile /boot/grub/menu.lst
title find and boot Mandriva with menu.lst already installed
find --set-root /etc/mandriva-release
savedefault --wait=2
configfile /boot/grub/menu.lst
title back to dos
savedefault --wait=2
quit
title commandline
savedefault --wait=2
commandline
title reboot
savedefault --wait=2
reboot
title halt
savedefault --wait=2
halt
#--------------------end menu.lst---------------------------------------
Note 1: The file DEFAULT must exist and have a proper format as stated above.
Or else, the default/savedefault commands won't function well.
注意 1:预设文件 DEFAULT 必须是存在的而且具有和前面所述一样严格的格式。
Note 2: The file DEFAULT which is in the same dir as a certain MENU.LST file
is called associated with the MENU.LST file.
注意 2:在一个确信有 MENU.LST 文件的相同目录中的 DEFAULT 文件将和 MENU.LST 文
件一起被联合调用
Note 3: The associated DEFAULT file will take effect automatically if there
are no `default' commands present.
注意 3:即使没有出现`default'命令,被关联的 DEFAULT 文件也将自动生效。
Note 4: Just before a menu file gains control(e.g., it is the associated
MENU.LST of a GRLDR file, or it was specified via
`grub.exe --config-file=(DEVICE)/PATH/YOUR_MENU_FILE', or it was
specified by the `configfile' command of grub), its associated
DEFAULT file will be used if present, until an explicit `default'
command is encountered.
注意 4:就在菜单文件(诸如,GRLDR 的关联文件MENU.LST,或是通过
`grub.exe --config-file=(DEVICE)/PATH/YOUR_MENU_FILE'来指定的,
或是通过grub的`configfile'命令来指定的)取得控制权之前,它的
关联文件DEFAULT只要出现就会被使用,直到遇见了一个明确的`default'命令。
[ 本帖最后由 yjd 于 2009-5-28 22:30 编辑 ] |
|