livecd

root=/dev/ram0 ramdisk_size=80000 




Here is an example of procedures to make a bootable CD-ROM image. First, make a top directory for the bootable image, say, `iso': 


     $ mkdir iso


Make a directory for GRUB: 


     $ mkdir -p iso/boot/grub


Copy the file stage2_eltorito: 


     $ cp /usr/lib/grub/i386-pc/stage2_eltorito iso/boot/grub
       cp /usr/share/grub/x86_64-redhat/stage2_eltorito iso/boot/grub


If desired, make the config file menu.lst under iso/boot/grub (see Configuration), and copy any files and directories for the disc to the directory iso/. 


Finally, make a ISO9660 image file like this: 


mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot \
 -boot-load-size 4 -boot-info-table -o system.iso iso






default=0
timeout=2
title Green FireWall System
        root (cd)
        kernel /boot/vmlinuz-2.6.36 ro root=/dev/ram0 ramdisk_size=300000
        initrd /boot/initrd.img.gz


/etc/mtab


/dev/ram0 / ext2 rw 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0


/etc/fstab


/dev/ram0       /       ext2    defaults        1       1
tmpfs   /dev/shm        tmpfs   defaults        0       0
devpts  /dev/pts        devpts  gid=5,mode=620  0 0
sysfs   /sys    sysfs   defaults        0       0
proc    /proc   proc    defaults        0       0








root=/dev/ram0 ramdisk_size=50000 
rm initrd* 
mkdir initrd
dd if=/dev/zero of=initrd.img bs=1k count=200000
mke2fs -F -v -m0 initrd.img
mount -o loop initrd.img initrd
cp root/* initrd/ -rfd


umount initrd.img
gzip -9 initrd.img
cp initrd.img.gz iso/boot/




mount /dev/sdb1 /mnt
cp initrd.img.gz /mnt/initrd-2.6.36-usb.img
umount /dev/sdb1








  1、解压initrd.img文件: 
  mv initrd.img initrd.img.gz 
  gunzip initrd.img.gz 
  cpio –idcmv < initrd.img 


  2、制作initrd.img文件: 
  cd需要打包进initrd的文件所在目录 
  find . | cpio -c -o > initrd.img 
  gzip -9 initrd.img 
  mv initrd.img.gz initrd.img 

 

=====================

 

cd /usr/src/
umount initrd
rm initrd* -rfd
rm root1.tar.gz -rfd
rm root.tar.gz -rfd
rm system.iso -rfd
cd /usr/src/root
tar -zcf ../root.tar.gz *
cd /usr/src/root1
tar -zcf ../root1.tar.gz *

cd /usr/src/boot
tar -zcf ../boot.tar.gz *

cd /usr/src/
mkdir initrd
dd if=/dev/zero of=initrd.img bs=1k count=200000
mke2fs -F -v -m0 initrd.img
mount -o loop initrd.img initrd
cd /usr/src/initrd
cp ../root.tar.gz ./
cp ../root1.tar.gz ./
cp ../boot.tar.gz ./
tar -zxf root1.tar.gz
rm root1.tar.gz
cd /usr/src/
umount initrd.img
gzip -9 initrd.img
cp initrd.img.gz iso/boot/

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值