centos系統啟動文件詳解:
注:在centos6里需要給NetworkManager服務關閉並且禁止開機啟動,6和7里都需要將selinux關閉,否則會出現網絡配置異常情況,並且要將防火牆關閉。
bootloader#加載硬盤引導二進制文件-->kernel(initramfs)#讀取啟動系統的內核必須文件-->rootfs#加載文件系統及根目錄-->/sbin/init #讀取系統進程二進制文件
在系統光盤的目錄里有個isolinux文件夾,這里放的就是系統從上邊啟動流程的第一到第三階段所需要的引導文件
其中isolinux文件夾文件如下:
1 -r--r--r--. 1 root root 2048 Dec 5 2016 boot.cat #二進制文件 光盤啟動時用到的MBR信息文件 2 -rw-r--r--. 1 root root 84 Dec 5 2016 boot.msg #系統啟動提示信息 3 -rw-r--r--. 1 root root 293 Dec 5 2016 grub.conf #選擇啟動系統后,在此文件里定義啟動系統需要加載的內核文件,initrd.img和vmlinuz 4 -rw-r--r--. 1 root root 43372552 Dec 5 2016 initrd.img #initrd.img是一個小的映象,包含一個最小的linux系統,啟動必須 5 -rw-r--r--. 1 root root 24576 Dec 5 2016 isolinux.bin #二進制文件,光盤引導時第二個階段文件 6 -rw-r--r--. 1 root root 3068 Dec 5 2016 isolinux.cfg #光盤啟動開始的選擇菜單界面文件每個對應的菜單選項配置文件 7 -rw-r--r--. 1 root root 190896 Nov 6 2016 memtest #內存檢測選項需要用的程序 8 -rw-r--r--. 1 root root 186 Oct 1 2015 splash.png #系統選擇界面的背景圖片 9 -r--r--r--. 1 root root 2215 Dec 5 2016 TRANS.TBL 10 -rw-r--r--. 1 root root 152976 Nov 6 2016 vesamenu.c32 #系統選擇菜單的背景風格 11 -rwxr-xr-x. 1 root root 5392080 Nov 23 2016 vmlinuz #系統啟動時用到的內核文件
isolinux.cfg的內容如下:
1 default vesamenu.c32 #默認選擇菜單的背景風格 2 timeout 600 #菜單界面的延時參數 3 4 display boot.msg 5 menu clear 6 menu background splash.png 7 menu title CentOS Linux 7 8 menu vshift 8 9 menu rows 18 10 menu margin 8 11 #menu hidden 12 menu helpmsgrow 15 13 menu tabmsgrow 13 14 15 menu tabmsg Press Tab for full configuration options on menu items. 16 17 menu separator # insert an empty line 18 menu separator # insert an empty line 19 20 label linux ==========================================#虛線區間為可見的選擇項內容 21 menu label ^Install CentOS Linux 7 #字母前加^,可實現按快捷鍵跳轉到此項 22 kernel vmlinuz 23 append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 quiet 24 25 label check 26 menu label Test this ^media & install CentOS Linux 7 27 menu default 28 kernel vmlinuz 29 append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rd.live.check quiet #參數 30 31 menu separator # insert an empty line 32 33 # utilities submenu 34 menu begin ^Troubleshooting 35 menu title Troubleshooting 36 37 label vesa 38 menu indent count 5 39 menu label Install CentOS Linux 7 in ^basic graphics mode 40 text help 41 Try this option out if you're having trouble installing 42 CentOS Linux 7. 43 endtext 44 kernel vmlinuz 45 append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 xdriver=vesa nomodeset quiet 46 47 label rescue 48 menu indent count 5 49 menu label ^Rescue a CentOS Linux system 50 text help 51 If the system will not boot, this lets you access files 52 and edit config files to try to get it booting again. 53 endtext 54 kernel vmlinuz 55 append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rescue quiet 56 57 label memtest 58 menu label Run a ^memory test #內存檢測選項 59 text help 60 If your system is having issues, a problem with your 61 system's memory may be the cause. Use this utility to 62 see if the memory is working correctly. 63 endtext 64 kernel memtest 65 66 menu separator # insert an empty line 67 68 label local 69 menu label Boot from ^local drive 70 localboot 0xffff #從硬盤啟動選項 71 =========================================#虛線中間內容為可見的菜單選擇項內容 72 menu separator # insert an empty line 73 menu separator # insert an empty line 74 75 label returntomain 76 menu label Return to ^main menu 77 menu exit 78 79 menu end
#默認啟動到選擇界面是GUI模式,可以按TAB進入TUI模式,1,按TAB鍵,在后邊增加TEXT 2,按ESC鍵,boot:linux text
3 修改anaconda-ks.cfg安裝流程應答文件詳解
命令段:指明各種安裝前配置,如鍵盤類型等
程序包段:指明要安裝的程序包組或程序包,不安裝的程序包等
%packages
@group_name #組名
package #安裝包名
-package
%end
腳本段:
%pre: 安裝前腳本
運行環境:運行於安裝介質上的微型Linux環境
%post: 安裝后腳本
運行環境:安裝完成的系統
#這個kickstart文件可以用原有的anaconda-ks.cfg修改使用,也可以用工具system-config-kickstart來配置,這個包在系統光盤里有,yum install 即可安裝,它依賴圖形界面的包組。
安裝完之后運行system-config-kickstart組件,修改配置應答文件項目。
#如果配置文件有錯誤,自己找又找不到,則可以利用一個命令在排錯
ksvalidator /xxxx/xxxx/ks.cfg 命令加配置文件路徑
進行完這些步驟,然后點左上角的FILE 保存到你想保存的目錄即可,默認是ks.cfg名字,可以打開對其進行二次修改,在需要安裝的包組里面最基本的需要裝這幾個包組
%packages #安裝包組列表
@base
@core
@workstation-policy
@basic-desktop
autofs
vim
%end #結束符
尤其是前三個,缺少一個安裝過程中有可能會卡在哪里。
###在這里重要事情說三遍,如果要在centos7上使用此軟件,則要在yum倉庫配置文件內容base名字必須要用development,不然會導致軟件包哪里無法選擇安裝。
[development] #就是這一行
name=development
baseurl=file:///xx/xx/xx
gpgcheck=0
==========================================================
前期准備工作差不多了,下一篇將會介紹如何利用這個配置文件進行網絡安裝。