build custom centos7

必读,在以下内容之前。

pre:

0. install log

redhat6 mak iso guide

redhat7 make iso guide

1. Linux安装》(三)发行版制作

推荐使用pungi

这哥们写了不少不错的文章。 还有python的设计模式。


pungi --nohash --nosource --nodebugingo -G -C -B -I --name=demo --version=1.0 --destdit=./out -c package.ks
 package.ks 是需要安装的包列表。

2. cloud的部署安装

 

There is a script  to create custom iso

1.  KICKSTART INSTALLATIONS

2. KICKSTART OPTIONS

3. make the ISO 

        https://serverfault.com/questions/517908/how-to-create-a-custom-iso-image-in-centos

  1. Create a directory to mount your source.

    mkdir /tmp/bootiso
    
  2. Loop mount the source ISO you are modifying. (Download from Red Hat / CentOS.)

    mount -o loop /path/to/some.iso /tmp/bootiso
    
  3. Create a working directory for your customized media.

    mkdir /tmp/bootisoks
    
  4. Copy the source media to the working directory.

    cp -r /tmp/bootiso/* /tmp/bootisoks/
    
  5. Unmount the source ISO and remove the directory.

    umount /tmp/bootiso && rmdir /tmp/bootiso
    
  6. Change permissions on the working directory.

    chmod -R u+w /tmp/bootisoks
    
  7. Copy your Kickstart script which has been modified for the packages and %post to the working directory.

    cp /path/to/someks.cfg /tmp/bootisoks/isolinux/ks.cfg
    
  8. Copy any additional RPMs to the directory structure and update the metadata.

    cp /path/to/*.rpm /tmp/bootisoks/Packages/.
    cd /tmp/bootisoks/Packages && createrepo -dpo .. .
    
  9. Add kickstart to boot options.

    sed -i 's/append\ initrd\=initrd.img/append initrd=initrd.img\ ks\=cdrom:\/ks.cfg/' /tmp/bootisoks/isolinux/isolinux.cfg
    
  10. Create the new ISO file.

    cd /tmp/bootisoks && \ 
    mkisofs -o /tmp/boot.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -V "CentOS 7 x86_64" -R -J -v -T isolinux/. .
    
  11. (Optional) Use isohybrid if you want to dd the ISO file to a bootable USB key.

    isohybrid /tmp/boot.iso
    
  12. Add an MD5 checksum (to allow testing of media).

    implantisomd5 /tmp/boot.iso
  13. others

4. other introduce.

    make-a-custom-centos-7-or-rhel-7-cd-with-kicktart-file

   Make a custom CentOS-7 or RHEL-7 CD With kicktart File

 

   红帽(Red Hat)从Enterprise Server 6.2 开始,启动镜像文件initrd.img 开始改用xz 工具进行压缩,这与以往版本是有区别的

   历史  关于initrd.img的压缩(制作)及解压的过程

  To decompress an image, use the xz -d command. For example

  How to unpack and repack an initial ramdisk (initrd/initramfs) image?

 

  三、补充tar.lzma
由于LZMA具有优秀的压缩率及占用资源少的特点,越来越多的工具采用lzma进行打包,后缀名为:tar.lzma。
对于Fedora 11 及以后的版本,可以使用下面的命令操作:
压缩

# tar cfv backup.tar.lzma a/dir --lzma 
解压:

# tar xfv backup.tar.lzma --lzma 

如果是CentOS 5.3 等老版本,需要安装独立的lzma 工具或用xz 进行: 
压缩:

# tar cv a/dir | lzma -c -z > backup.tar.lzma 
解压(两个方式都可以):

# cat backup.tar.lzma | lzma -d | tar xv 
# xz -dc backup.tar.lzma | tar xvf -

 

ref:

CentOS7定制封装发行版-基于CentOS minimal

cat buildiso.sh

 

#!/bin/bash
cd repodata
mv *-minimal*-comps.xml comps.xml
ls .|grep -v "comps.xml"|xargs -i rm -f {}
cd ../
createrepo -g repodata/comps.xml ./
declare -x discinfo=`head -1 .discinfo`
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -o/tmp/centos7.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table .

  

Custom Linux bootable CD

How to create a Fedora install ISO for testing 

详解RSYNC 好文

a docker image to custom ISO

Cobbler

Cobbler自动化安装配置实践

posted @ 2018-07-22 23:51  lvmxh  阅读(705)  评论(0编辑  收藏  举报