DIY CentOS 6.4 one-click self-installation ISO image CD

Source: Internet
Author: User

Today, I talked to my friend about how to create an automatic installation CD for CentOS. I just sent out my previous test process. Hope to help you.

I sent my work record when I did it. Because I used it at work, I added some required software packages and other things. In fact, you can play it freely and install the system directly, an Optimized LNMP and many other software systems that have been installed are also completely possible. Think about the one-click installation of ISO on the internet...

So everyone cheers! In the future, I will also improve the specific comments of this article.


Download CentOS-6.4-x86_64-minimal.iso

1 http: //mirrors.163.com/centos/6.4/isos/x86_64/CentOS-6.4-x86_64-minimal.iso


Procedure:

1234567 1. Install a clean operating system, including basic systems and required tools. For example, for http, mysql, and other software, it is recommended to install it by compiling and then package it in to reduce the trouble of many dependent packages. 2. After installing the system, collect the software packages installed in the system and use scripts to uniformly store them in a directory. 3. Copy the images image on the installation disc and start centos from the disc to install the required files. 4. define your own kickstart installation script. 5. Re-generate the report information of the CD based on the previously stored software (rpm) package. 6. Package and generate an ISO file and an MD5 verification code.


CD structure:

1234 * The isolinux directory stores the installation interface information when the CD is started. * The images directory contains the necessary startup image files. * The CentOS directory stores the installation package and information. * The discinfo file is the identifier of the installation price.


During installation, the first option is text automatic installation by default, or the second option can be selected for manual installation...

After the installation is complete, the ISO:

IP Address: 192.168 . 7.110

Root Password: nopassword


Operation Process record:


(1) Attach the CD and use scripts to copy related software Packages to the/ISO/Packages directory.

[root@CentOS ~]# mkdir /mnt/cdrom [root@CentOS ~]# mount  /dev/cdrom  /mnt/cdrom [root@CentOS~]# /usr/bin/rsync -a --exclude=Packages/ --exclude=repodata/ /mnt/cdrom/  /ISO/ [root@CentOS ~]# mkdir -p /ISO/{Packages,repodata} [root@CentOS ~]# vi copy.sh #!/bin/bash cd /rootawk '/Installing/{print $2}' install.log | sed 's/^*://g' >package.txt DVD='/mnt/cdrom/Packages'PACKDIR='/root/package.txt'NEW_DVD='/ISO/Packages'while read LINE docp ${DVD}/${LINE}*.rpm /${NEW_DVD} || echo "$LINE don't cp......."done < package.txt rm -f package.txt [root@CentOS ~]# chmod +x copy.sh [root@CentOS ~]# ./copy.sh [root@CentOS ~]# ll /ISO/Packages/ |wc -l 285

(2) customize the kickstart installation script ks. cfg and modify the/ISO/isolinux. cfg file. By default, the permission of isolinux. cfg is 444, which can only be read and cannot be modified.

[root@CentOS ~]# cd /ISO [root@CentOS ISO]# cp ~/anaconda-ks.cfg isolinux/ks.cfg [root@CentOS ISO]# vi  isolinux/ks.cfg [root@CentOS ISO]# chmod 644 isolinux/isolinux.cfg [root@CentOS ISO]# vi isolinux/isolinux.cfg [root@CentOS ISO]# chmod 444  isolinux/isolinux.cfg

(3) install anacondarepodatacreaterepomkisofs and other tools, execute the createrepo program to generate the comps. xml file under repodata

