国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統(tǒng) > Linux > 正文

如何配置Kickstart腳本以便更好的安裝系統(tǒng)

2020-06-13 11:34:08
字體:
供稿:網(wǎng)友

  我們都知道,kickstart可用來自動化安裝Linux系統(tǒng),比手動安裝速度更快,但是為了更好的安裝系統(tǒng),需要對kickstart腳本進(jìn)行配置,下面小編就給大家介紹下配置kickstart腳本的方法,一起來學(xué)習(xí)下吧。

  配置kickstart腳本的方法

  ###############################################################

  #

  # 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 腳本設(shè)計(jì)

  Kickstart 腳本通常有三個不同的部分。

  :   命令部分

  :   軟件包部分

  :   安裝后腳本部分

  Anaconda 會忽略Kickstart 腳本中所有以“#”開始的行和空行。

  命令部分

  從文件的最開始直到出現(xiàn)以%packages 開始的行,這一部分都屬于命令部分。命令行必須以可識別的關(guān)鍵字開始,并且所有與該關(guān)鍵字有關(guān)的參數(shù)都必須出現(xiàn)在同一行中。命令部分是用來指定安裝程序需要的除軟件選項(xiàng)外的所有標(biāo)準(zhǔn)信息。關(guān)鍵字在命令部分可以以任意次序出現(xiàn)。

  軟件包部分(%packages)

  軟件包部分是用來指定需要安裝的軟件。這部分從以%packages 開頭的行開始,直到下

  一個以“%”字符開始的行為止。這一部分通常采用以下兩種格式之一。

  :   @Component Name

  :   package-name

  第一種格式是用軟件組來指定軟件,在這里一定要注意正確拼寫軟件組名稱,并注意大小寫。

  第二種格式是用來指定要安裝的軟件包的具體名稱。如果%packages 行包含額外的--resolvedeps 參數(shù),那么也會安裝解決相依性的軟件包。

  安裝后腳本部分(%post)

  后處理部分是在沒有 Anaconda 安裝程序參與下,執(zhí)行所有新安裝系統(tǒng)的機(jī)器的自定義過程。執(zhí)行這部分內(nèi)容與在新安裝系統(tǒng)的機(jī)器的環(huán)境下運(yùn)行 Bash Shell 腳本的效果是一樣的。如果是網(wǎng)絡(luò)安裝,那么執(zhí)行前面提到作為實(shí)例的腳本也可以激活網(wǎng)絡(luò)配置。

  上面就是kickstart腳本配置的方法介紹了,可以知道,kickstart腳本主要分為三個部分,需要對命令、軟件包、安裝后腳本這三個部分進(jìn)行處理。


發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 兴文县| 常州市| 镇安县| 宁明县| 舞钢市| 和林格尔县| 柳江县| 江都市| 松潘县| 金阳县| 丘北县| 南岸区| 南陵县| 仙居县| 吐鲁番市| 彝良县| 昌乐县| 三江| 改则县| 阳朔县| 巴塘县| 恩施市| 革吉县| 榕江县| 札达县| 西充县| 陆河县| 礼泉县| 平和县| 卢龙县| 腾冲县| 儋州市| 和顺县| 横山县| 安泽县| 铜陵市| 涿州市| 舞阳县| 五家渠市| 苍南县| 五河县|