It's too late to be automated! Youyun teaches you how to create CentOS-based product images in four steps.

Source: Internet
Author: User
Tags rpmbuild

It's too late to be automated! Youyun teaches you how to create CentOS-based product images in four steps.
 

As Linux programs increase, the following problems often occur during software installation:

 

1. install systems and software in batches in a similar or similar hardware configuration to achieve automatic installation and reduce installation time and human error.

 

2. Engineers install systems and software on different customer sites (with different hardware configurations). Due to hardware differences, automation is not easy.

 

In view of the above scenarios, the author puts forward the following solutions from the standpoint of improving production efficiency and reducing misoperations, hoping to achieve the purpose of attracting others, and conduct in-depth discussions with colleagues to find out the shortcomings.

 

Background Knowledge

 

Anaconda is an installation Management Program for Linux such as RedHat, CentOS, and Fedora. It provides installation management methods such as text and graphics, and supports scripts such as Kickstart to provide automatic installation. During custom installation, it provides a custom interface that allows you to select the language, keyboard, time zone, and other information ).

 

AnacondaSupported management modes:

 

(1) Kickstart provides automated installation;

 

(2) Implement upgrade for a RedHat.

 

Available installation methods: Local CDROM, USB, and network (NFS, FTP, and HTTP.

 

For Kickstart, it is a method for automatic Server installation using Anconda tool. Use the generated kickstart configuration file ks. cfg, which enables non-interactive (unattended) Installation configuration from bare metal to full-featured services; ks. cfg is a simple text file, the file contains some necessary configuration information (such as keyboard settings, language settings, and partition settings) That Anconda needs to obtain when installing the system and configuring the service after installation ).

 

Anconda directly reads the necessary configurations from the file. As long as the file information is correctly configured and meets all system requirements, it no longer needs to interact with users to obtain information, so as to automate the installation. Once selected, the installation continues in non-interactive mode. With kickstart, you can achieve streamlined and automated installation, enforce consistency (software packages, partitions, configuration, monitoring, and security), and reduce human deployment errors.

 

CentOSCustom Method

 

Step 1: Prepare the software installation package (rpm)

· Program for packaging and development

· Create a SPEC File

· Use the rpmbuild command to generate an rpm package

 

 

Rpmbuild-bb/root/rpmbuild/SPECS/apm_c.spec

Generating apm_c-2.5.0-1.x86_64.rpm

 

Step 2: Customize the kickstart configuration file

· Customize the isolinux/isolinux. cfg file

 

 

· Configure ks. cfg

 

 

Step 3: Customize the installation Interface

 

· Configure repodata/xxx-comps.xml files

 

· Configure the install. imgfile

 

 

 

Step 4: regenerate the iso Image File

 

Use the mkisofs command to regenerate the image file

 

--- I am a split line ---

The author introduced: Yao Huilong, who has been working on cloud software and has been engaged in software customization development for more than 10 years. He has experienced development of information systems in the C/S architecture and web applications in the B/S architecture, he is also engaged in the development of Linux applications and kernel programs.

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.