[root@CentOS ISO]# yum -y install anaconda repodata createrepo mkisofs rsync [root@CentOS ISO]# cp /mnt/cdrom/repodata/*-minimal-x86_64.xml  /ISO/repodata/minimal-x86_64.xml [root@CentOS ISO]# createrepo -g repodata/minimal-x86_64.xml ./ 285/285 - Packages/audit-libs-2.2-2.el6.x86_64.rpm                         Saving Primary metadata Saving file lists metadata Saving other metadata [root@CentOS ISO]# declare -x discinfo=`head -1 .discinfo` [root@CentOS ISO]# echo $discinfo 1341569670.539525 [root@CentOS ISO]# createrepo -u "media://$discinfo" -g repodata/minimal-x86_64.xml . 285/285 - Packages/audit-libs-2.2-2.el6.x86_64.rpm                         Saving Primary metadata Saving file lists metadata Saving other metadata [root@CentOS ISO]# ll repodata/ total 724 -rw-r--r--. 1 root root 266266 Jul 17 02:30 filelists.xml.gz -rw-r--r--. 1 root root  11334 Jul 17 02:30 minimal-x86_64.xml -rw-r--r--. 1 root root   1387 Jul 17 02:30 minimal-x86_64.xml.gz -rw-r--r--. 1 root root 183083 Jul 17 02:30 other.xml.gz -rw-r--r--. 1 root root 265795 Jul 17 02:30 primary.xml.gz -rw-r--r--. 1 root root   2125 Jul 17 02:30 repomd.xml

(4) use the mkisofs command to generate an ISO file

[root@CentOS ISO]# mkisofs -o CentOS-6.4_64.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T /ISO/ I: -input-charset not specified, using utf-8 (detected in locale settings) genisoimage 1.1.9 (Linux) Scanning /ISO/Scanning /ISO/EFIScanning /ISO/EFI/BOOTExcluded: /ISO/EFI/BOOT/TRANS.TBL Excluded: /ISO/EFI/TRANS.TBL Scanning /ISO/repodataScanning /ISO/imagesExcluded: /ISO/images/TRANS.TBL Scanning /ISO/isolinuxExcluded: /ISO/isolinux/TRANS.TBL Excluded by match: /ISO/isolinux/boot.cat…………………………………………. 98.05% done, estimate finish Tue Jul 17 02:43:01 2012 Total translation table size: 81205 Total rockridge attributes bytes: 35197 Total directory bytes: 59644 Path table size(bytes): 96 Done with: The File(s)                             Block(s)    203755 Writing:   Ending Padblock                         Start Block 203836 Done with: Ending Padblock                         Block(s)    150 Max brk space used 65000 203986 extents written (398 MB)

(5) generate the ISO file MD5 Value

[root@CentOS ISO]# /usr/bin/implantisomd5 /ISO/CentOS-6.4_64.iso Inserting md5sum into iso image... md5 = 1355f3a08334162777e6ad867c448d2e Inserting fragment md5sums into iso image... fragmd5 = a832435cd7aeb593363287aa551476c9dd21be459aada4c29e9f3475da1e frags = 20 Setting supported flag to 0 [root@CentOS ISO]#

The content of the isolinux. cfg file is as follows:

Default vesamenu. c32 # prompt 1 timeout 100 ### 10 seconds display boot. msg menu background splash.jpg menu title Welcome to use CentOS 6.4! Menu color border 0 # ffffffff #00000000 menu color sel 7 # ffffffff # ff000000 menu color title 0 # ffffffff #00000000 menu color tabmsg 0 # ffffffff #00000000 menu color unsel 0 # ffffffff #00000000 menu color hotsel 0 # ff000000 # ffffffff menu color hotkey 7 # ffffffff # ff000000 menu color scrollbar 0 # ffffffff #00000000 label linux menu label ^ Auto Install Xlogin Linux System menu default kernel vmlinuz append ks = cdrom: /isolinux/ks. cfg initrd = initrd. img ### ks file path label vesa menu label Install system with ^ basic video driver kernel vmlinuz append initrd = initrd. img xdriver = vesa nomodeset label rescue menu label ^ Rescue installed system kernel vmlinuz append initrd = initrd. img rescue label local menu label Boot from ^ local drive localboot 0 xffff label memtest86 menu label ^ Memory test kernel memtest append-

The above is all the operations of ISO production. It seems simple enough! The attachment contains the ks file. I hope this article will help you!

Finally, find a tool such as winscp to transfer the ISO file to the local machine, and you can install it on a dial...

This article is from the "bug blog" blog, please be sure to keep this source http://xlogin.blog.51cto.com/3473583/1261632

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.