构建自己的 LINUX 系统(二)

这次我们要来定制一下 Tiny Core 的引导界面,要用到 syslinux。

下载 syslinux 并复制我们需要的 syslinux 模块到指定的目录

PS:考虑到版本问题,我这里提供了我的 BXTLinux 的 syslinux 模块下载。

mkdir syslinux_moduels
cd syslinux_modules/
wget http://git.oschina.net/bxtkezhan/BXTLinux/raw/dev/boot/isolinux/boot.cat
wget http://git.oschina.net/bxtkezhan/BXTLinux/raw/dev/boot/isolinux/isolinux.bin
wget http://git.oschina.net/bxtkezhan/BXTLinux/raw/dev/boot/isolinux/ldlinux.c32
wget http://git.oschina.net/bxtkezhan/BXTLinux/raw/dev/boot/isolinux/libcom32.c32
wget http://git.oschina.net/bxtkezhan/BXTLinux/raw/dev/boot/isolinux/libutil.c32
wget http://git.oschina.net/bxtkezhan/BXTLinux/raw/dev/boot/isolinux/reboot.c32
wget http://git.oschina.net/bxtkezhan/BXTLinux/raw/dev/boot/isolinux/vesamenu.c32
cd ..
sudo cp syslinux_modules/* boot/isolinux/ -fv

编辑 syslinux 配置文件

syslinux 配置文件路径为 mylinux/boot/isolinux/isolinux.cfg,可以使用 vim、nano、gedit 之类的文本编辑器进行编辑修改,我这里做了如下修改:

UI vesamenu.c32
DEFAULT MyLinux
PROMPT 0
MENU TITLE MyLinux Boot Menu
TIMEOUT 120

MENU HSHIFT 0
MENU VSHIFT 0
MENU WIDTH 78
MENU ROWS 14
MENU MARGIN 10
MENU TABMSGROW 18
MENU TIMEOUTROW 20

LABEL MyLinux
    MENU LABEL ^MyLinux
    LINUX /boot/vmlinuz
    INITRD /boot/core.gz
    APPEND loglevel=3 cde

LABEL CoreMode
    MENU LABEL ^Core mode
    LINUX /boot/vmlinuz
    INITRD /boot/core.gz
    APPEND loglevel=3

LABEL Reboot
    MENU LABEL ^Reboot
    COM32 /boot/isolinux/reboot.c32

UI vesamenu.c32 指定为 vesamenu 模式的 UI,比较漂亮。DEFAULT MyLinux 默认采用 MyLinux 标签所指定的启动项。
MENU TITLE MyLinux Boot Menu UI 标题。TIMEOUT 120 等待时长。MENU HSHIFT 0 ... ... 一些 UI 配置。

LABEL MyLinux
    MENU LABEL ^MyLinux --> 名称
    LINUX /boot/vmlinuz --> 内核镜像
    INITRD /boot/core.gz --> 文件系统镜像
    APPEND loglevel=3 cde

LABEL CoreMode
    MENU LABEL ^Core mode
    LINUX /boot/vmlinuz
    INITRD /boot/core.gz
    APPEND loglevel=3

LABEL Reboot
    MENU LABEL ^Reboot
    COM32 /boot/isolinux/reboot.c32 --> 使用 reboot 模块用以重启

清理上次构建的残余项,重构系统

sudo make clean
sudo make
make run

这里写图片描述

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值