<>

3.1. 安装 grub,创建 menu.lst,安装 kernel

执行以下命令:

cd $WORK
#install grub
mkdir iso/boot/grub -p
cp /usr/lib/grub/i386-pc/stage2_eltorito iso/boot/grub
#create menu.lst
cat > iso/boot/grub/menu.lst << EOF
default 0
timeout 10
color green/black light-green/black
title grub bootcd
  root(cd)
  kernel /boot/kernel root=/dev/ram0 rw
  initrd /boot/initrd.img
EOF
#install kernel
cp /boot/lfskernel-* iso/boot/kernel

由于还没有创建 initrd.img,如果现在执行 ./mkbootcd 会出现错误提示,但不会影响运行。生成的 iso 启动后会得到以下结果:

Figure 3.1. Screen: Grub works

Screen: Grub works

Figure 3.2. Screen: initrd.img does not exist, but the kernel is running

Screen: initrd.img does not exist, but the kernel is running