您的位置:首页 > 运维架构 > Linux

syslinux 常用菜单命令

2014-04-22 18:04 465 查看
PROMPT 0

TIMEOUT 100 菜单停留时间,计时单位1/10秒(必填项)

DEFAULT vesamenu.c32 菜单窗口

MENU BACKGROUND bsck.png 运行窗口背景图片(640x480)(必填项)

FONT zh.psf 字体

MENU WIDTH 80 菜单栏宽度

MENU MARGIN 16 子菜单水平位置,数字越大越往右移

MENU HELPMSGROW 19 帮助文字的垂直位置

MENU ROWS 16 菜单条数 这个数值要小于HELPMSGROW TABMSGROW CMDLINEROW TIMEOUTROW 等的数值,否则菜单条不能完全显示

MENU TABMSGROW 20 [TAB] 的高度

MENU CMDLINEROW 21 命令行高度

MENU TIMEOUTROW 22 倒计时高度

MENU HSHIFT 1 方框向右移动

MENU VSHIFT 1 方框向下移动

# MENU RESOLUTION 800 600 指定背景图大小

menu color border 30;44 #00000000 #00000000 none 菜单边框 透明

menu color title 1;36;44 #FFFFFFFF #00000000 none 顶部标题文字颜色 其中#FFFFFFFF为前景色,后六位为白色的16进制代码FFFFFF #00000000为背景色,透明

menu color sel 30;37 #FF00FF00 #00000000 none 选定子菜单颜色 绿色

menu color unsel 37;44 #FFFFFFFF #00000000 none 未选定子菜单颜色 白色

menu color help 37;40 #FFFFFFFF #00000000 none 菜单注释文字颜色 白色

menu color cmdline 37;40 #FFFF0000 #00000000 none TAB命令行颜色 红色

menu color msg07 37;40 #FFFFFF00 #00000000 none F1显示颜色 黄

menu color timeout 37;40 #FFFF0000 #00000000 none 剩余时间秒数颜色 红色

menu color timeout_msg 37;40 #FFFFFF00 #00000000 none 剩余时间字体颜色 黄

menu color hotkey 1;37;44 #ffffff00 #00000000 none 快捷键颜色 黄

menu color hotsel 1;7;37;40 #FF00FF00 #00000000 none 选定快捷键颜色 绿色

MENU AUTOBOOT # 设定倒计时

MENU TABMSG 按[TAB]编辑选项 设定TAB提示

MENU TITLE 电脑维护工具盘 设定顶部标题

LABEL hd0

MENU LABEL [^1] 启动硬盘第一分区 ^定义快捷键 ...1为快捷键

MENU INDENT 2 #向右缩进2

kernel chain.c32 hd0,1

MENU DEFAULT 默认启动菜单

LABEL pe

MENU LABEL [^2] 启动WINDOWS PE系统

MENU INDENT 2

kernel /boot/bin/H3_LNXXP.BIN

TEXT HELP

零体积PE 831grldr 设定帮助提示,此文字的位置和显示的效果一样

NANOPE_V2008 pe.bin

ENDTEXT

LABEL GHOST

MENU LABEL [^3] 运行GHOST 备份恢复

MENU INDENT 2

kernel /boot/syslinux/memdisk

append initrd=/boot/img/ghostc.img

LABEL DOS1

MENU LABEL [^4] 迈思DOS工具箱加强版

MENU INDENT 2

kernel /boot/syslinux/memdisk

append initrd=/boot/img/maxdos.img

LABEL DOS2

MENU LABEL [^5] DOS时代菜鸟工具箱

MENU INDENT 2

kernel /boot/syslinux/memdisk c=147 h=5 s=36 floppy

append initrd=/boot/img/DTS834.IMA

LABEL grldr

MENU LABEL [^6] 启动GRUBDOS

MENU INDENT 2

kernel /boot/bin/ldntldr

append initrd=/boot/bin/grldr

LABEL slax

MENU LABEL [^7] 启动SLAX6.1.2

MENU INDENT 2

KERNEL /boot/linux/slax/vmlinuz

