我们这里的镜像包名假设为redhat7.iso
常用命令如下:
1.mount -o loop /opt/redhat7.iso /mnt/11
2.cp -r /mnt/11/* /mnt/22
3.mkdir /mnt/22/boot/aa
4.mv /mnt/22/boot/initrd.img /mnt/22/boot/aa
5.cd /mnt/22/boot/aa
6.zcat initrd.img | cpio -imd
7.rm initrd.img
8.对镜像中的文件进行修改,如果有从windows上传入的文件,需要dos2unix 文件
9.find . ! -name "*~" | cpio -H newc -create | gzip -9 > /usr1/my/work/boot/initrd.img
10.mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o /opt/redhat7.iso /mnt/22
| 命令格式 | 打好包的镜像名| 要被打包的目录|
11.ipsisign /sign /d /opt/redhat7.iso/ /s /opt/redhat7.iso.sgn
格式:ipsisign /sign /d(文件)|/dir(目录) 文件或目录 /s 文件或目录.sgn