用GRUB制作可引导光盘
- mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o grub.iso iso
CDlinux's mkisofs.sh
- #!/bin/sh
- #
- # build CDlinux ISO image -- zxh(imzxh@yahoo.com)
- MKISO=`which genisoimage 2>/dev/null` || MKISO=`which mkisofs 2>/dev/null` || {
- echo "Sorry, you don't have genisoimage or mkisofs installed."
- exit 1
- }
- $MKISO -v -R -J -joliet-long -ucs-level 3 -input-charset utf8 \
- -publisher "CDlinux.Info" -p "BenZ@Home" -V "CDlinux" \
- -c boot.cat -hide boot.cat -b CDlinux/boot/stage2_eltorito \
- -no-emul-boot -boot-load-size 4 -boot-info-table \
- -o /tmp/CDlinux.iso `dirname "$0"`
用GRUB2引导GRUB4DOS
- set root=(hd0,1)
- linux /grub.exe
- boot
用GRUB2制作可引导光盘
- grub-mkimage -d . -o core.img biosdisk pc gpt iso9660 fat ntfs ext2 pxe
- cat cdboot.img core.img > g2ldr
上面对于GRUB 1.96版本可用,下面是GRUB 1.97的方法
- grub-mkimage -o core.img biosdisk ext2 fat iso9660
- cat cdboot.img core.img > g2ldr
制作ISO文件
- mkisofs -R -J -no-emul-boot -boot-info-table -boot-load-size 4 -b boot/grub/g2ldr -o grub2.iso
GRUB2引导光盘中的GRUB4DOS
- menuentry "GRUB FOR DOS" {
- search -f /grub/grub.exe --set=root
- linux /grub/grub.exe --config-file=(cd)/grub/menu.lst
- boot
- }
从头开始制作GRUB2可引导光盘
1.一般情况下GRUB2的模块文件位于/usr/lib/grub/i386-pc目录下,下面先拷贝模块
- mkdir -pv /tmp/iso/boot/grub/
- cp /usr/lib/grub/i386-pc/* /tmp/iso/boot/grub/
2.接着生成GRUB2的内核
- cd /tmp/iso/boot/grub
- grub-mkimage -o core.img biosdisk iso9660 ext2 fat
- cat cdboot.img core.img > g2ldr
g2ldr就是类似GRUB中stage2_eltroito的光盘可引导文件
注:只用biosdisk,iso9660这两个模块也可以
3.生成可引导的ISO文件
- cd /tmp/iso
- mkisofs -R -J -no-emul-boot -boot-info-table -boot-load-size 4 -b boot/grub/g2ldr -o ../grub2.iso .
/tmp/grub2.iso就是生成的可引导ISO了,可以用VBox或者VMWare来测试它了。
PS:这个ISO引导之后进入GRUB SHELL,若要菜单,请配置/tmp/iso/boot/grub/grub.cfg.
mkisofs -f -o aros.iso \
-b boot/grub/grub2_eltorito \
-c boot/boot.catalog \
-no-emul-boot \
-boot-load-size 4 \
-boot-info-table \
-allow-leading-dots \
-iso-level 4 \
-V "AROS Live CD" \
-publisher "The AROS Dev Team" \
-p "The AROS Dev Team ()" \
-sysid "AROS-$(AROS_TARGET_CPU)-$(AROS_TARGET_ARCH)" \
-l -J -r \
DIRECTORY_WITH_AROS