APPEND initrd=/boot/linux/slax/initrd.gz ramdisk_size=6666 root=/dev/ram0 rw autoexec=xconf;telinit~4 locale=CHS.UTF-8

LABEL cdlinux

MENU LABEL [^8] 启动CDlinux 0.9.5

MENU INDENT 2

kernel /boot/linux/CDlinux/bzImage

append initrd=/boot/linux/CDlinux/initrd quiet CDL_LANG=zh_CN.UTF-8 CDL_AMOUNT=yes

LABEL linux

MENU LABEL [^9] 安装LINUX系统

MENU INDENT 2

kernel /boot/linux/m/vmlinuz

append initrd=/boot/linux/m/initrd.img

LABEL bz31

MENU LABEL [^G] 启动G4L备份恢复LINUX

MENU INDENT 2

KERNEL /boot/linux/g4l/bz31

APPEND initrd=/boot/linux/g4l/ramdisk.gz ramdisk_size=65536 root=/dev/ram0

LABEL geexbox

MENU LABEL [^B] 启动GEEXBOX1.2.4

MENU INDENT 2

CONFIG /geexbox/boot/isolinux.cfg

LABEL reboot

MENU LABEL [^R] 重新启动

MENU INDENT 2

kernel /boot/syslinux/reboot.c32

F1 syslinux.cfg #FF0000FF 设定F1键显示syslinuc.cfg #FF0000FF为背景色 蓝色

F2 pe.txt #FF0000FF

F4 img.txt #FF0000FF

F9 linux.txt #FF0000FF

》》》》》》》》》》》》》》》》》》》》》》》》》》》

◆MENU DISABLE

(Only valid after a LABEL statement.)

Makes the entry unselectable.

仅用于LABEL语句后面,使用该项菜单项不可选择(即能看不能用)。

◆MENU SEPARATOR

Insert an empty line in the menu.

在菜单中插入一个空行

◆MENU INDENT count

(Only valid after a LABEL statement.)

Will add "count" spaces in front of the displayed menu entry.

仅在LABEL语句后有效。使用该命令,可在显示时将菜单项之前加上conut个空格。

◆MENU DEFAULT

(Only valid after a LABEL statement.)

Indicates that this entry should be the default for this

仅在LABLE语句后有效,指定默认菜单项

◆TEXT HELP

Help text ...

... which can span multiple lines

ENDTEXT

(Only valid after a LABEL statement.)

Specifies a help text that should be displayed when a particular

selection is highlighted.

particular submenu. See also the DEFAULT directive below.

仅在LABEL语句后有效,用于在该菜单项被选定高亮时显示其中的文本信息(可为多行)

◆MENU PASSWD passwd

(Only valid after a LABEL statement.)

Sets a password on this menu entry. "passwd" can be either a

cleartext password or a password encrypted with one of the

following algorithms:

MD5 (Signature: $1$)

SHA-1 (Signature: $4$)

SHA-2-256 (Signature: $5$)

SHA-2-512 (Signature: $6$)

Use the included Perl scripts "sha1pass" or "md5pass" to

encrypt passwords. MD5 passwords are compatible with most

Unix password file utilities; SHA-1 passwords are probably

unique to Syslinux; SHA-2 passwords are compatible with very

recent Linux distributions. Obviously, if you don't encrypt

your passwords they will not be very secure at all.

If you are using passwords, you want to make sure you also use

the settings "NOESCAPE 1", "PROMPT 0", and either set

"ALLOWOPTIONS 0" or use a master password (see below.)

If passwd is an empty string, this menu entry can only be

unlocked with the master password.

仅在LABEL语句后有效,用于对该菜单加一特定密码。

◆MENU MASTER PASSWD passwd

Sets a master password. This password can be used to boot any

menu entry, and is required for the [Tab] and [Esc] keys to

work.

设置主密码,用于对任意菜单项加密码。需要按 [Tab] 及 [Esc]键进入输入界面。

◆注意,syslinux/isolinux/pxelinux自4.0版开始支持快捷键直接进入子菜单。格式如下:

