你好,游客 登录 注册 搜索
背景:
阅读新闻

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

[日期:2015-03-06] 来源:Linux社区  作者:xuzhina [字体:大 中 小]

实现目标:基于现有的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这一项,输入它,启动:

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

本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-03/114557.htm

linux
相关资讯       Linux ramfs 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款