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

來源:互聯網
上載者:User

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

實現目標:基於現有的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
[root@localhost Downloads]# cp -r /mnt/livecd/* /mnt/img

2.切換到/mnt/img, 查看一下/mnt/img下面的內容。

[root@localhost img]# ls
gentoo.efimg            image.squashfs  livecd  README.txt
gentoo.efimg.mountPoint  isolinux   

3.把自己的核心和ramfs放入到isolinux檔案夾裡。這裡核心是bzImage, ramfs是ramfs.tar.gz

[root@localhost img]# ls isolinux/
boot.cat  elilo.efi  F4.msg  F7.msg      isolinux.bin  memtest86
boot.msg  F2.msg    F5.msg  gentoo      isolinux.cfg  ramfs.tar.gz
bzImage  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這一項,輸入它,啟動:

本文永久更新連結地址:

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.