自动完成安装syslinux-install_update脚本将自动唤埋安装Syslinux, 复制COM32模块到/boot/syslinux, 设置启动标识,安装到MBR.可自动根据softraid处理MBR和 GPT磁盘。下面是安装过程: 1. 安装Syslinuxpacman -S syslinux2. 确认/boot是否已经加载3. 运行脚本syslinux-install_update ,参数使用 -i (安装) -a (设可启动标识) -m (安装到mbr)/usr/sbin/syslinux-install_update -i -a -m4. 修改配置文件 /boot/syslinux/syslinux.cfgNote: For this to work with GPT, the gptfdisk package is needed as the backend for setting the boot flag.手工完成安装Note: 若你不知你所使用的分区表是使用什么 (MBR or GPT), 默认一般使用的是MBR分区表。大部分情况下,GPT将使用整个磁盘创建一个特殊的MBR-类扰庆型的分区(type 0xEE) ,使用下面命令可显示:# fdisk -l /dev/sda或者可以这样:# sgdisk -l /dev/sda若其非GPT磁盘,将显示 " GPT: not present".Note: If you are trying to rescue an installed system with a live CD, be sure to chroot into it before executing these commands. If you do not chroot first, you must prepend all file paths (not /dev/ paths) with the mount point.Make sure you have the syslinux package installed. Then install Syslinux onto your boot partition, which must contain a fat, ext2, ext3, ext4, or btrfs file system.# mkdir /boot/syslinux# extlinux --install /boot/syslinux #run on a mounted directory (not /dev/sdXY)/boot/syslinux/ is device /dev/sda1MBR分区表需要标识启动分区为激活状态.可用和李蚂这些工具实现:fdisk, cfdisk, sfdisk, (g)parted.最后结果看起来是这样:# fdisk -l /dev/sda[...] Device Boot Start End Blocks Id System/dev/sda1 * 2048 104447 51200 83 Linux/dev/sda2 104448 625142447 312519000 83 Linux安装到主启动卷区:# dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/mbr.bin of=/dev/sdaGUID Partition Table aka GPTMain article GUID_Partition_TableBit 2 of the attributes for the /boot partition need to be set.# sgdisk /dev/sda --attributes=1:set:2This would toggle the attribute legacy BIOS bootable on partition 1Verify:# sgdisk /dev/sda --attributes=1:show1:2:1 (legacy BIOS bootable)安装主启动卷区:# dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/gptmbr.bin of=/dev/sda重启如果此时重启,会有提示,以确认是自动启动还是给出一个启动菜单,此时需要创建一个配置文件。配置 syslinuxsyslinux的配置文件 syslinux.cfg 必须和syslinux放在同一个目录下,在我们的例子中,是 '/boot/syslinux/'启动器将自动寻找这两个配置文件:syslinux.cfg (优先) 或者 extlinux.conf补充:Instead of LINUX, the keyword KERNEL can also be used. KERNEL tries to detect the type of the file, while LINUX always expects a Linux kernel.TIMEOUT 的值是1/10秒,也就是50代表5秒示例比较简单的 Syslinux 配置这是一个非常简单的配置,有启动提示,并且在5秒后自动启动第一个系统。配置文件:PROMPT 1TIMEOUT 50DEFAULT archLABEL arch LINUX ../vmlinuz-linux APPEND root=/dev/sda2 ro INITRD ../initramfs-linux.imgLABEL archfallback LINUX ../vmlinuz-linux APPEND root=/dev/sda2 ro INITRD ../initramfs-linux-fallback.img若不想看到提示,设置PROMPT(显示时间)为0.文本的启动菜单把模块menu COM32复制到syslinux目录中,即可使用文本菜单:# cp /usr/lib/syslinux/menu.c32 /boot/syslinux/若没有给/boot单独分区,且和/usr同一分区,那么,也可以仅使用一个软链接:# ln -s /usr/lib/syslinux/menu.c32 /boot/syslinux/配置:UI menu.c32PROMPT 0MENU TITLE Boot MenuTIMEOUT 50DEFAULT archLABEL arch MENU LABEL Arch Linux LINUX ../vmlinuz-linux APPEND root=/dev/sda2 ro INITRD ../initramfs-linux.imgLABEL archfallback MENU LABEL Arch Linux Fallback LINUX /vmlinuz-linux APPEND root=/dev/sda2 ro INITRD /initramfs-linux-fallback.imgp=boot/syslinux/syslinux.git;a=blob;f=doc/menu.txt.图形化的启动菜单把vesamenu COM32移入到syslinux目录中,可使用图形启动界面:# cp /usr/lib/syslinux/vesamenu.c32 /boot/syslinux/若没有给/boot单独分区,且和/usr同一分区,那么,也可以仅使用一个软链接: :# ln -s /usr/lib/syslinux/vesamenu.c32 /boot/syslinux/This config uses the same menu design as the Arch Install CD: syslinux.cfgThe background file can be found here: splash.pngConfig:UI vesamenu.c32DEFAULT archPROMPT 0MENU TITLE Boot MenuMENU BACKGROUND splash.pngTIMEOUT 50MENU WIDTH 78MENU MARGIN 4MENU ROWS 5MENU VSHIFT 10MENU TIMEOUTROW 13MENU TABMSGROW 11MENU CMDLINEROW 11MENU HELPMSGROW 16MENU HELPMSGENDROW 29# Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menuMENU COLOR border 30;44 #40ffffff #a0000000 stdMENU COLOR title 1;36;44 #9033ccff #a0000000 stdMENU COLOR sel 7;37;40 #e0ffffff #20ffffff allMENU COLOR unsel 37;44 #50ffffff #a0000000 stdMENU COLOR help 37;40 #c0ffffff #a0000000 stdMENU COLOR timeout_msg 37;40 #80ffffff #00000000 stdMENU COLOR timeout 1;37;40 #c0ffffff #00000000 stdMENU COLOR msg07 37;40 #90ffffff #a0000000 stdMENU COLOR tabmsg 31;40 #30ffffff #00000000 stdLABEL arch MENU LABEL Arch Linux LINUX ../vmlinuz-linux APPEND root=/dev/sda2 ro INITRD ../initramfs-linux.imgLABEL archfallback MENU LABEL Arch Linux Fallback LINUX ../vmlinuz-linux APPEND root=/dev/sda2 ro INITRD ../initramfs-linux-fallback.imgSince Syslinux 3.84 vesamenu.c32 supports the "MENU RESOLUTION $WIDTH $HEIGHT" directive.To use it, insert "MENU RESOLUTION 1440 900" into your config for a 1440x900 resolution.The background picture has to have exactly the right resolution however as syslinux will otherwise refuse to load the menu.ChainloadingIf you want to chainload other operating systems (such as Windows) or boot loaders, copy (or symlink) thechain.c32 module to the syslinux folder (for details, see the instructions in the previous section). Then, create a section in the configuration file:LABEL windows MENU LABEL Windows COM32 chain.c32 APPEND hd0 3hd0 3 is the third partition on the first BIOS drive - drives are counted from zero, but partitions are counted from one. For more details about chainloading, see [1].If you have grub2 installed in your boot partition, you can chainload it by using:LABEL grub2 MENU LABEL Grub2 COM32 chain.c32 append file=../grub/boot.imgThis maybe required for booting from iso images.使用内存测试 memtest使用下面的 LABEL章节部分,可加载(需要安装软件包:memtest86+,否则不起作用):LABEL memtest MENU LABEL Memtest86+ LINUX ../memtest86+/memtest.bin使用硬件探测工具HDTHDT (Hardware Detection Tool) displays hardware information. Like before, the .c32 file has to be copied or symlinked from /boot/syslinux/.For pci info either copy or symlink /usr/share/hwdata/pci.ids to /boot/syslinux/pci.idsLABEL hdt MENU LABEL Hardware Info COM32 hdt.c32重启和关闭电源Use the following sections to reboot or power off your machine.LABEL reboot MENU LABEL Reboot COM32 reboot.c32LABEL poweroff MENU LABEL Power Off COMBOOT poweroff.com
标签:syslinux