MENU IMMEDIATE

仅用于LABEL语句后面。

◆最近发现syslinux中boot命令非常好用。(参见http://bbs.wuyou.com/viewthread.php?tid=188217&page=2#pid2173525

比如想不进菜单直接启动grldr 这一g4d内置菜单,可以这样使用:

QUOTE:

default a

label a

boot /grldr

这样,实际上没有使用任何.c32文件就达到目的了,涉及到的只有引导syslinux的pbr、ldlinux.sys、/boot/syslinux/syslinux.cfg及那个grldr。

一个最重要的好处是:boot命令对扩展名不敏感,比如0PE的内置菜单为0PE.BIN或者grldr,以前在pxelinux网启时,使用kernel命令的对象必须是.0文件,如

kernel /0PE.0,如果使用boot命令,现在只要 boot /0pe.bin 或 boot /grldr 或者 boot /0pe.0均可。即boot命令适应性还是很强的。

◆如果想加载ISO文件,可参考下面的命令:

QUOTE:

LABEL xxxISO

MENU LABEL < ^1 > XXX

LINUX memdisk

INITRD /****.iso

APPEND iso raw

或者:

QUOTE:

label XXX

kernel /memdisk raw iso initrd=/XXX.iso

◆如果想加载IMG文件,可参考下面的命令:

QUOTE:

LABEL maxdos

MENU LABEL [^1] MaxDOS 8

MENU IMMEDIATE

kernel /BOOT/SYSLINUX/MEMDISK c=194 h=2 s=36 floppy

append initrd=/BOOT/IMGS/MAXDOS.IMG

注意当IMG大小超过2.88M后,需要加上CHS参数。此参数的数值确定可用工具,也可通过winimage查看。具体搜索下吧。

◆启动PE的seupldr.bin文件,在syslinux下通常是加上一个ldntldr的头文件,再kernel之。当合盘时,grub4dos启动的是没有头文件的setupldr.bin,为了节省文件及空间,可以使用如下命令达到syslinux启动PE的要求:

QUOTE:

LABEL xxx

MENU LABEL [^2] xxxxxx

MENU IMMEDIATE

kernel /BOOT/LDNTLDR

append initrd=/BOOT/SETUPLDR.BIN

这样的效果等同于 kernel (LDNTLDR+SETUPLDR.BIN)

红字的MENU IMMEDIATE仅4.0以上版本支持。

◆启动子菜单

QUOTE:

LABEL XXX

MENU LABEL [^3] XXX

MENU IMMEDIATE

config /BOOT/SYSLINUX/3.CFG

3.CFG即为子菜单。

◆启动bootmgr:

QUOTE:

LABEL bootmgr

MENU LABEL [^B] BOOTMGR

MENU IMMEDIATE

kernel /BOOT/LDNTLDR

append initrd=/BOOTMGR

◆启动hd0,1上nt5系统:

QUOTE:

LABEL localboot

MENU LABEL [^N] nt5

MENU IMMEDIATE

kernel /BOOT/SYSLINUX/CHAIN.C32 hd0,1

append ntldr=/ntldr

这里,需要存在/BOOT/SYSLINUX/CHAIN.C32这一文件。

◆启动本地硬盘上系统:

QUOTE:

LABEL localboot

MENU LABEL [^L] local boot

MENU IMMEDIATE

localboot 0x80

◆启动(bios)下一设备:

QUOTE:

LABEL next

MENU LABEL [^N] next

MENU IMMEDIATE

localboot -1

◆关机:

QUOTE:

LABEL poweroff

MENU LABEL [^S] poweroff

MENU IMMEDIATE

kernel /BOOT/SYSLINUX/POWEROFF.COM

这里,需要存在/BOOT/SYSLINUX/POWEROFF.COM这一文件。

◆重启:

QUOTE:

LABEL reboot

MENU LABEL [^R] reboot

MENU IMMEDIATE

kernel /BOOT/SYSLINUX/REBOOT.C32

这里,需要存在/BOOT/SYSLINUX/REBOOT.C32这一文件。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: