如何創建一個紅帽7.0安裝U盤(適用於Centos 7,Oracle Linux 7)

    我們在安裝最新的紅帽7.0和Centos 7.0以及Oracle Linux 7.0的時候,一般是使用光盤來安裝。當服務器沒有光驅的時候,我們往往需要通過dd直寫U盤來實現,不太靈活。爲了擴充之前的U盤系統安裝盤(參考:如何製作一個通用的多系統安裝U盤) ,我特別添加了紅帽系列系統的最新版 7.0,這個方法也同樣適用於Centos 7.0和Oracle Linux 7.0。下面來看一下製作步驟。

工具準備:

    SYSLINUX   #最新版是6.03

添加主配置文件

    請參考 如何製作一個通用的多系統安裝U盤五(製作主配置文件)

    以及   如何製作一個通用的多系統安裝U盤六(Linux相關配置) 

在/boot/config/linux.cfg 中添加

label redhat70x64
menu label Install Redhat Enterprise Server 7.0 64Bit
kernel /boot/syslinux/vesamenu.c32
append /boot/linux/rh7064/isolinux.cfg /boot/config/mainmenu.cfg

拷貝文件:

    拷貝ISO中的isolinux目錄和p_w_picpaths目錄內容到U盤相應目錄。我這裏是/boot/linux/rh7064。

修改/boot/linux/rh7064/isolinux.cfg文件

default linux
timeout 600

display /boot/linux/rh7064/boot.msg

# Clear the screen when exiting the menu, instead of leaving the menu displayed.
# For vesamenu, this means the graphical background is still displayed without
# the menu itself for as long as the screen remains in graphics mode.
menu clear
menu background /boot/linux/rh7064/splash.png
menu title Red Hat Enterprise Linux 7.0
menu vshift 8
menu rows 18
menu margin 8
#menu hidden
menu helpmsgrow 15
menu tabmsgrow 13

# Border Area
menu color border * #00000000 #00000000 none

# Selected item
menu color sel 0 #ffffffff #00000000 none

# Title bar
menu color title 0 #ff7ba3d0 #00000000 none

# Press [Tab] message
menu color tabmsg 0 #ff3a6496 #00000000 none

# Unselected menu item
menu color unsel 0 #84b8ffff #00000000 none

# Selected hotkey
menu color hotsel 0 #84b8ffff #00000000 none

# Unselected hotkey
menu color hotkey 0 #ffffffff #00000000 none

# Help text
menu color help 0 #ffffffff #00000000 none

# A scrollbar of some type? Not sure.
menu color scrollbar 0 #ffffffff #ff355594 none

# Timeout msg
menu color timeout 0 #ffffffff #00000000 none
menu color timeout_msg 0 #ffffffff #00000000 none

# Command prompt text
menu color cmdmark 0 #84b8ffff #00000000 none
menu color cmdline 0 #ffffffff #00000000 none

# Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message.

menu tabmsg Press Tab for full configuration options on menu items.

menu separator # insert an empty line
menu separator # insert an empty line

label linux
  menu label ^Install Red Hat Enterprise Linux 7.0
  kernel /boot/linux/rh7064/vmlinuz
  append initrd=/boot/linux/rh7064/initrd.img repo=hd:LABEL=OEMDRV:/boot/linux/rh7064 quiet   #改爲通過repo指定iso路徑

label check
  menu label Test this ^media & install Red Hat Enterprise Linux 7.0
#  menu default
  kernel /boot/linux/rh7064/vmlinuz
  append initrd=/boot/linux/rh7064/initrd.img repo=hd:LABEL=OEMDRV:/boot/linux/rh7064 rd.live.check quiet #改爲通過repo指定iso路徑

menu separator # insert an empty line

# utilities submenu
menu begin ^Troubleshooting
  menu title Troubleshooting

label vesa
  menu indent count 5
  menu label Install Red Hat Enterprise Linux 7.0 in ^basic graphics mode
  text help
	Try this option out if you're having trouble installing
	Red Hat Enterprise Linux 7.0.
  endtext
  kernel /boot/linux/rh7064/vmlinuz
  append initrd=/boot/linux/rh7064/initrd.img repo=hd:LABEL=OEMDRV:/boot/linux/rh7064 xdriver=vesa nomodeset quiet

label rescue
  menu indent count 5
  menu label ^Rescue a Red Hat Enterprise Linux system
  text help
	If the system will not boot, this lets you access files
	and edit config files to try to get it booting again.
  endtext
  kernel /boot/linux/rh7064/vmlinuz
  append initrd=/boot/linux/rh7064/initrd.img repo=hd:LABEL=OEMDRV:/boot/linux/rh7064 rescue quiet

label memtest
  menu label Run a ^memory test
  text help
	If your system is having issues, a problem with your
	system's memory may be the cause. Use this utility to
	see if the memory is working correctly.
  endtext
  kernel /boot/linux/rh7064/memtest

menu separator # insert an empty line

label local
  menu label Boot from ^local drive
  localboot 0xffff

menu separator # insert an empty line
menu separator # insert an empty line

label returntomain
  menu label Return to ^main menu
  menu exit

menu end

注:參數的具體含義請參考之前的系列文章。

 

   其實,紅帽7的ISO和之前的6.x相似,只是經過了一個特殊的處理。添加了 

inst.stage2=hd:LABEL=RHEL-7.0\x20Server.x86_64

標籤。inst.stage2是指定 install.img 的路徑的。如果沒有指定的話,Anaconda會從本地、inst.repo或repo或method參數給出的路徑來查找。而且新版的7.0已經不推薦使用method參數了,代替method的是repo或inst.repo參數。所以,我們只要用repo或inst.repo來取代inst.stage2就可以了。最後,預祝大家都能夠成功。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章