Linux Custom ISO

Source: Internet
Author: User

Due to the frequent need to install the server, manual operation is too verbose, sometimes do not need to install the network or other environment, so found some ways to customize the Linux ISO. That is, the need to install the package, need to plan the partition and so on information, customized in the ISO, through the ISO automatic installation.

1. Create an ISO file path

Create the ISO directory under root and

[Email protected] ~]# mkdir ISO

[Email protected] ~]# Mkdir-pv/root/iso/centos


2. Create the package list file required for system installation

[[email protected] ~]# awk '/^install/{print $ ' install.log | sed s '/^[0-9]*://g ' > Packages.txt

3. Create a script that automatically copies packages to CentOS


#!/bin/bash

File=/root/packages.txt

Dest_dir=/root/iso/centos

Src_dir=/media/cdrom/centos

While Read LIN

Do

CP $SRC _dir/$LINE. RPM $DEST _dir | | echo "$LINE didn ' t cp:" >> cperr.txt

Done < $FILE

4. Copy other files required for system installation

[Email protected] ~]# cd/media/cdrom/

[Email protected] cdrom]# cp-r discinfo. Treeinfo images/isolinux/repodata/rpm-gpg-key-centos6 EULA Gpl/root/iso


5. Edit Isolinux.cfg Select the Ks file to start

The changes are as follows:

Default Linux Ks=cdrom:/ks.cfg


6. Copy KS and modify

[email protected] ~]# CP anaconda-ks.cfg/root/iso/ks.cfg

[Email protected] ~]# cd/root/iso/

7. Modify the KS file


[Email protected] iso]# VI ks.cfg

#platform =x86, AMD64, or Intel EM64T

#version =devel

# Firewall Configuration

Firewall--enabled--ssh


# Install OS instead of upgrade

Install


# Use NFS installation media

# Root Password


ROOTPW--iscrypted $6$mzz3bxzsxnr0f8/x$ecsipyvr5smqiqgvcgvv2n5kaq7ff7zo5qtotejbrjjnm8qkqi.emor8jy8rav/ulvd/fomu/ am2v21y. /7f.


# System Authorization Information

Auth--useshadow--passalgo=sha512


# Use text mode install

Text


# System Keyboard

Keyboard US


# System Language

Lang en_US


# SELinux Configuration

SELinux--disabled


# Do not configure the X Window System

Skipx


# Installation Logging Level

Logging--level=info


# Reboot after installation

Reboot


# System TimeZone

TimeZone--ISUTC Asia/shanghai


# Network Information

Network--bootproto=dhcp--device=eth0--onboot=on


# System Bootloader Configuration

Bootloader--LOCATION=MBR


# Clear the Master Boot Record

Zerombr


# Partition Clearing Information

Clearpart--all--initlabel


# Disk Partitioning Information

Part swap--size=2048

Part/--FSTYPE=EXT4--grow--size=200


%packages

@base

@core

@development

@server-policy

Sgpio

%end


8. Install the required package for the production CD

# yum-y Install Createrepo mkisofs

9. Create a library file under/root/iso

[Email protected] iso]# createrepo-g repodata/0daea8dcs23-x86_64-comps.xml. /iso

10. Generating image files

[Email protected] iso]# mkisofs-o Dawacentos6_x86_64.iso-b isolinux/isolinux.bin-c isolinux/boot.cat-no-emul-boot

-boot-load-size 4-boot-info-table-r-j-v-t/root/iso/


Add:


Additional note: Mkisofs can make the specified directory and files into an ISO 9660 format image file for burning discs.


Parameters

-A or--all mkisofs typically do not process backup files. Use this parameter to add the backup file to the image file.

-a< application id> or-appid< application id> the application ID of the specified disc.

-abstract< Summary File > Specifies the file name of the digest file.

-b< boot image file > or-eltorito-boot< boot image file > Specify the boot image file that is required to make the bootable CD.

-BIBLIO<ISBN File > Specify the file name of the ISBN file, and the ISBN file is located in the CD root directory, recording the CD's ISBN.

-c< boot file name > when making a bootable CD, Mkisofs will make a file with the full-eltorito-catalog< boot file name > all the contents of the boot image file.

-c< area number, area number > This parameter must be used when compositing a number of sections into an image file.

-copyright< Copyright Information File > Specify the file name of the copyright information file.

-D or-omit-period the period after the file is omitted.

-D or-disable-deep-relocation ISO 9660 can handle up to 8 levels of catalogs, more than 8 layers, and Rrip automatically set them to ISO 9660 compatible formats. Use the-d parameter to turn off this feature.

-F or-follow-links ignores symbolic connections.

-h displays Help.

-hide< the directory or file name > hide the specified directory or files in an ISO 9660 or rock ridgeextensions system.

-hide-joliet< directory or file name > make the specified directory or files hidden in the Joliet system.

-j or-joliet Use the Joliet format for directories and file names.

-L or-full-iso9660-filenames use a file name of ISO 9660 32 character length.

-L or-allow-leading-dots allows the first character of the file name to be a period. Http://www.linuxso.com/command/mkisofs.html

-log-file< Record File > If there is an error message during execution, the preset will be displayed on the screen.

-m< directory or file name > or-exclude< directory or file name > specified directory or file name will not be included in the image file.

-m< image File > or-prev-session< image file > Merge with the specified image file.

-N or-omit-version-number omit version information from the ISO 9660 file.

-o< image File > or-output< image file > Specify the name of the image file.

-p< Data Processor > or-preparer< Data Processor > record CD-ROM data processor.

-print-size Displays the estimated file system size.

-quiet does not display any information when it executes.

-R or-rational-rock use rock Ridge Extensions and open read access to all files.

-R or-rock use rock Ridge Extensions.

-sysid< system id> Specifies the system ID of the disc.

-T or-translation-table a conversion table for file names, for systems that do not support rock Ridge extensions.

-V or-verbose displays detailed information when executed.

-v< disc id> or-volid< disc id> the album set ID of the specified disc.

-volset-size< total number of discs > Specify the number of discs that are included in the volume book set.

-volset-seqno< Volume Serial number > Specify the number of discs in the volume book set.

-x< directory > The specified directory will not be placed in the image file.

-Z Establish a SUSP record of the permeability compressed file, which is currently only valid on the Alpha machine.


This article is from the "OPS rookie" blog, please be sure to keep this source http://ckl893.blog.51cto.com/8827818/1682280

Linux Custom ISO

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.