基於現有的Linux LiveCD加入自己的核心和ramfs

來源:互聯網
上載者:User

標籤: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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.