基于现有的Linux LiveCD加入自己的内核和ramfs

原LiveCD:install-amd64-minimal-20130711.iso (gentoo)

工作系统:CentOS

1.复制原LiveCD的内容:

[root@localhost Downloads]# mkdir /mnt/livecd[root@localhost Downloads]# mkdir /mnt/img[root@localhost 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">[root@localhost Downloads]# cp -r /mnt/livecd/* /mnt/img2.切换到/mnt/img, 查看一下/mnt/img下面的内容。[root@localhost img]# lsgentoo.efimgimage.squashfs livecd README.txtgentoo.efimg.mountPoint isolinux 3.把自己的内核和ramfs放入到isolinux文件夹里。这里内核是bzImage, ramfs是ramfs.tar.gz[root@localhost img]# ls isolinux/boot.cat elilo.efi F4.msg F7.msgisolinux.bin memtest86boot.msg F2.msgF5.msg gentooisolinux.cfg ramfs.tar.gzbzImage F3.msgF6.msg gentoo.igz kernels.msg System.map-gentoo4.修改isolinux.cfg, 加入一项启动(其中append那一项,可以根据自己需要来增减参数):label hello-test kernel bzImage append root=/dev/ram init=/linuxrc initrd=ramfs.tar.gz5.回到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

相关文章:

你感兴趣的文章:

标签云: