2014-03-14 12:35:20
标签:
Linux—PXE制作流程图
原创作品,允许转载,转载时请务必以超链接形式标明文章
原始出处 、作者信息和本声明。否则将追究法律责任。
http://il23f.blog.51cto.com/8620950/1376421
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
yum install dhcp -y
[root@localhost ~]# rpm -ql dhcp
/etc/dhcp
/etc/dhcp/dhcpd.conf
subnet
172.16
.
0.0
netmask
255.255
.
0.0
{
range
172.16
.
5.10
172.16
.
5.20
;
option routers
172.16
.
0.1
;
next-server
172.16
.
5.2
;
filename
"pxelinux.0"
;
}
host webserver1 {
hardware ethernet
00
:0C:
29
:8C:C8:A4;
fixed-address
172.16
.
5.100
;
option routers
172.16
.
0.1
;
option domain-name
"http://il23f.blog.51cto.com"
;
option domain-name-servers
172.16
.
0.1
,
8.8
.
8.8
;
}
|
1
2
3
4
5
|
[root@localhost ~]
# ps aux | grep dhcp
dhcpd 1708 0.0 0.8 48908 4308 ? Ss 20:27 0:00
/usr/sbin/dhcpd
-user dhcpd -group dhcpd
root 2844 0.0 0.1 103252 828 pts
/0
S+ 21:51 0:00
grep
dhcp
[root@localhost ~]
# ss -unl | grep :67
UNCONN 0 0 *:67 *:*
|
1
2
3
4
5
6
|
yum -y
install
xinetd tftp-server tftp
chkconfig xinetd on
chkconfig tftp on
service xinetd start
[root@localhost ~]
# ss -unl | grep :69
UNCONN 0 0 *:69 *:*
|
1
2
3
|
mkdir
/var/www/html/centos6
mount
--bind
/media/cdrom
/var/www/html/centos6
service httpd start
|
1
2
3
4
5
6
|
yum -y
install
syslinux
cp
/media/cdrom/images/pxeboot/
{vmlinuz,initrd.img}
/var/lib/tftpboot/
cp
/media/cdrom/isolinux/
{boot.msg,vesamenu.c32,splash.jpg}
/var/lib/tftpboot/
cp
/usr/share/syslinux/pxelinux
.0
/var/lib/tftpboot/
mkdir
/var/lib/tftpboot/pxelinux
.cfg
cp
/media/cdrom/isolinux/isolinux
.cfg
/var/lib/tftpboot/pxelinux
.cfg
/default5
、制作ks.cfg文件
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url=
"http://172.16.5.2/centos6"
repo --name=
"CentOS"
--baseurl=http:
//172
.16.5.2
/centos6
--cost=100
# Root password
rootpw --iscrypted $1$seblmxLh$CowavZZ
/Le1Yc9pWSXSCV/
# System authorization information
auth --useshadow --passalgo=sha512
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone Asia
/Shanghai
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --append=
"crashkernel=auto crashkernel=auto rhgb rhgb quiet quiet"
--location=mbr --driveorder=
"sda"
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all
# Disk partitioning information
part
/boot
--fstype=
"ext4"
--size=200
part / --fstype=
"ext4"
--size=5000
part swap --fstype=
"swap"
--size=1000
%post
echo
-e
'My 51cto blot: http://il23f.blog.51cto.com\n'
>>
/etc/issue
sed
-i
'1,$s@id:[0-9]:initdefault:@id:3:initdefault:@g'
/etc/inittab
[ ! -d
/root/
.
ssh
] &&
mkdir
/root/
.
ssh
&&
chmod
og=---
/root/
.
ssh
cat
>>
/root/
.
ssh
/authorized_keys
<< EOF
EOF
# Enable funcd
sed
-i
's@certmaster =.*@certmaster = 172.16.0.1@g'
/etc/certmaster/minion
.conf
/sbin/chkconfig
funcd off
# Set the hostname
ClientName=`
ifconfig
eth0 |
awk
'/inet addr:/{print $2}'
|
awk
-F.
'{print $NF}'
`
sed
-i
"s@HOSTNAME=.*@HOSTNAME=client$ClientName.il23f.blog.51cto.com@g"
/etc/sysconfig/networks
# set puppet agent
sed
-i
'/\[main\]/a server=il23f.blog.51cto.com'
/etc/puppet/puppet
.conf
/sbin/chkconfig
puppet off
# set hosts
echo
'172.16.0.1 il23f.blog.51cto.com'
>>
/etc/hosts
# yum repo
%end
%packages
@base
@basic-desktop
@chinese-support
@client-mgmt-tools
@core
@desktop-platform
@fonts
@general-desktop
@graphical-admin-tools
@legacy-x
@network-
file
-system-client
@perl-runtime
@remote-desktop-clients
@x11
%end
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
[root@localhost pxelinux.cfg]
# vim default
default vesamenu.c32
#prompt 1
timeout 600
display boot.msg
menu background splash.jpg
menu title Welcome to CentOS 6.5!
menu color border 0
#ffffffff #00000000
menu color sel 7
#ffffffff #ff000000
menu color title 0
#ffffffff #00000000
menu color tabmsg 0
#ffffffff #00000000
menu color unsel 0
#ffffffff #00000000
menu color hotsel 0
#ff000000 #ffffffff
menu color hotkey 7
#ffffffff #ff000000
menu color scrollbar 0
#ffffffff #00000000
label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append initrd=initrd.img ks=http:
//172
.16.5.2
/ks
.cfg
label vesa
menu label Install system with ^basic video driver
kernel vmlinuz
append initrd=initrd.img xdriver=vesa nomodeset
label rescue
menu label ^Rescue installed system
kernel vmlinuz
append initrd=initrd.img rescue
label
local
menu label Boot from ^
local
drive
localboot 0xffff
label memtest86
menu label ^Memory
test
"default"
[
readonly
] 38L, 965C
|