分类: WINDOWS
2008-05-12 12:57:41
CODE:
#yum install tftp-server tftp
经过这个操作后,你的机器安装了tftp server和tftp clinet这么两个包,安装tftp clinet是为了更好的测试tftp server是否work,直接tftp localhost,可以免去防火墙配置错误导致tftp不正常工作。CODE:
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -m /tftpboot/rules -s /tftpboot
per_source = 11
cps = 100 2
flags = IPv4
}
增加了/tftpboot/rules文件,这个文件主要作用是,把请求tftp的所有路径和文件名改成小写。这个文件的内容为:
CODE:
#cat /tftpboot/rules
ri ^[a-z]: # Remove “drive letters”
rg \\ / # Convert backslashes to slashes
rg \# @ # Convert hash marks to @ signs
rg /../ /..no../ # Convert /../ to /..no../
rg A a
rg B b
rg C c
rg D d
rg E e
rg F f
rg G g
rg H h
rg I i
rg J j
rg K k
rg L l
rg M m
rg N n
rg O o
rg P p
rg Q q
rg R r
rg S s
rg T t
rg U u
rg V v
rg W w
rg X x
rg Y y
rg Z z
r ^/(.*) \1
这个文件大概能看懂,从前人文章中拔出来的,嘿嘿。CODE:
allow booting;
allow bootp;
next-server 192.168.1.222;
filename "pxelinux.0";
一般说来增加这么几句就OK了,next-server后面的ip改成你实际的TFTP server的IP或者域名,filename后面是pxelinux.0文件,在syslinux软件包中可以找到,具体可以上找寻更多的信息。CODE:
DEFAULT HD0
PROMPT 1
TIMEOUT 300
#ONTIMEOUT BOOT_PXE
LABEL winpe
MENU LABEL ^1----Boot for WinPE tools
kernel winpe.0
LABEL wxp
MENU LABEL ^1----Boot for Install WindowsXP
kernel winxp.0
LABEL dos
MENU LABEL ^2----Boot for Dos Tools
kernel memdisk
append initrd=dos/dostools.img
LABEL ghost
MENU LABEL ^3----Boot for Ghost 8.3
kernel memdisk
append initrd=dos/ghost83.img
LABEL pqmagic
MENU LABEL ^4----Boot for PQMagic 8.05
kernel memdisk
append initrd=dos/pm805.img
LABEL HD0
MENU LABEL ^0----Boot from the first HD
kernel chain.c32
append hd0
# eof: pxelinux.cfg/default
记得把dhcpd重新启动一下。CODE:
#cabextract driver.cab
一开始我没有做这步操作,安装过程中提示:找不到pcntpci5.sys文件,因为我用的是虚拟机,这个就是虚拟机网卡的驱动,看tftp请求的是:CODE:
find ./ -depth | perl -ne 'chomp;m[^/]*$>;$d=$`;$_=$f=$&;''s/([\x80-\xFF].)|(\w)/$1\l$2/g;system "echo",$d.$f,$d.$_ if $f ne $_'
如果有显示,表明有这些明中是有大写字母的,然后运行:
CODE:
find ./ -depth | perl -ne 'chomp;m[^/]*$>;$d=$`;$_=$f=$&;''s/([\x80-\xFF].)|(\w)/$1\l$2/g;system "mv",$d.$f,$d.$_ if $f ne $_'
OK,这下就把所有文件都改成小写了。QUOTE:
- Copy i386 directory from the installation media to a subdir called winxpCreate a response file called winxp.sif as follows:
in the ris working directory
- Extract the pxe loader:
cabextract
CODE:
[data]
floppyless = "1"
msdosinitiated = "1"
; Needed for second stage
OriSrc = "\\YOUR_SERVER_NAME\YOUR_SHARE_NAME\winxp\i386"
OriTyp = "4"
LocalSourceOnCD = 1
DisableAdminAccountOnDomainJoin = 1
[SetupData]
OsLoadOptions = "/fastdetect"
; Needed for first stage
SetupSourceDevice = "\Device\LanmanRedirector\YOUR_SERVER_NAME\YOUR_SERVER_SHARE\winxp"
[UserData]
ComputerName = *
; if needed
;ProductID=
上面文件的YOUR_SERVER_NAME改成你的samba的机器的IP或者机器名,YOUR_SERVER_SHARE改成你的tftpboot的共享名。CODE:
[reminst]
path = /tftpboot
browsable = true
read only = yes
writable = no
guest ok = yes
samba的其他部分配置可以参考samba的配置。配置完毕后重新启动samba。CODE:
wget [url][/url]
tar zxf [url][/url]
cd ris-linux-0.2
Run infparser.py
./infparser.py /where/is/winxp/i386/inf
Run ./binlsrv.py
注意不要关闭binlsrv.py这个进程。