0
点赞
收藏
分享

微信扫一扫

centos 自动 部署 系统 U盘

软件共享软件 2022-08-10 阅读 258


openssl passwd -1 -salt 'root' '123456'
## 生成密码用的密码
就是 rootpw --iscrypted 后面的

ks.cfg

text
skipx
firstboot --enable
keyboard --vckeymap=us --xlayouts='us'
lang en_US.UTF-8
selinux --disabled
firewall --disabled
cdrom
auth --enableshadow --passalgo=sha512
rootpw --iscrypted $1$root$12312312312312312312.
services --disabled="NetworkManager" --enabled="network,chronyd"
timezone Asia/Shanghai --isUtc --nontp

clearpart --all --initlabel

part /boot --fstype ext4 --size 1024
part / --fstype ext4 --size 1 --grow

reboot --eject --kexec

%packages
@^minimal
@core
%end

isolinux.cfg


default vesamenu.c32
timeout 100

display 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 splash.png
menu title CentOS 7
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-auto
menu label ^Auto Install CentOS 7
menu default
kernel vmlinuz
append initrd=initrd.img ks=cdrom:/isolinux/ks.cfg quiet net.ifnames=0 biosdevname=0

label linux
menu label ^Install CentOS 7
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 quiet net.ifnames=0 biosdevname=0



下载一个centos7镜像, 删除里面 isolinux/isolinux.cfg
把上面2个文件 保存到isolinux/下面

重新生成U盘。 就可以自动装系统。
一共2个选项。下面的是手动装。

举报

相关推荐

0 条评论