如何创建一个红帽7.0安装U盘(适用于Centos 7,Oracle Linux 7)
admin
2023-05-12 02:41:27
0

    我们在安装最新的红帽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就可以了。最后,预祝大家都能够成功。

相关内容

热门资讯

打造AI影像协作实验场 上影节... 上海国际电影节全新单元“AI片场”开机 打造AI影像协作实验场 “我做AI电影已经两年了。”德国AI...
我国首次成功批量克隆超高产奶山... 西北农林科技大学14日向新华社记者独家披露,学校羊遗传改良与生物育种创新团队攻克关键核心技术,6只超...
医学院硕博研究生靠虚开发票冒签... 33岁的柴某系江苏人,案发前系某医院博士后研究人员。一审法院认定,2018年至2023年,柴某在某医...
京东618自营电脑桌椅服务升级... 随着京东心动购物季开启,职场人、居家办公族及电竞爱好者的“久坐刚需”升级需求集中释放,电脑桌椅品类迎...
扎波罗热核电站遭乌军袭击,两名... 当地时间5月14日,扎波罗热核电站官方通报称,乌克兰武装部队的无人机对核电站周边区域发动袭击。在距离...
储殷:“建设性稳定关系”涵盖了... 特朗普率高规格代表团访华,中方也是高规格接待。中美今天的互动总体呈现出什么特点?这次元首外交又将如何...
中科信息称目前没有研发具身机器... 瑞财经 严明会 5月13日,中科信息在路演活动中表示,公司目前没有研发具身机器人,现有机器人主要面向...
按下物理AI加速键!香港成全球... 近日,首届香港具身智能产业峰会暨智元APC2026(香港)召开,标志着具身智能从技术炫技正式转向生产...
内塔尼亚胡称将对《纽约时报》提... 新华社耶路撒冷5月14日电(记者庞昕熠 冯国芮)以色列总理办公室14日发表声明称,由于美国《纽约时报...
黄仁勋最后一刻从“局外人”变“... 黄仁勋在最后一刻登上飞往北京的总统专机,从原本的“局外人”瞬间变成“座上宾”。这段场景的背后到底有哪...