Get the App
SLTechnology News&Howtos  ›  Servers  › 

Ways to configure Kickstart scripts to better install the system

Shulou Source: shulou.com Published: 2022-06-01 07:53:35 09月15日 Update

This article mainly explains the "configuration of Kickstart scripts in order to better install the system", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "configure Kickstart scripts in order to better install the system" bar!

How to configure kickstart scripts

# # #

#

# Sample Kickstart Configuration File

#

# # #

# # #

#

# point to a local installation server, or use "cdrom"

#

# # #

Url-- url http://rha-server/pub/rhel5/

# cdrom

Rootpw RedHat

Bootloader-location=mbr-password=redhat

# # #

#

# partitioning

#

# # #

Zerombr yes

Clearpart-all-initlabel

Part / boot-- fstype ext3-- size 128

Part /-- fstype ext3-- size 1-- grow

Part swap-recommended

# # #

#

# network configuration

#-the following is for the "recommended solution" outlined

# in the Red Hat Academy Instructor's Guide

#

# # #

Network-bootproto=dhcp-device=eth0

Firewall-disabled

# network-bootproto=static-ip=192.168.0.254-netmask=255.255.255.0

-- device=eth0

# firewall-medium-http-port=https:tcp

# # #

#

# environment

#

# # #

Lang zh_CN.UTF-8

Timezone Asia/Shanghai

# # #

#

# hardware

#

# # #

Keyboard us

Xconfig-startxonboot

# # #

# misc

# # #

Key-skip # skip install number

Authconfig-enableshadow-enablemd5

Reboot # reboot automatically when done

Install # instead of "upgrade"

# # #

#

# Software

#

# # #

% packages-- resolvedeps

@ admin-tools

@ editors

@ text-internet

@ gnome-desktop

@ core

@ base

@ base-x

@ chinese-support

@ sound-and-video

@ graphical-internet

Emacs

Kexec-tools

Device-mapper-multipath

Xorg-x11-utils

Xorg-x11-server-Xnest

-sysreport

% post

# # #

#

# Post Script-the following script runs on the newly

# installed machine, immediately after installation

#

# # #

Echo "nameserver 192.168.0.254" / etc/resolv.conf

Rpm-ivh ftp://rha-server/rha/autoupdate/rha-base*.rpm

# rpm-Fvh ftp://Kickstart.example.com/pub/9/i386/updates/*.rpm

# curl http://rha-server/rha/xorg.conf "/ etc/X11/xorg.conf

# curl http://rha-server/rha/station.cfg | tar xvzf-

For i in elvis blondie prince madonna; do

Useradd $I

Echo redhat | passwd-- stdin $I

Done

Kickstart script design

Kickstart scripts usually have three different parts.

Command section

: software package section

Post-installation script section

Anaconda ignores all lines and blank lines that start with "#" in the Kickstart script.

Command section

This section belongs to the command section from the beginning of the file until the line that starts with% packages appears. The command line must start with a recognizable keyword, and all parameters related to that keyword must appear on the same line. The command section is used to specify all the standard information required by the installer, except for the software options. Keywords can appear in any order in the command section.

Package section (% packages)

The package part is used to specify the software that needs to be installed. This section starts with the line starting with% packages and goes down

Ends with a line that begins with the "%" character. This section is usually in one of two formats.

: @ Component Name

: package-name

The first format is to use the software group to specify the software. Be sure to spell the software group name correctly and pay attention to the case here.

The second format is used to specify the specific name of the package to be installed. If the% packages line contains an additional-- resolvedeps parameter, a package that addresses dependencies will also be installed.

Post-installation script section (% post)

The post-processing part performs the customization process for all newly installed machines without the participation of the Anaconda installer. Executing this section has the same effect as running the Bash Shell script on the machine on which the newly installed system is installed. If it is a network installation, executing the script mentioned earlier as an example can also activate the network configuration.

Thank you for reading, the above is the content of "configuring Kickstart scripts to better install the system". After the study of this article, I believe you have a deeper understanding of the problem of configuring Kickstart scripts to better install the system, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Script software part system configuration command method software package key keyword content format learning parameter name backfoot home machine program network Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux macOS OPPO Reno Huawei Docker