標籤:linux kernel centos livecd mkisofs
原LiveCD:install-amd64-minimal-20130711.iso (gentoo)
工作系統:CentOS
1.複製原LiveCD的內容:
[[email protected] Downloads]# mkdir /mnt/livecd[[email protected] Downloads]# mkdir /mnt/img[[email protected] Downloads]# mount -t iso9660 -o loop install-amd64-minimal-20130711.iso /mnt/livecd/mount: /dev/loop0 is write-protected, mounting read-only<pre name="code" class="html">[[email protected] Downloads]# cp -r /mnt/livecd/* /mnt/img
2.切換到/mnt/img, 查看一下/mnt/img下面的內容。
[[email protected] img]# lsgentoo.efimg image.squashfs livecd README.txtgentoo.efimg.mountPoint isolinux
3.把自己的核心和ramfs放入到isolinux檔案夾裡。這裡核心是bzImage, ramfs是ramfs.tar.gz
[[email protected] img]# ls isolinux/boot.cat elilo.efi F4.msg F7.msg isolinux.bin memtest86boot.msg F2.msg F5.msg gentoo isolinux.cfg ramfs.tar.gzbzImage F3.msg F6.msg gentoo.igz kernels.msg System.map-gentoo
4.修改isolinux.cfg, 加入一項啟動(其中append那一項,可以根據自己需要來增減參數):
label hello-test kernel bzImage append root=/dev/ram init=/linuxrc initrd=ramfs.tar.gz
5.回到img,製作自己的iso檔案
mkisofs -R -b isolinux/isolinux.bin -c isolinux/boot.cat -o /tmp/test.iso -V "test Linux" -no-emul-boot -boot-load-size 4 -boot-info-table .
6.把test.iso直接用虛擬機器,或燒錄下去,進入啟動介面時,按TAB鍵,可以看到hello-test這一項,輸入它,啟動:
基於現有的Linux LiveCD加入自己的核心和ramfs