livecd制作 centos
生活随笔
收集整理的這篇文章主要介紹了
livecd制作 centos
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
LiveCD 制作 制作需要的工具: livecd-tool 包 TeClient的iso目錄(將TeClient的iso文件拷到一個目錄下面) genisoimage iso生成工具 思路: 配置好一個完整的LINUX系統,將此系統打包 使用livecd-tools工具 生成一個壓縮鏡像(鏡像里面裝的是一個最小化系統) 解壓縮,然后將打包好的LINUX解壓的里面,最后生成壓縮鏡像 將生成好的壓縮鏡像拷入到LINUX的iso里面 最后配置菜單生成iso 注意: 使用tar將系統拷貝到壓縮鏡像時,壓縮鏡像之后4G的大小, 配置菜單的時候,要在kernel行加入biosdevname=0? net.ifnames=0 否則網卡名不會是eth0 備份的時候不要備份/etc/fstab和boot proc目錄 鏡像將不重要的刪除 1備份完成的TeClient系統 tar –zcvf /mnt/backos.tgz? --exclude=/etc/fstab –exclude=/boot –exclude=/proc –exclude=/sys –exclude=/mnt –exclude=/media / 2 生成壓縮鏡像 定義最小化安裝的ks文件,用來安裝最小化系統 vi ks.cfg lang en_US.UTF-8 keyboard us timezone Asia/Shanghai auth --useshadow --enablemd5 selinux --disabled firewall --disabled repo? --name=a-base? --baseurl=http://mirrors.163.com/centos/7/os/$basearch/ repo --name=a-epel?? -baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch repo --name=a-extras?? --baseurl=http://mirrors.163.com/centos/7/extras/$basearch/ repo --name=a-centosplus --baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/ repo --name=a-live??? --baseurl=http://www.nanotechnologies.qc.ca/propos/linux/centos-live/$basearch/live %packages bash kernel syslinux passwd policycoreutils perl firewalld chkconfig authconfig rootfiles comps-extras xkeyboard-config grub2 coreutils parted %end 安裝livecd-tools工具 yum install –y livecd-tools 生產最小化鏡像 livecd-creator --config=ks.cfg --cache=/home/livecd/cache --tmpdir=/home/livecd/tmp 當前目錄下面會生成一個livecd-ks-xxxx.iso 3 解壓縮,將備份好的系統解壓到生成的壓縮鏡像內 準備一個掛著目錄? /home/livecd/test 準備一個存放零時文件目錄 /temp/tmp mkdir –p /temp/tmp mkdir –p /home/livecd/test mount -o loop,rw livecd-ks-201702041124.iso /home/livecd/test cp -a /home/livecd/test/LiveOS/squashfs.img /temp/tmp umount /home/livecd/test cd /temp/tmp/ unsquashfs squashfs.img cd squashfs-root/LiveOS mount -o loop,rw ext3fs.img /home/livecd/test tar xf /mnt/backos.tgz –C /home/livecd/test umount /home/livecd/test cd /temp/tmp/ mv squashfs.img squashfs.img.bak mksquashfs squashfs-root squashfs.img 4,將生成的squashfs.img 復制到TeClient的iso里面 然后生成iso TeClient 的iso目錄 /TeClient/test_Teclient cp /temp/tmp/squashfs.img? ?/TeClient/test_Teclient/LiveOS 修改iso文件里面的sha256的值 查看squashfs.img 的sha256值 [root@pdj LiveOS]# sha256sum squashfs.img 25075a6f7d9b7588b0587ac677c55f72981cdf038daa2e73dd18a321054cbf2b? squashfs.img vi /TeClient/test_Teclient/.treeinfo LiveOS/squashfs.img = sha256:25075a6f7d9b7588b0587ac677c55f72981cdf038daa2e73dd18a321054cbf2b 5 修改菜單/TeClient/test_Teclient /isolinux/isolinux.cfg vi /TeClient/test_Teclient /isolinux/isolinux.cfg MENU SEPARATOR label linux menu label [ ^I ] TeClient LiveCD kernel vmlinuz biosdevname=0? net.ifnames=0 append? initrd=initrd.img inst.stage2=hd:LABEL=TeClient rd.live.image quiet 生成iso文件 cd /TeClient genisoimage -quiet -V "TeClient" -J -R -T -v -boot-info-table -no-emul-boot -boot-load-size 4 –b isolinux/isolinux.bin -c isolinux/boot.cat -o /pub/livecd_teclient.iso test_Teclient/ 補充:??????? 解決ext3fs.img文件只有4G的問題 將ext3fs.img 擴展4G空間 dd if=/dev/zero of=test count=4096 bs=1M cat test >> ext3fs.img e2fsck -f ext3fs.img resize2fs ext3fs.img
轉載于:https://www.cnblogs.com/pdjun/p/6655850.html
總結
以上是生活随笔為你收集整理的livecd制作 centos的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: HTML的语义化,你需要深入了解
- 下一篇: Ubuntu 14.04.5 imx6