Subversion Repositories se3

Compare Revisions

Ignore whitespace Rev 6662 → Rev 6663

/trunk/se3-seven/doc/._win7pxelinux1.html
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/doc/._win7pxelinux2.html
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/doc/._win7pxelinux3.html
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/doc/win7pxelinux1.html
New file
0,0 → 1,145
<HTML>
<HEAD>
<TITLE>Deploy windows 7 from Linux without WAIK - 1. Overview</TITLE>
<link rel="STYLESHEET" type="text/css" href="default.css">
</HEAD>
<BODY>
<CENTER>
<H1>Deploy windows 7 from Linux without WAIK</H1>
</CENTER>
<TABLE>
<TR>
<TD VALIGN=TOP NOWRAP>
 
<B>Menu</B><BR>
<LI>1. <A HREF="win7pxelinux1.html">Overview</A>
<LI>2. <A HREF="win7pxelinux2.html">Services</A>
<LI>3. <A HREF="win7pxelinux3.html">Boot Files</A>
<LI>4. <A HREF="win7pxelinux4.html">Unattended files</A>
<LI>5. <A HREF="win7pxelinux5.html">Troubleshooting</A>
</TD>
<TD WIDTH=20></TD>
<TD VALIGN=TOP>
<H2>1. Overview</H2>
 
<H3>1.1 Introduction</H2>
Here's a way to get the Windows 7 PXE deployment from Linux to work. There's no need for a 'Technician Computer' with the WAIK (Windows Automated Installation Kit) installed, you just need a linux system.
I use a 32 bit Centos 5.3 installation, but if you know what you're doing I'm sure that you'll get it to work on you own pernsonal favorite flavor of Linux.
 
Here's what you need:
<UL>
<LI>tftp server
<LI>dhcp server
<LI>samba server
<LI>ris for linux
<LI>PXELinux
<LI>hivex
<LI>My stuff (wimlib/bcdedit.pl/getbcdlocation.sh)
</UL>
The last four things are wrapped together in a package you can download at www.ultimatedeployment.org. Get the package <A HREF="http://www.ultimatedeployment.org/win7pxelinux.tgz">here</A><BR> The other things either come with your linux distribution or can be installed most easily with the package manager of your linux distribution (yum, apt-get etc.)
<BR>
Download the package and untar it in your systems root. It will create a /work directory where everything will go. In the rest of this document I'm assuming yo did this, and the scripts and configuration files inside the archive also assume this. You could always untar it somewhere else and see whats in it of course...<BR>
<BR>
Disclaimer: This info is still under construction, there may be (obvious) errors in here.
This info is actually a write-up of how I got windows 7 depoyment to work in the UDA.
I'm working on it, so let me know if you have corrections or other hints and tips.
 
<H3>1.2 The goal</H3>
Once you're done your filesystem should look something like this. Most of these files are already prepared in the archive, but not the ones of course that I'm not supposed to redistribute, like the windows boot binaries. This tutorial will tell you where to get them or how to retrieve them from your windows 7 installation media..<BR>
<PRE>
/work/tftproot
/work/tftproot/pxelinux.0
/work/tftproot/pxelinux.cfg/default
/work/tftproot/pxeboot.com
/work/tftproot/boot.sdi
/work/tftproot/bootmgr.exe
/work/tftproot/winpe.wim
 
/work/tftproot/system1/bcd
/work/tftproot/system1/wdsnbp.0
 
/work/tftproot/system2/bcd
/work/tftproot/system2/wdsnbp.0
 
/work/sambashare
/work/sambashare/win7
/work/sambashare/system1.xml
/work/sambashare/system2.xml
 
/work/bin
/work/bin/bcdedit.pl
/work/bin/wimextract
/work/bin/wiminfo
/work/bin/updatewim
/work/bin/wimxmlinfo
/work/bin/binlsvr.py
/work/bin/binl
/work/bin/getbcdlocation.sh
 
/work/drivers
/work/drivers/netamd.inf
/work/drivers/pxntpci5.sys
 
/work/wim/actionfile.txt
/work/wim/install.cmd
/work/wim/winpeshl.ini
 
/work/conf/dhcpd.conf
/work/conf/tftpd.conf
/work/conf/smb.conf
 
/work/log
/work/log/tftpd.log
 
/work/doc/default.css
/work/doc/win7pxelinux1.html
/work/doc/win7pxelinux2.html
/work/doc/win7pxelinux3.html
/work/doc/win7pxelinux4.html
/work/doc/win7pxelinux5.html
 
</PRE>
 
<H3>1.3 References</H3>
I've found some interesting reads on the internet, combined them, did some trial and error and came up with this method.
Here's some references with more information.
<UL>
<LI><A HREF="http://www.the-d-spot.org/wordpress/2010/01/20/vmware-network-drivers-for-winpe-3-0/">VMWare network drivers for WinPE on the-d-spot.org</A>
<LI><A HREF="http://technet.microsoft.com/en-us/library/dd744272%28WS.10%29.aspx">Unattended installation reference at Microsoft.com</A>
<LI><A HREF="http://www.ravichaganti.com/blog/?p=364">Obtaining WDS server IP from the WinPE registry</A>
<LI><A HREF="http://rwmj.wordpress.com/2010/04/03/use-hivex-to-unpack-a-windows-boot-configuration-data-bcd-hive/">About using hivex to edit BCD files at rwmj.wordpress.com</A>
<LI><A HREF="http://nssadoc.blogspot.com/2008/06/differential-analysis-wds-dhcp.html">An interesting article about DHCP and WDS at nssadoc.blogspot.com</A>
<LI><A HREF="http://oss.netfarm.it/guides/pxe.php">RIS for linux pacgage at oss.netfarm.it</A>
<LI><A HREF="http://libguestfs.org/hivex.3.html">Hivex package at libguestfs.org</A>
<LI><A HREF="http://syslinux.zytor.com/wiki/index.php/PXELINUX">PXELINUX package at syslinux.zytor.com</A>
</UL>
Let me know if you've found more interesting articles! (please do so in the forum at <A HREF="http://www.ultimatedeployment.org/forum">www.ultimatedeployment.org</A>).
 
<BR>
<BR>
<A HREF="win7pxelinux2.html">Continue to part 2</A>
<BR>
<BR>
 
<LI><A HREF="win7pxelinux1.html">Go to part 1: Overview</A>
<LI><A HREF="win7pxelinux2.html">Go to part 2: Configuring and starting services</A>
<LI><A HREF="win7pxelinux3.html">Go to part 3: Prepare the windows boot files</A>
<LI><A HREF="win7pxelinux4.html">Go to part 4: Prepare the unattended installation files</A>
<LI><A HREF="win7pxelinux5.html">Go to part 5: Troubleshooting</A>
</TD>
<TD VALIGN=TOP>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-7926266120435192";
/* win7pxelinux */
google_ad_slot = "2210822672";
google_ad_width = 120;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Property changes:
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/doc/._win7pxelinux4.html
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/doc/._win7pxelinux5.html
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/doc/win7pxelinux2.html
New file
0,0 → 1,174
<HTML>
<HEAD>
<TITLE>Deploy windows 7 from Linux without WAIK - 1. Overview</TITLE>
<link rel="STYLESHEET" type="text/css" href="default.css">
</HEAD>
<BODY>
<CENTER>
<H1>Deploy windows 7 from Linux without WAIK</H1>
</CENTER>
<TABLE>
<TR>
<TD VALIGN=TOP NOWRAP>
 
<B>Menu</B><BR>
<LI>1. <A HREF="win7pxelinux1.html">Overview</A>
<LI>2. <A HREF="win7pxelinux2.html">Services</A>
<LI>3. <A HREF="win7pxelinux3.html">Boot Files</A>
<LI>4. <A HREF="win7pxelinux4.html">Unattended files</A>
<LI>5. <A HREF="win7pxelinux5.html">Troubleshooting</A>
<BR>
</TD>
<TD WIDTH=20></TD>
<TD VALIGN=TOP>
<H2>2. Configure and start services</H2>
<H3>2.1 dhcp</H3>
Start the dhcp server
<PRE>
/work/init.d/dhcpd start
</PRE>
Here's what the dhcpd.conf looks like, you'll want to make changes to the ip-addresses in red:
<PRE>
log-facility local6;
 
ddns-update-style ad-hoc;
ddns-hostname = concat("station-",binary-to-ascii(10,8,"-",leased-address));
option host-name = config-option server.ddns-hostname;
 
next-server <FONT COLOR=RED>192.168.178.105</FONT> ;
 
if substring ( option vendor-class-identifier, 0, 9) = "PXEClient"
{
filename "pxelinux.0" ;
next-server <FONT COLOR=RED>192.168.178.105</FONT> ;
}
 
subnet <FONT COLOR=RED>192.168.178.0</FONT> netmask <FONT COLOR=RED>255.255.255.0</FONT> {
option routers <FONT COLOR=RED>192.168.178.105</FONT>;
option domain-name-servers <FONT COLOR=RED>192.168.178.105</FONT> ;
range <FONT COLOR=RED>192.168.178.150</FONT> <FONT COLOR=RED>192.168.178.200</FONT> ;
max-lease-time 300;
}
</PRE>
The pxelinux.0 is the boot file that starts the whole pxe process. Once a client boots that file is downloaded first, which in turn downloads the configuration file pxelinux.cfg/default. That file looks like this:
<PRE>
default menu.c32
prompt 0
noescape 1
allowoptions 0
menu title Choose the system to install
menu color tabmsg 37;40 #80ffffff #00000000
menu color hotsel 30;47 #40000000 #20ffffff
menu color sel 30;47 #40000000 #20ffffff
menu color scrollbar 30;47 #40000000 #20ffffff
menu width 80
menu margin 22
menu passwordmargin 26
menu rows 6
menu tabmsgrow 15
menu cmdlinerow 15
menu endrow 24
menu passwordrow 12
menu timeoutrow 13
menu vshift 6
menu passprompt Enter Password:
 
label LOCALBOOT
menu label ^Boot local disk
localboot 0
timeout 100
 
label system1
menu label system1
kernel system1/wdsnbp.0
 
label system2
menu label system2
kernel system2/wdsnbp.0
</PRE>
 
 
<H3>3.2 tftpd</H3>
Start the tftp daemon
<PRE>
/work/init.d/tftpd start
</PRE>
That starts the tftpd with the following options:
<PRE>
/usr/sbin/in.tftpd -l -v -v -v -m /work/conf/tftpd.conf -s /work/tftproot
</PRE>
The config file /work/conf/tftpd.conf only remaps the backslash to a slash:
<PRE>
rg \\ /
</PRE>
 
<H3>3.3 samba</H3>
Start the samba server
<PRE>
/work/init.d/smb start
</PRE>
That make sure that the directory /work/sambashare gets exported as the sambashare REMINST. This is the important part of the smb.conf file:
<PRE>
[REMINST]
browsable = true
read only = no
guest ok = yes
path = /work/sambashare
</PRE>
 
<H3>3.4 binl</H3>
Start the binl server
<PRE>
/work/init.d/binl start
</PRE>
That will start the binl service with the following parameters:
<PRE>
/work/bin/binlsrv.py -d -l /work/log/tftpd.log /work/conf/devlist.cache
</PRE>
The logfile is important here, we'll need to read that later on. The binl service determines what bootfile the client has downloaded recently by running the following script. The script searches the logfile of the tftpd and returns the location of the bcd file that is in the same directory as the wdsnbp.com file that it retrieved. This is nescessary because we want to know what option was selected from the PXE boot menu.
<PRE>
#!/bin/sh
 
IPADDR=$1
MACADDR=$2
 
LOGFILE=/work/log/tftpd.log
 
tail -1000 $LOGFILE | \
grep "RRQ from $IPADDR " | \
grep wdsnbp.0 | \
tail -1 | \
awk '{print $2 }' FS=\/
</PRE>
 
<BR>
<BR>
<A HREF="win7pxelinux3.html">Continue to part 3</A>
<BR>
<BR>
 
 
<LI><A HREF="win7pxelinux1.html">Go to part 1: Overview</A>
<LI><A HREF="win7pxelinux2.html">Go to part 2: Configuring and starting services</A>
<LI><A HREF="win7pxelinux3.html">Go to part 3: Prepare the windows boot files</A>
<LI><A HREF="win7pxelinux4.html">Go to part 4: Prepare the unattended installation files</A>
<LI><A HREF="win7pxelinux5.html">Go to part 5: Troubleshooting</A>
 
</TD>
<TD VALIGN=TOP>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-7926266120435192";
/* win7pxelinux */
google_ad_slot = "2210822672";
google_ad_width = 120;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</TD>
</TR>
</TABLE>
</BODY>
 
</HTML>
Property changes:
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/doc/win7pxelinux3.html
New file
0,0 → 1,272
<HTML>
<HEAD>
<TITLE>Deploy windows 7 from Linux without WAIK - 1. Overview</TITLE>
<link rel="STYLESHEET" type="text/css" href="default.css">
</HEAD>
<BODY>
<CENTER>
<H1>Deploy windows 7 from Linux without WAIK</H1>
</CENTER>
<TABLE>
<TR>
<TD VALIGN=TOP NOWRAP>
 
<B>Menu</B><BR>
<LI>1. <A HREF="win7pxelinux1.html">Overview</A>
<LI>2. <A HREF="win7pxelinux2.html">Services</A>
<LI>3. <A HREF="win7pxelinux3.html">Boot Files</A>
<LI>4. <A HREF="win7pxelinux4.html">Unattended files</A>
<LI>5. <A HREF="win7pxelinux5.html">Troubleshooting</A>
</TD>
<TD WIDTH=20></TD>
<TD VALIGN=TOP>
<H2>3. Prepare the Windows boot files</H2>
 
<H3>3.1 Import the default boot file</H3>
First of all we'll need to mount the installation DVD. I'm going to assume here that it is in the DVD player known as /dev/cdrom. You'll should mount it like this:
<PRE>
mount -t udf /dev/cdrom /work/sambashare/win7
</PRE>
If you have an iso file, then you should do something like:
<PRE>
mount -o loop -t udf /work/windows7.iso /work/sambashare/win7
</PRE>
Once you've done this we can use the files on the DVD (image) and we've also published it through the samabashare.
 
Then we need to extract some files from the boot.wim file that resides in the /sources directory on the DVD. They will have to end up in the /work/tftproot directory so we go there first:
<PRE>
cd /work/tftproot
/work/bin/wimextract /work/sambashare/win7/sources/boot.wim //windows/boot/pxe pxeboot.n12
mv pxeboot.n12 pxeboot.com
/work/bin/wimextract /work/sambashare/win7/sources/boot.wim //windows/boot/pxe bootmgr.exe
/work/bin/wimextract /work/sambashare/win7/sources/boot.wim //windows/boot/pxe wdsnbp.com
cp /work/sambashare/win7/boot/boot.sdi /work/tftproot
</PRE>
Note that we extractthe pxeboot.n12 and that we rename it to pxeboot.com!
 
<H3>3.2 Prepare the WIM file</H3>
Well, now we need to create a winpe.wim file. Here's what we do:
 
<H4>3.2.1 Create a file winpehl.ini</H4>
It has to contain something like this:
<PRE>
[LaunchApps]
%SYSTEMDRIVE%\sources\new\install.cmd
%SYSTEMDRIVE%\windows\system32\cmd.exe
</PRE>
Make sure it has the dos format (and not unix format)
<PRE>
unix2dos winpeshl.ini
</PRE>
 
<H4>3.2.2 Create install.cmd script</H4>
Create an install.cmd script that will take care of the installation once Winpe has started:
<PRE>
@ECHO OFF
 
echo Starting windows7.cmd Command Script, press CONTROL+C to interrupt this script
 
echo.
echo Restoring the Setup environment
move %SYSTEMDRIVE%\setup.uda %SYSTEMDRIVE%\setup.exe
move %SYSTEMDRIVE%\sources\setup.uda %SYSTEMDRIVE%\sources\setup.exe
 
 
SET REGEXE=%SYSTEMDRIVE%\windows\system32\reg.exe
 
echo Getting UDA Template info from registry
 
for /f "tokens=2*" %%A IN ('%REGEXE% query HKLM\SYSTEM\CurrentControlSet\Control /f "SystemStartOptions" ^| find "UDA="') DO SET SSO=%%B
 
echo.
echo SYSTEMSTARTOPTIONS=%SSO%
 
echo.
for /f "tokens=1,2,3,4,5,6,7,8,9,10" %%A IN ( "%SSO%" ) DO (
echo %%A | FIND "UDA=" && echo FOUND %%A && SET UDAOPTION=%%A
echo %%B | FIND "UDA=" && echo FOUND %%B && SET UDAOPTION=%%B
echo %%C | FIND "UDA=" && echo FOUND %%C && SET UDAOPTION=%%C
echo %%D | FIND "UDA=" && echo FOUND %%D && SET UDAOPTION=%%D
echo %%E | FIND "UDA=" && echo FOUND %%E && SET UDAOPTION=%%E
echo %%F | FIND "UDA=" && echo FOUND %%F && SET UDAOPTION=%%F
echo %%G | FIND "UDA=" && echo FOUND %%G && SET UDAOPTION=%%G
echo %%H | FIND "UDA=" && echo FOUND %%H && SET UDAOPTION=%%H
echo %%I | FIND "UDA=" && echo FOUND %%I && SET UDAOPTION=%%I
echo %%J | FIND "UDA=" && echo FOUND %%J && SET UDAOPTION=%%J
)
echo.
echo UDAOPTION=%UDAOPTION%
 
for /f "delims=:= tokens=1,2,3,4,5" %%A IN ("%UDAOPTION%") DO (
SET UDA_IPADDR=%%B
SET UDA_TEMPLATE=%%C
SET UDA_SUBTEMPLATE=%%D
SET UDA_DRIVER=%%E
)
 
echo UDA Template info is:
echo.
echo UDA_IPADDR: %UDA_IPADDR%
echo UDA_TEMPLATE: %UDA_TEMPLATE%
echo UDA_SUBTEMPLATE: %UDA_SUBTEMPLATE%
echo UDA_DRIVER: %UDA_DRIVER%
 
 
SET UDADIR=%SYSTEMDRIVE%\sources\uda
SET DRVLOAD=%SYSTEMDRIVE%\windows\system32\drvload.exe
SET WPEINIT=%SYSTEMDRIVE%\windows\system32\wpeinit
SET NETEXE=%SYSTEMDRIVE%\windows\system32\net.exe
SET INSTALLDRIVE=I
 
SET PRESCRIPT=%INSTALLDRIVE%:\pxelinux.cfg\templates\%UDA_TEMPLATE%\%UDA_SUBTEMPLATE%.cmd
 
echo PRESCRIPT=%PRESCRIPT%
 
cd %UDADIR%
 
if "%UDA_DRIVER%"=="" goto tryall
FOR /F "eol=; tokens=1,2,3,4" %%A in ( %SYSTEMDRIVE%\sources\uda\drivers.txt ) DO (
echo Driver=%%A Number=%%B Inffile=%%C Ssysfile=%%D
if not "%%A"=="%UDA_DRIVER%" goto skipload
echo Loading driver %%A
%DRVLOAD% %%C && goto doneloading
echo Could not succesfully load driver %UDA_DRIVER%, trying all instead
goto tryall
:skipload
echo Skipping load of driver %%A
)
 
:tryall
echo Trying all network drivers
FOR /F "eol=; tokens=1,2,3,4" %%A in ( %SYSTEMDRIVE%\sources\uda\drivers.txt ) DO (
echo Driver=%%A Number=%%B Inffile=%%C Ssysfile=%%D
%DRVLOAD% %%C && goto doneloading
echo Could not succesfully load driver %%A, trying next one
)
 
goto manual
 
:doneloading
 
 
echo.
echo Starting the network
%WPEINIT%
if not %ERRORLEVEL%==0 goto manual
 
echo.
echo Mapping the network share
%NETEXE% use %INSTALLDRIVE%: \\%UDA_IPADDR%\REMINST
 
echo.
echo Handing over command to the remote template script and not coming back!
if EXIST %PRESCRIPT% %PRESCRIPT% %UDA_IPADDR% %UDA_TEMPLATE% %UDA_SUBTEMPLATE%
 
pause
:manual
echo.
echo Could not succesfully load a network driver, please try manually
echo you should do something like:
echo.
echo drvload x:\sources\uda\netamd.inf
echo wpeinit
echo net use i: \\%UDA_IPADDR%\REMINST
echo %PRESCRIPT% %UDA_IPADDR% %UDA_TEMPLATE% %UDA_SUBTEMPLATE%
echo.
 
cmd.exe
pause
</PRE>
 
<H4>3.2.3 Add Network drivers</H4>
Well. Network drivers are a difficult story. You'll need network drivers that come with your network card, can be downloaded from the network card vendor, or some may be already available in the Windows 7 WINPE distribution on your installation media. I'm going to assume here that you will be PXE booting a vmware virtual with an AMD network card (which is in many cases the default network card for a new virtual).
<BR><BR>
If your virtual boots and it shows an Intel E1000 network card when booting from the network, you'll have to shut down the virtual, remove the following line from the .vmx file and restart.
<PRE>
ethernet0.virtualDev = "e1000"
</PRE>
If you start it now It will say there's an AMD network card...
So now we need the windows PE drivers for this AMD network card.
There's a <A HREF="http://www.the-d-spot.org/wordpress/2010/01/20/vmware-network-drivers-for-winpe-3-0/">page</A> that tells you where you can download them:
<PRE>
cp netamd.inf /work/wim/
cp pcntpci5.sys /work/wim/
</PRE>
For windows PE you can use windows XP drivers. In General you'll need an .inf file and the .sys file. The inf file usually contains a list of network device ID's and their corresponding driver (.sys) file(s). If you're not sure which network card ID your system has, then just copy multiple drivers (inf ans sys files) to the /work/wim directory.
 
<H4>3.2.4 Create an actionfile</H4>
Here's the actions we want to take when creating the winpe.wim from the boot.wim. Yuo may want to edit the drivers to add in
/work/wim/actionfile.txt.
Here's what that file looks like:
<PRE>
rename //setup.exe setup.new
rename //sources/setup.exe setup.new
add //windows/system32 winpeshl.ini
mkdir //sources new
add //sources/new netamd.inf
add //sources/new pcntpci5.sys
add //srouces/new install.cmd
</PRE>
 
<H4>3.2.5 Create the WIM file</H4>
Now we can create the winpe.wim file
</PRE>
cd /work/wim
/work/bin/updatewim /work/sambashare/win7/sources/boot.wim /work/tftproot/winpe.wim /work/wim/actionfile.txt
</PRE>
 
<H3>3.3 Create the system-specific boot files</H3>
First we need the hivex tools. The RPM's I use are in the <A HREF="http://www.ultimatedeployment.org/win7pxelinux.tgz">package</A>.
<PRE>
cd /work/rpm
rpm -ivh hivex*
</PRE>
You may need other distribution packages for your favorite linux distribution.
We need these tools in order to be able to edit windows BCD files (Boot Cofiguration Data).
 
Now we do three things for both systems we want to install remotely:
<UL>
<LI>Copy the Boot Cofiguration Data from the installation DVD to the systems pxe boot directory
<LI>Modify it to become a PXE BCD
<LI>Copy the Windows Deployment Services Network Boot Program (wdsnbp.com) to that directory as well and rename it to wdsnbp.0
</UL>
<PRE>
cp /work/sambashare/win7/boot/bcd /work/tftproot/system1
/work/bin/bcdedit.pl /work/tftproot/system1/bcd /winpe.wim /boot.sdi INFO=10.0.0.1:system1
cp /work/tftproot/wdsnbp.com /work/tftproot/system1/wdsnbp.0
 
cp /work/sambashare/win7/boot/bcd /work/tftproot/system2
/work/bin/bcdedit.pl /work/tftproot/system2/bcd /winpe.wim /boot.sdi INFO=10.0.0.1:system2
cp /work/tftproot/wdsnbp.com /work/tftproot/system2/wdsnbp.0
</PRE>
You can easily extend this for more then two systems...
 
<BR>
<BR>
<A HREF="win7pxelinux4.html">Continue to part 4</A>
<BR>
<BR>
 
<LI><A HREF="win7pxelinux1.html">Go to part 1: Overview</A>
<LI><A HREF="win7pxelinux2.html">Go to part 2: Configuring and starting services</A>
<LI><A HREF="win7pxelinux3.html">Go to part 3: Prepare the windows boot files</A>
<LI><A HREF="win7pxelinux4.html">Go to part 4: Prepare the unattended installation files</A>
<LI><A HREF="win7pxelinux5.html">Go to part 5: Troubleshooting</A>
</TD>
<TD VALIGN=TOP>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-7926266120435192";
/* win7pxelinux */
google_ad_slot = "2210822672";
google_ad_width = 120;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
 
Property changes:
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/doc/win7pxelinux4.html
New file
0,0 → 1,371
<HTML>
<HEAD>
<TITLE>Deploy windows 7 from Linux without WAIK - 4. Unattended files</TITLE>
<link rel="STYLESHEET" type="text/css" href="default.css">
</HEAD>
<CENTER>
<H1>Deploy windows 7 from Linux without WAIK</H1>
</CENTER>
<TABLE>
<TR>
<TD VALIGN=TOP NOWRAP>
 
<B>Menu</B><BR>
<LI>1. <A HREF="win7pxelinux1.html">Overview</A>
<LI>2. <A HREF="win7pxelinux2.html">Services</A>
<LI>3. <A HREF="win7pxelinux3.html">Boot Files</A>
<LI>4. <A HREF="win7pxelinux4.html">Unattended files</A>
<LI>5. <A HREF="win7pxelinux5.html">Troubleshooting</A>
<TD WIDTH=20></TD>
<TD VALIGN=TOP>
 
<H2>4. Prepare the unattended installation files</H2>
 
<H3>4.1 Supported language</H3>
First we find out what languages are supported on this installation media.
<PRE>
cat /work/sambashare/win7/sources/lang.ini
</PRE>
That should give you something like
<PRE>
[Available UI Languages]
<FONT COLOR=RED>en-US</FONT> = 3
 
[Fallback Languages]
en-US = en-us
</PRE>
Apparently this DVD has the language en-US (with fallback en-us).
 
<H3>4.2 Determine the OS Flavor</H3>
Now we need to check what flavor is supported by the installation DVD
<PRE>
cat /work/sambashare/win7/sources/ei.cfg
</PRE>
That should give you something like:
<PRE>
[EditionID]
</FONT COLOR=RED>Ultimate</FONT>
[Channel]
OEM
[VL]
 
</PRE>
So this is a Windows 7 Ultimate OEM DVD with (non Volume licensed) We need this info to be able to pick an image in the next section:
 
<H3>4.3 Select the appropriate installation image</H3>
First we make a dump of the install.wim xml info:
<PRE>
/work/bin/wimxmlinfo /work/sambashare/win7/install.wim | sed 's/\(<\/[A-Z]*>\)/\1\n/g' | sed 's/></>\n</g'
</PRE>
That should give you something like:
<PRE>
&lt;WIM&gt;
&lt;TOTALBYTES&gt;2073978321&lt;/TOTALBYTES&gt;
&lt;IMAGE INDEX="1"&gt;
&lt;DIRCOUNT&gt;9350&lt;/DIRCOUNT&gt;
&lt;FILECOUNT&gt;46415&lt;/FILECOUNT&gt;
&lt;TOTALBYTES&gt;7661093433&lt;/TOTALBYTES&gt;
&lt;CREATIONTIME&gt;
&lt;HIGHPART&gt;0x01CA0443&lt;/HIGHPART&gt;
&lt;LOWPART&gt;0x6568BDF8&lt;/LOWPART&gt;
&lt;/CREATIONTIME&gt;
&lt;LASTMODIFICATIONTIME&gt;
&lt;HIGHPART&gt;0x01CA0463&lt;/HIGHPART&gt;
&lt;LOWPART&gt;0x5D745FDC&lt;/LOWPART&gt;
&lt;/LASTMODIFICATIONTIME&gt;
&lt;WINDOWS&gt;
&lt;ARCH&gt;0&lt;/ARCH&gt;
&lt;PRODUCTNAME&gt;Microsoft? Windows? Operating System&lt;/PRODUCTNAME&gt;
&lt;EDITIONID&gt;Starter&lt;/EDITIONID&gt;
&lt;INSTALLATIONTYPE&gt;Client&lt;/INSTALLATIONTYPE&gt;
&lt;HAL&gt;acpiapic&lt;/HAL&gt;
&lt;PRODUCTTYPE&gt;WinNT&lt;/PRODUCTTYPE&gt;
&lt;PRODUCTSUITE&gt;Terminal Server&lt;/PRODUCTSUITE&gt;
&lt;LANGUAGES&gt;
&lt;LANGUAGE&gt;nl-NL&lt;/LANGUAGE&gt;
&lt;DEFAULT&gt;nl-NL&lt;/DEFAULT&gt;
&lt;/LANGUAGES&gt;
&lt;VERSION&gt;
&lt;MAJOR&gt;6&lt;/MAJOR&gt;
&lt;MINOR&gt;1&lt;/MINOR&gt;
&lt;BUILD&gt;7600&lt;/BUILD&gt;
&lt;SPBUILD&gt;16385&lt;/SPBUILD&gt;
&lt;SPLEVEL&gt;0&lt;/SPLEVEL&gt;
&lt;/VERSION&gt;
&lt;SYSTEMROOT&gt;WINDOWS&lt;/SYSTEMROOT&gt;
&lt;/WINDOWS&gt;
&lt;NAME&gt;Windows 7 STARTER&lt;/NAME&gt;
&lt;DESCRIPTION&gt;Windows 7 STARTER&lt;/DESCRIPTION&gt;
&lt;FLAGS&gt;Starter&lt;/FLAGS&gt;
&lt;HARDLINKBYTES&gt;2918646231&lt;/HARDLINKBYTES&gt;
&lt;DISPLAYNAME&gt;Windows 7 Starter&lt;/DISPLAYNAME&gt;
&lt;DISPLAYDESCRIPTION&gt;Windows 7 Starter&lt;/DISPLAYDESCRIPTION&gt;
&lt;/IMAGE&gt;
&lt;IMAGE INDEX="2"&gt;
&lt;DIRCOUNT&gt;9359&lt;/DIRCOUNT&gt;
&lt;FILECOUNT&gt;46487&lt;/FILECOUNT&gt;
&lt;TOTALBYTES&gt;7681290464&lt;/TOTALBYTES&gt;
&lt;CREATIONTIME&gt;
&lt;HIGHPART&gt;0x01CA0443&lt;/HIGHPART&gt;
&lt;LOWPART&gt;0x6568BDF8&lt;/LOWPART&gt;
&lt;/CREATIONTIME&gt;
&lt;LASTMODIFICATIONTIME&gt;
&lt;HIGHPART&gt;0x01CA0463&lt;/HIGHPART&gt;
&lt;LOWPART&gt;0x7466EEDC&lt;/LOWPART&gt;
&lt;/LASTMODIFICATIONTIME&gt;
&lt;WINDOWS&gt;
&lt;ARCH&gt;0&lt;/ARCH&gt;
&lt;PRODUCTNAME&gt;Microsoft? Windows? Operating System&lt;/PRODUCTNAME&gt;
&lt;EDITIONID&gt;HomeBasic&lt;/EDITIONID&gt;
&lt;INSTALLATIONTYPE&gt;Client&lt;/INSTALLATIONTYPE&gt;
&lt;HAL&gt;acpiapic&lt;/HAL&gt;
&lt;PRODUCTTYPE&gt;WinNT&lt;/PRODUCTTYPE&gt;
&lt;PRODUCTSUITE&gt;Terminal Server&lt;/PRODUCTSUITE&gt;
&lt;LANGUAGES&gt;
&lt;LANGUAGE&gt;nl-NL&lt;/LANGUAGE&gt;
&lt;DEFAULT&gt;nl-NL&lt;/DEFAULT&gt;
&lt;/LANGUAGES&gt;
&lt;VERSION&gt;
&lt;MAJOR&gt;6&lt;/MAJOR&gt;
&lt;MINOR&gt;1&lt;/MINOR&gt;
&lt;BUILD&gt;7600&lt;/BUILD&gt;
&lt;SPBUILD&gt;16385&lt;/SPBUILD&gt;
&lt;SPLEVEL&gt;0&lt;/SPLEVEL&gt;
&lt;/VERSION&gt;
&lt;SYSTEMROOT&gt;WINDOWS&lt;/SYSTEMROOT&gt;
&lt;/WINDOWS&gt;
&lt;NAME&gt;Windows 7 HOMEBASIC&lt;/NAME&gt;
&lt;DESCRIPTION&gt;Windows 7 HOMEBASIC&lt;/DESCRIPTION&gt;
&lt;FLAGS&gt;HomeBasic&lt;/FLAGS&gt;
&lt;HARDLINKBYTES&gt;2933760608&lt;/HARDLINKBYTES&gt;
&lt;DISPLAYNAME&gt;Windows 7 Home Basic&lt;/DISPLAYNAME&gt;
&lt;DISPLAYDESCRIPTION&gt;Windows 7 Home Basic&lt;/DISPLAYDESCRIPTION&gt;
&lt;/IMAGE&gt;
<FONT COLOR=RED>&lt;IMAGE INDEX="3"&gt;
&lt;DIRCOUNT&gt;9576&lt;/DIRCOUNT&gt;
&lt;FILECOUNT&gt;47496&lt;/FILECOUNT&gt;
&lt;TOTALBYTES&gt;8123123919&lt;/TOTALBYTES&gt;
&lt;CREATIONTIME&gt;
&lt;HIGHPART&gt;0x01CA0443&lt;/HIGHPART&gt;
&lt;LOWPART&gt;0x6568BDF8&lt;/LOWPART&gt;
&lt;/CREATIONTIME&gt;
&lt;LASTMODIFICATIONTIME&gt;
&lt;HIGHPART&gt;0x01CA0463&lt;/HIGHPART&gt;
&lt;LOWPART&gt;0x8F7022C4&lt;/LOWPART&gt;
&lt;/LASTMODIFICATIONTIME&gt;
&lt;WINDOWS&gt;
&lt;ARCH&gt;0&lt;/ARCH&gt;
&lt;PRODUCTNAME&gt;Microsoft? Windows? Operating System&lt;/PRODUCTNAME&gt;
&lt;EDITIONID&gt;HomePremium&lt;/EDITIONID&gt;
&lt;INSTALLATIONTYPE&gt;Client&lt;/INSTALLATIONTYPE&gt;
&lt;HAL&gt;acpiapic&lt;/HAL&gt;
&lt;PRODUCTTYPE&gt;WinNT&lt;/PRODUCTTYPE&gt;
&lt;PRODUCTSUITE&gt;Terminal Server&lt;/PRODUCTSUITE&gt;
&lt;LANGUAGES&gt;
&lt;LANGUAGE&gt;nl-NL&lt;/LANGUAGE&gt;
&lt;DEFAULT&gt;nl-NL&lt;/DEFAULT&gt;
&lt;/LANGUAGES&gt;
&lt;VERSION&gt;
&lt;MAJOR&gt;6&lt;/MAJOR&gt;
&lt;MINOR&gt;1&lt;/MINOR&gt;
&lt;BUILD&gt;7600&lt;/BUILD&gt;
&lt;SPBUILD&gt;16385&lt;/SPBUILD&gt;
&lt;SPLEVEL&gt;0&lt;/SPLEVEL&gt;
&lt;/VERSION&gt;
&lt;SYSTEMROOT&gt;WINDOWS&lt;/SYSTEMROOT&gt;
&lt;/WINDOWS&gt;
&lt;NAME&gt;Windows 7 HOMEPREMIUM&lt;/NAME&gt;
&lt;DESCRIPTION&gt;Windows 7 HOMEPREMIUM&lt;/DESCRIPTION&gt;
&lt;FLAGS&gt;HomePremium&lt;/FLAGS&gt;
&lt;HARDLINKBYTES&gt;3313218351&lt;/HARDLINKBYTES&gt;
&lt;DISPLAYNAME&gt;Windows 7 Home Premium&lt;/DISPLAYNAME&gt;
&lt;DISPLAYDESCRIPTION&gt;Windows 7 Home Premium&lt;/DISPLAYDESCRIPTION&gt;
&lt;/IMAGE&gt;</FONT>
&lt;IMAGE INDEX="4"&gt;
&lt;DIRCOUNT&gt;9632&lt;/DIRCOUNT&gt;
&lt;FILECOUNT&gt;47924&lt;/FILECOUNT&gt;
&lt;TOTALBYTES&gt;8004750393&lt;/TOTALBYTES&gt;
&lt;CREATIONTIME&gt;
&lt;HIGHPART&gt;0x01CA0443&lt;/HIGHPART&gt;
&lt;LOWPART&gt;0x6568BDF8&lt;/LOWPART&gt;
&lt;/CREATIONTIME&gt;
&lt;LASTMODIFICATIONTIME&gt;
&lt;HIGHPART&gt;0x01CA0463&lt;/HIGHPART&gt;
&lt;LOWPART&gt;0x9DC7BC24&lt;/LOWPART&gt;
&lt;/LASTMODIFICATIONTIME&gt;
&lt;WINDOWS&gt;
&lt;ARCH&gt;0&lt;/ARCH&gt;
&lt;PRODUCTNAME&gt;Microsoft? Windows? Operating System&lt;/PRODUCTNAME&gt;
&lt;EDITIONID&gt;Professional&lt;/EDITIONID&gt;
&lt;INSTALLATIONTYPE&gt;Client&lt;/INSTALLATIONTYPE&gt;
&lt;HAL&gt;acpiapic&lt;/HAL&gt;
&lt;PRODUCTTYPE&gt;WinNT&lt;/PRODUCTTYPE&gt;
&lt;PRODUCTSUITE&gt;Terminal Server&lt;/PRODUCTSUITE&gt;
&lt;LANGUAGES&gt;
&lt;LANGUAGE&gt;nl-NL&lt;/LANGUAGE&gt;
&lt;DEFAULT&gt;nl-NL&lt;/DEFAULT&gt;
&lt;/LANGUAGES&gt;
&lt;VERSION&gt;
&lt;MAJOR&gt;6&lt;/MAJOR&gt;
&lt;MINOR&gt;1&lt;/MINOR&gt;
&lt;BUILD&gt;7600&lt;/BUILD&gt;
&lt;SPBUILD&gt;16385&lt;/SPBUILD&gt;
&lt;SPLEVEL&gt;0&lt;/SPLEVEL&gt;
&lt;/VERSION&gt;
&lt;SYSTEMROOT&gt;WINDOWS&lt;/SYSTEMROOT&gt;
&lt;/WINDOWS&gt;
&lt;NAME&gt;Windows 7 PROFESSIONAL&lt;/NAME&gt;
&lt;DESCRIPTION&gt;Windows 7 PROFESSIONAL&lt;/DESCRIPTION&gt;
&lt;FLAGS&gt;Professional&lt;/FLAGS&gt;
&lt;HARDLINKBYTES&gt;3179671026&lt;/HARDLINKBYTES&gt;
&lt;DISPLAYNAME&gt;Windows 7 Professional&lt;/DISPLAYNAME&gt;
&lt;DISPLAYDESCRIPTION&gt;Windows 7 Professional&lt;/DISPLAYDESCRIPTION&gt;
&lt;/IMAGE&gt;
&lt;IMAGE INDEX="5"&gt;
&lt;DIRCOUNT&gt;9662&lt;/DIRCOUNT&gt;
&lt;FILECOUNT&gt;48073&lt;/FILECOUNT&gt;
&lt;TOTALBYTES&gt;8162882068&lt;/TOTALBYTES&gt;
&lt;CREATIONTIME&gt;
&lt;HIGHPART&gt;0x01CA0443&lt;/HIGHPART&gt;
&lt;LOWPART&gt;0x6568BDF8&lt;/LOWPART&gt;
&lt;/CREATIONTIME&gt;
&lt;LASTMODIFICATIONTIME&gt;
&lt;HIGHPART&gt;0x01CA0463&lt;/HIGHPART&gt;
&lt;LOWPART&gt;0xACBCB034&lt;/LOWPART&gt;
&lt;/LASTMODIFICATIONTIME&gt;
&lt;WINDOWS&gt;
&lt;ARCH&gt;0&lt;/ARCH&gt;
&lt;PRODUCTNAME&gt;Microsoft? Windows? Operating System&lt;/PRODUCTNAME&gt;
&lt;EDITIONID&gt;Ultimate&lt;/EDITIONID&gt;
&lt;INSTALLATIONTYPE&gt;Client&lt;/INSTALLATIONTYPE&gt;
&lt;HAL&gt;acpiapic&lt;/HAL&gt;
&lt;PRODUCTTYPE&gt;WinNT&lt;/PRODUCTTYPE&gt;
&lt;PRODUCTSUITE&gt;Terminal Server&lt;/PRODUCTSUITE&gt;
&lt;LANGUAGES&gt;
&lt;LANGUAGE&gt;nl-NL&lt;/LANGUAGE&gt;
&lt;DEFAULT&gt;nl-NL&lt;/DEFAULT&gt;
&lt;/LANGUAGES&gt;
&lt;VERSION&gt;
&lt;MAJOR&gt;6&lt;/MAJOR&gt;
&lt;MINOR&gt;1&lt;/MINOR&gt;
&lt;BUILD&gt;7600&lt;/BUILD&gt;
&lt;SPBUILD&gt;16385&lt;/SPBUILD&gt;
&lt;SPLEVEL&gt;0&lt;/SPLEVEL&gt;
&lt;/VERSION&gt;
&lt;SYSTEMROOT&gt;WINDOWS&lt;/SYSTEMROOT&gt;
&lt;/WINDOWS&gt;
&lt;NAME&gt;Windows 7 ULTIMATE&lt;/NAME&gt;
&lt;DESCRIPTION&gt;Windows 7 ULTIMATE&lt;/DESCRIPTION&gt;
&lt;FLAGS&gt;Ultimate&lt;/FLAGS&gt;
&lt;HARDLINKBYTES&gt;3336944182&lt;/HARDLINKBYTES&gt;
&lt;DISPLAYNAME&gt;Windows 7 Ultimate&lt;/DISPLAYNAME&gt;
&lt;DISPLAYDESCRIPTION&gt;Windows 7 Ultimate&lt;/DISPLAYDESCRIPTION&gt;
&lt;/IMAGE&gt;
&lt;/WIM&gt;
</PRE>
Once we've found out what language and windows 7 flavor we're dealing with we can edit the unattended install files. I've highlited the third image, since that is the Ultimate Edition we've found in the previous section. It's for Architecture 0, which is x86.
 
<H3>4.4 Create/edit the unattended file</H3>
<PRE>
vi /work/sambashare/system1.xml
vi /work/sambashare/system2.xml
</PRE>
The unattended file looks omething like this (You woul probably want to edit the values in red:
<PRE>
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;unattend xmlns="urn:schemas-microsoft-com:unattend"&gt;
&lt;settings pass="windowsPE"&gt;
&lt;component name="Microsoft-Windows-International-Core-WinPE" <FONT COLOR=RED>processorArchitecture="x86"</FONT> publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
&lt;InputLocale&gt;<FONT COLOR=RED>en-US</FONT>&lt;/InputLocale&gt;
&lt;SystemLocale&gt;<FONT COLOR=RED>en-US</FONT>&lt;/SystemLocale&gt;
&lt;UILanguage&gt;<FONT COLOR=RED>en-US</FONT>&lt;/UILanguage&gt;
&lt;UserLocale&gt;<FONT COLOR=RED>en-US</FONT>&lt;/UserLocale&gt;
&lt;/component&gt;
&lt;component name="Microsoft-Windows-Setup" <FONT COLOR=RED>processorArchitecture="x86"</FONT> publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
&lt;ImageInstall&gt;
&lt;OSImage&gt;
&lt;WillShowUI&gt;OnError&lt;/WillShowUI&gt;
&lt;InstallTo&gt;
&lt;DiskID&gt;0&lt;/DiskID&gt;
&lt;PartitionID&gt;1&lt;/PartitionID&gt;
&lt;/InstallTo&gt;
&lt;InstallFrom&gt;
&lt;Path&gt;i:\win7\sources\install.wim&lt;/Path&gt;
&lt;MetaData wcm:action="add"&gt;
&lt;Key&gt;/IMAGE/INDEX&lt;/Key&gt;
<FONT COLOR=RED>&lt;Value&gt;3&lt;/Value&gt;</FONT>
&lt;/MetaData&gt;
&lt;/InstallFrom&gt;
&lt;/OSImage&gt;
&lt;/ImageInstall&gt;
&lt;UserData&gt;
&lt;AcceptEula&gt;true&lt;/AcceptEula&gt;
&lt;/UserData&gt;
&lt;WindowsDeploymentServices&gt;
&lt;Login&gt;
&lt;WillShowUI&gt;OnError&lt;/WillShowUI&gt;
&lt;Credentials&gt;
&lt;Username&gt;Administrator&lt;/Username&gt;
&lt;Domain&gt;domain.com&lt;/Domain&gt;
&lt;Password&gt;Password1&lt;/Password&gt;
&lt;/Credentials&gt;
&lt;/Login&gt;
&lt;/WindowsDeploymentServices&gt;
&lt;/component&gt;
&lt;/settings&gt;
&lt;settings pass="oobeSystem"&gt;
&lt;component name="Microsoft-Windows-Shell-Setup" <FONT COLOR=RED>processorArchitecture="x86"</FONT> publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
&lt;OOBE&gt;
&lt;ProtectYourPC&gt;3&lt;/ProtectYourPC&gt;
&lt;NetworkLocation&gt;Home&lt;/NetworkLocation&gt;
&lt;/OOBE&gt;
&lt;UserAccounts&gt;
&lt;LocalAccounts&gt;
&lt;LocalAccount wcm:action="add"&gt;
&lt;Password&gt;
&lt;Value&gt;&lt;/Value&gt;
&lt;PlainText&gt;true&lt;/PlainText&gt;
&lt;/Password&gt;
&lt;Name&gt;admin&lt;/Name&gt;
&lt;Group&gt;Administrators&lt;/Group&gt;
&lt;/LocalAccount&gt;
&lt;/LocalAccounts&gt;
&lt;/UserAccounts&gt;
&lt;TimeZone&gt;India Standard Time&lt;/TimeZone&gt;
&lt;/component&gt;
&lt;/settings&gt;
&lt;cpi:offlineImage cpi:source="wim:i:/win7/sources/install.wim#Windows 7 HOMEPREMIUM" xmlns:cpi="urn:schemas-microsoft-com:cpi" /&gt;
&lt;/unattend&gt;
</PRE>
 
Well, once you've done this you should be able to pxe boot a new system and you should be able to choose from the two systems you've configured for auto-deployment. If not, please visit the next section:<A HREF="win7pxelinux5.html">Troubleshooting</A> share your experiences on the forum on <A HREF="http://www.ultimatedeployment.org">ultimatedeployment.org</A>.
 
<BR>
<BR>
<A HREF="win7pxelinux5.html">Continue to part 5</A>
<BR>
<BR>
 
<LI><A HREF="win7pxelinux1.html">Go to part 1: Overview</A>
<LI><A HREF="win7pxelinux2.html">Go to part 2: Configuring and starting services</A>
<LI><A HREF="win7pxelinux3.html">Go to part 3: Prepare the windows boot files</A>
<LI><A HREF="win7pxelinux4.html">Go to part 4: Prepare the unattended installation files</A>
<LI><A HREF="win7pxelinux5.html">Go to part 5: Troubleshooting</A>
 
</TD>
<TD VALIGN=TOP>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-7926266120435192";
/* win7pxelinux */
google_ad_slot = "2210822672";
google_ad_width = 120;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</TD>
</TR>
</TABLE>
</HTML>
Property changes:
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/doc/win7pxelinux5.html
New file
0,0 → 1,110
<HTML>
<HEAD>
<TITLE>Deploy windows 7 from Linux without WAIK - 5. Troubleshooting</TITLE>
<link rel="STYLESHEET" type="text/css" href="default.css">
</HEAD>
<BODY>
<CENTER>
<H1>Deploy windows 7 from Linux without WAIK</H1>
</CENTER>
<TABLE>
<TR>
<TD VALIGN=TOP NOWRAP>
 
<B>Menu</B><BR>
<LI>1. <A HREF="win7pxelinux1.html">Overview</A>
<LI>2. <A HREF="win7pxelinux2.html">Services</A>
<LI>3. <A HREF="win7pxelinux3.html">Boot Files</A>
<LI>4. <A HREF="win7pxelinux4.html">Unattended files</A>
<LI>5. <A HREF="win7pxelinux5.html">Troubleshooting</A>
</TD>
<TD WIDTH=20></TD>
<TD VALIGN=TOP>
<H2>5. Troubleshooting</H2>
 
<H3>Boot process</H3>
Here's a simplified overview of the boot process that the PXE clients go thourgh when this method is used.
<LI>C is for Client (the system to be deployed)
<LI>S is the Server (the system that holds the configration files and runs the services needed to allow the client to be installed
<PRE>
C->S DHCP request for IP
S->C Acknowledges IP request and gives the client a (free) ip-address
C->S DHCP request for bootserver/file
 
S->C DHCP Reply for bootserver/file SERVER:/boot/myserver/wdsnbp.0
C->S TFTP Request for bootfile /boot/myserver/wdsnbp.0
S->C TFTP Reply /boot/myserver/wdsnbp.0
C->S BINL request (where can I find the BCD file?)
 
Server finds in tftpd.log where that client has downloaded its wdsnbp file from and relies with the bcd file in that same directory.
 
S->C BINL reply /boot/pxeboot.com and
/boot/myserver/bcd
 
C->S TFTP request /boot/pxeboot.com
S->C TFTP reply /boot/pxeboot.com
C->S TFTP request /boot/mysystem/bcd
S->C TFTP reply /boot/mysystem/bcd
 
Client reads BCD file and finds out where to download the boot.sdi and winpe.wim from
 
C->S TFTP request /boot/boot.sdi
S->C TFTP reply /boot/boot.sdi
 
C->S TFTP request /boot/winpe.wim
S->C TFTP reply /boot/winpe.wim
</PRE>
 
Then the client boots into Windows PE. When that is done it takes these seps we have prepared:
<OL>
<LI> Finds IP address of the boot-server in the registry
<LI>Finds boot-specific info in the registry
<LI>Loads network drivers and starts the networkservice
<LI>Moves the setup.exe and sources\setup.exe back into place
<LI>connects to a samba share to the bootserver
<LI>Partitions the disk with the diskpart file found on the samba share on the bootserver
<LI>Moves the setup.exe and sources\setup.exe back into place
<LI>Removes the PXE binl reply from the registry to prevent WDS setup instead of normal setup
<LI>Starts the setup.exe with the unattended file found on the share on the bootserver
</OL>
</PRE>
 
<H3>Log files</H3>
Obvious locations to look when troubleshooting is in the logs, check out the following logfiles:
<UL>
<LI> tftpd log (/work/log/tftpd.log)
<LI> dhcpd logfile (/var/log/messages)
<LI> binl logfile (/work/log/binl.log)
</UL>
 
<H3>More...</H3>
I'll add more info when I find out.
 
<BR>
<BR>
<A HREF="win7pxelinux1.html">Go back to the start</A>
<BR>
<BR>
 
<LI><A HREF="win7pxelinux1.html">Go to part 1: Overview</A>
<LI><A HREF="win7pxelinux2.html">Go to part 2: Configuring and starting services</A>
<LI><A HREF="win7pxelinux3.html">Go to part 3: Prepare the windows boot files</A>
<LI><A HREF="win7pxelinux4.html">Go to part 4: Prepare the unattended installation files</A>
<LI><A HREF="win7pxelinux5.html">Go to part 5: Troubleshooting</A>
</TD>
<TD VALIGN=TOP>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-7926266120435192";
/* win7pxelinux */
google_ad_slot = "2210822672";
google_ad_width = 120;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Property changes:
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/doc/default.css
New file
0,0 → 1,39
body { color: black; background: white; font-family: arial,sans-serif;
margin-left: 5%; margin-right: 5%;}
pre { color: black; background: #E6E6F9; font-family: monospace; border: solid;
border-width: thin; padding: 0.5em;}
table { font-size: 85%; }
h1 {
font-size: 200%;
color: #05057A;
}
h2 {
padding: 0.5em;
font-size: 150%;
color: #05057A;
}
h3 {
font-size: 125%;
color: black;
}
 
div.box { border: solid; border-width: thin; width: 100% }
div.center { text-align:center }
.right { float:right }
.left { float:left }
div.color {
background: #ADD7E6;
padding: 0.5em;
border: none;
font-family: monospace;
}
strong { font-size: 90%; color: red }
.gb { color: #197D1D; font-size: 110%; }
.noborder { border-style: none }
li.sp { padding-bottom:12px }
a:link {color:blue}
a:visited {color:purple}
a:focus {color:teal}
a:hover {color:teal}
a:active {color:red}
Property changes:
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/var/se3/unattended/install/seven/wim/winpeshl.ini
New file
0,0 → 1,3
[LaunchApps]
%SYSTEMDRIVE%\sources\new\install.cmd
%SYSTEMDRIVE%\windows\system32\cmd.exe
Property changes:
Added: svn:executable
+ *
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/var/se3/unattended/install/seven/wim/install.cmd
New file
0,0 → 1,114
@ECHO OFF
 
echo Starting windows7.cmd Command Script, press CONTROL+C to interrupt this script
 
echo.
echo Restoring the Setup environment
move %SYSTEMDRIVE%\setup.uda %SYSTEMDRIVE%\setup.exe
move %SYSTEMDRIVE%\sources\setup.uda %SYSTEMDRIVE%\sources\setup.exe
 
 
SET REGEXE=%SYSTEMDRIVE%\windows\system32\reg.exe
 
echo Getting UDA Template info from registry
 
for /f "tokens=2*" %%A IN ('%REGEXE% query HKLM\SYSTEM\CurrentControlSet\Control /f "SystemStartOptions" ^| find "UDA="') DO SET SSO=%%B
 
echo.
echo SYSTEMSTARTOPTIONS=%SSO%
 
echo.
for /f "tokens=1,2,3,4,5,6,7,8,9,10" %%A IN ( "%SSO%" ) DO (
echo %%A | FIND "UDA=" && echo FOUND %%A && SET UDAOPTION=%%A
echo %%B | FIND "UDA=" && echo FOUND %%B && SET UDAOPTION=%%B
echo %%C | FIND "UDA=" && echo FOUND %%C && SET UDAOPTION=%%C
echo %%D | FIND "UDA=" && echo FOUND %%D && SET UDAOPTION=%%D
echo %%E | FIND "UDA=" && echo FOUND %%E && SET UDAOPTION=%%E
echo %%F | FIND "UDA=" && echo FOUND %%F && SET UDAOPTION=%%F
echo %%G | FIND "UDA=" && echo FOUND %%G && SET UDAOPTION=%%G
echo %%H | FIND "UDA=" && echo FOUND %%H && SET UDAOPTION=%%H
echo %%I | FIND "UDA=" && echo FOUND %%I && SET UDAOPTION=%%I
echo %%J | FIND "UDA=" && echo FOUND %%J && SET UDAOPTION=%%J
)
echo.
echo UDAOPTION=%UDAOPTION%
 
for /f "delims=:= tokens=1,2,3,4,5" %%A IN ("%UDAOPTION%") DO (
SET UDA_IPADDR=%%B
SET UDA_TEMPLATE=%%C
SET UDA_SUBTEMPLATE=%%D
SET UDA_DRIVER=%%E
)
 
echo UDA Template info is:
echo.
echo UDA_IPADDR: %UDA_IPADDR%
echo UDA_TEMPLATE: %UDA_TEMPLATE%
echo UDA_SUBTEMPLATE: %UDA_SUBTEMPLATE%
echo UDA_DRIVER: %UDA_DRIVER%
 
 
SET UDADIR=%SYSTEMDRIVE%\sources\uda
SET DRVLOAD=%SYSTEMDRIVE%\windows\system32\drvload.exe
SET WPEINIT=%SYSTEMDRIVE%\windows\system32\wpeinit
SET NETEXE=%SYSTEMDRIVE%\windows\system32\net.exe
SET INSTALLDRIVE=I
 
SET PRESCRIPT=%INSTALLDRIVE%:\pxelinux.cfg\templates\%UDA_TEMPLATE%\%UDA_SUBTEMPLATE%.cmd
 
echo PRESCRIPT=%PRESCRIPT%
 
cd %UDADIR%
 
if "%UDA_DRIVER%"=="" goto tryall
FOR /F "eol=; tokens=1,2,3,4" %%A in ( %SYSTEMDRIVE%\sources\uda\drivers.txt ) DO (
echo Driver=%%A Number=%%B Inffile=%%C Ssysfile=%%D
if not "%%A"=="%UDA_DRIVER%" goto skipload
echo Loading driver %%A
%DRVLOAD% %%C && goto doneloading
echo Could not succesfully load driver %UDA_DRIVER%, trying all instead
goto tryall
:skipload
echo Skipping load of driver %%A
)
 
:tryall
echo Trying all network drivers
FOR /F "eol=; tokens=1,2,3,4" %%A in ( %SYSTEMDRIVE%\sources\uda\drivers.txt ) DO (
echo Driver=%%A Number=%%B Inffile=%%C Ssysfile=%%D
%DRVLOAD% %%C && goto doneloading
echo Could not succesfully load driver %%A, trying next one
)
 
goto manual
 
:doneloading
 
 
echo.
echo Starting the network
%WPEINIT%
if not %ERRORLEVEL%==0 goto manual
 
echo.
echo Mapping the network share
%NETEXE% use %INSTALLDRIVE%: \\%UDA_IPADDR%\REMINST
 
echo.
echo Handing over command to the remote template script and not coming back!
if EXIST %PRESCRIPT% %PRESCRIPT% %UDA_IPADDR% %UDA_TEMPLATE% %UDA_SUBTEMPLATE%
 
pause
:manual
echo.
echo Could not succesfully load a network driver, please try manually
echo you should do something like:
echo.
echo drvload x:\sources\uda\netamd.inf
echo wpeinit
echo net use i: \\%UDA_IPADDR%\REMINST
echo %PRESCRIPT% %UDA_IPADDR% %UDA_TEMPLATE% %UDA_SUBTEMPLATE%
echo.
 
cmd.exe
pause
Property changes:
Added: svn:keywords
+ Id URL Revision Author
Added: svn:executable
+ *
/trunk/se3-seven/var/se3/unattended/install/seven/wim/actionfile.txt
New file
0,0 → 1,7
rename //setup.exe setup.new
rename //sources/setup.exe setup.new
add //windows/system32/winpeshl.ini
mkdir //sources/new
add //sources/new netamd.inf
add //sources/new pcntpci5.sys
add //sources/new install.cmd
Property changes:
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/var/se3/unattended/install/seven/system1.xml
New file
0,0 → 1,159
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UserLocale>en-US</UserLocale>
</component>
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UserLocale>en-US</UserLocale>
</component>
<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ImageInstall>
<OSImage>
<WillShowUI>OnError</WillShowUI>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>1</PartitionID>
</InstallTo>
<InstallFrom>
<Path>i:\win7\sources\install.wim</Path>
<MetaData wcm:action="add">
<Key>/IMAGE/INDEX</Key>
<Value>1</Value>
</MetaData>
</InstallFrom>
</OSImage>
</ImageInstall>
<UserData>
<AcceptEula>true</AcceptEula>
<ProductKey>
<Key>#CODE</Key>
</ProductKey>
</UserData>
<WindowsDeploymentServices>
<Login>
<WillShowUI>OnError</WillShowUI>
<Credentials>
<Username>Administrator</Username>
<Domain>domain.com</Domain>
<Password>Password1</Password>
</Credentials>
</Login>
</WindowsDeploymentServices>
</component>
<component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ImageInstall>
<OSImage>
<WillShowUI>OnError</WillShowUI>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>1</PartitionID>
</InstallTo>
<InstallFrom>
<Path>i:\win7\sources\install.wim</Path>
<MetaData wcm:action="add">
<Key>/IMAGE/INDEX</Key>
<Value>1</Value>
</MetaData>
</InstallFrom>
</OSImage>
</ImageInstall>
<UserData>
<AcceptEula>true</AcceptEula>
</UserData>
<WindowsDeploymentServices>
<Login>
<WillShowUI>OnError</WillShowUI>
<Credentials>
<Username>unattend</Username>
<Domain>#SE3_DOMAIN</Domain>
<Password>#UNATTEND_PASS</Password>
</Credentials>
</Login>
</WindowsDeploymentServices>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ProductKey>#CODE</ProductKey>
<OOBE>
<ProtectYourPC>3</ProtectYourPC>
<NetworkLocation>Work</NetworkLocation>
<HideEULAPage>true</HideEULAPage>
</OOBE>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Order>1</Order>
<CommandLine>CommandLine: cscript //b c:\windows\system32\slmgr.vbs /ipk #CODE </CommandLine>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<CommandLine>CommandLine: cscript //b c:\windows\system32\slmgr.vbs /ato</CommandLine>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>3</Order>
<CommandLine>CommandLine: \\se3\rejointse3.cmd</CommandLine>
</SynchronousCommand>
 
</FirstLogonCommands>
<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value>wawa</Value>
<PlainText>true</PlainText>
</Password>
<Name>administrateur</Name>
<Group>Administrators</Group>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<TimeZone>India Standard Time</TimeZone>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Order>1</Order>
<CommandLine>CommandLine: cscript //b c:\windows\system32\slmgr.vbs /ipk #KEY </CommandLine>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<CommandLine>CommandLine: cscript //b c:\windows\system32\slmgr.vbs /ato</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
<OOBE>
<ProtectYourPC>3</ProtectYourPC>
<NetworkLocation>Home</NetworkLocation>
<HideEULAPage>true</HideEULAPage>
</OOBE>
<AutoLogon>
<Password>
<Value>wawa</Value>
<PlainText>true</PlainText>
</Password>
<Username>Administrateur</Username>
<Enabled>true</Enabled>
<LogonCount>5</LogonCount>
</AutoLogon>
<UserAccounts>
<AdministratorPassword>
<Value>wawa</Value>
<PlainText>true</PlainText>
</AdministratorPassword>
</UserAccounts>
<TimeZone>India Standard Time</TimeZone>
</component>
</settings>
<settings pass="offlineServicing">
<component name="Microsoft-Windows-LUA-Settings" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<EnableLUA>false</EnableLUA>
</component>
</settings>
<cpi:offlineImage cpi:source="wim:i:/win7/sources/install.wim#Windows 7 HOMEPREMIUM" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>
Property changes:
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/var/se3/unattended/install/seven/system2.xml
New file
0,0 → 1,120
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UserLocale>en-US</UserLocale>
</component>
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UserLocale>en-US</UserLocale>
</component>
<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ImageInstall>
<OSImage>
<WillShowUI>OnError</WillShowUI>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>1</PartitionID>
</InstallTo>
<InstallFrom>
<Path>i:\win7\sources\install.wim</Path>
<MetaData wcm:action="add">
<Key>/IMAGE/INDEX</Key>
<Value>1</Value>
</MetaData>
</InstallFrom>
</OSImage>
</ImageInstall>
<UserData>
<AcceptEula>true</AcceptEula>
</UserData>
<WindowsDeploymentServices>
<Login>
<WillShowUI>OnError</WillShowUI>
<Credentials>
<Username>Administrator</Username>
<Domain>domain.com</Domain>
<Password>Password1</Password>
</Credentials>
</Login>
</WindowsDeploymentServices>
</component>
<component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ImageInstall>
<OSImage>
<WillShowUI>OnError</WillShowUI>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>1</PartitionID>
</InstallTo>
<InstallFrom>
<Path>i:\win7\sources\install.wim</Path>
<MetaData wcm:action="add">
<Key>/IMAGE/INDEX</Key>
<Value>1</Value>
</MetaData>
</InstallFrom>
</OSImage>
</ImageInstall>
<UserData>
<AcceptEula>true</AcceptEula>
</UserData>
<WindowsDeploymentServices>
<Login>
<WillShowUI>OnError</WillShowUI>
<Credentials>
<Username>Administrator</Username>
<Domain>domain.com</Domain>
<Password>Password1</Password>
</Credentials>
</Login>
</WindowsDeploymentServices>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<OOBE>
<ProtectYourPC>3</ProtectYourPC>
<NetworkLocation>Home</NetworkLocation>
</OOBE>
<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value></Value>
<PlainText>true</PlainText>
</Password>
<Name>admin</Name>
<Group>Administrators</Group>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<TimeZone>India Standard Time</TimeZone>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<OOBE>
<ProtectYourPC>3</ProtectYourPC>
<NetworkLocation>Home</NetworkLocation>
</OOBE>
<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value></Value>
<PlainText>true</PlainText>
</Password>
<Name>omdhar</Name>
<Group>Administrators</Group>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<TimeZone>India Standard Time</TimeZone>
</component>
</settings>
<cpi:offlineImage cpi:source="wim:i:/win7/sources/install.wim#Windows 7 HOMEPREMIUM" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>
Property changes:
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/usr/share/se3/scripts/prepare-seven.sh
New file
0,0 → 1,40
# preparation des ficihers seven en vue du boot pxe
#$Id$
# http://www.ultimatedeployment.org/win7pxelinux1.html
 
tftproot=/tftpboot
seven_disk=/var/se3/unattended/install/os/$1
 
# extraction des fichiers de boot pxe seven
 
cd $tftproot
/usr/bin/wimextract $seven_disk/sources/boot.wim //windows/boot/pxe pxeboot.n12
mv pxeboot.n12 pxeboot.com
/usr/bin/wimextract $seven_disk/sources/boot.wim //windows/boot/pxe bootmgr.exe
/usr/bin/wimextract $seven_disk/sources/boot.wim //windows/boot/pxe wdsnbp.com
cp $seven_disk/boot/boot.sdi $tftproot
 
# creation des menus ?
 
cp -r $seven_disk/boot/bcd $tftproot/seven64
/usr/bin/bcdedit.pl $tftproot/seven32/bcd /winpe.wim /boot.sdi INFO=10.0.0.1:seven64
cp $tftproot/wdsnbp.com $tftproot/seven64/wdsnbp.0
 
cp -r $seven_disk/boot/bcd $tftproot/seven32
/usr/bin/bcdedit.pl $tftproot/system32/bcd /winpe.wim /boot.sdi INFO=10.0.0.1:seven32
cp $tftproot/wdsnbp.com $tftproot/seven32/wdsnbp.0
 
cd /var/se3/unattended/install/seven/wim
/usr/bin/updatewim $seven_disk/sources/boot.wim /tftproot/winpe.wim actionfile.txt
 
 
# recherche de l'index de l'image seven pro a installer
 
/usr/share/se3/scripts/sevenxml.py
 
( a l'arrache !)
 
type=$(grep -A1 "EditionID" $seven_disk/sources/ei.cfg | tail -1)
regexp="<FLAGS>" . $type . "</FLAGS>"
index=$(/usr/bin/wimxmlinfo $seven_disk/sources/install.wim | sed 's/\(<\/[A-Z]*>\)/\1\n/g' | sed 's/></>\n</g' | grep -B36 $regexp | grep "<IMAGE INDEX=" | sed 's/<IMAGE INDEX="\([0-9]\)">$/\1/'
 
Property changes:
Added: svn:eol-style
+ native
Added: svn:executable
+ *
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/usr/share/se3/scripts/sevenxml.py
New file
0,0 → 1,33
import sys
from xml.dom import minidom
import ConfigParser
 
config = ConfigParser.RawConfigParser()
seven_path='/var/se3/unattended/install/os/seven'
try:
lang=config.read(seven_path + '/sources/lang.ini')
locale=lang.options('Available UI Languages')[0]
except OSError:
print "impossible d'ouvrir lang.ini"
 
try:
ei=config.read(seven_path + '/sources/ei.cfg')
EditionID=ei.options('EditionID')[0]
except OSError:
print "impossible d'ouvrir ei.cfg"
 
try:
installxml = system('/usr/bin/wimextractxml ' + seven_path + '/sources/install.xml | iconv -c')
except OSError:
print "impossible d'ouvrir install.xml"
install = minidom.parseString(installxml)
for flag in install.getElementsByTagName("FLAGS"):
if flag.firstChild.data == EditionID :
index=flag.parentNode.attributes["INDEX"].value
break
try:
unattend = minidom.parseFile(seven_path + '/unattend.xml')
except OSError:
print "impossible d'ouvrir unattend.xml"
Property changes:
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/usr/bin/bcdedit.pl
New file
0,0 → 1,256
#!/usr/bin/perl
 
my($BCDFILE)=shift;
my($WIMPATH)=shift;
my($SDIPATH)=shift;
my($STARTOPTIONS)=shift;
my($HIVEXSH)="/usr/bin/hivexsh";
my(%guids)=("bootmgr" => "{9dea862c-5cdd-4e70-acc1-f32b344d4795}",
"ramdiskoptions","{ae5534e0-a924-466c-b836-758539a3ee3a}");
my($newguid)="{65c31250-afa2-11df-8045-000c29f37d88}";
 
sub Usage()
{
print "$0 <bcdfile> <wimpath> <sdipath> [startoptions]\n";
exit 1;
}
 
if ($BCDFILE eq "" || $WIMPATH eq "" || $SDIPATH eq "")
{
&Usage();
}
$WIMPATH =~ s|/|\\|g;
$SDIPATH =~ s|/|\\|g;
 
 
sub Cleanup
{
local($bcd)=shift;
local($TEMPFILE1)="/tmp/bcdtemp1.$$";
local($TEMPFILE2)="/tmp/bcdtemp2.$$";
open(TEMP,">$TEMPFILE1") || die "Cannot open tempfile";
print TEMP "cd Objects\n";
print TEMP "ls\n";
close(TEMP);
 
local(@objects)=`$HIVEXSH $bcd -f $TEMPFILE1`;
 
unlink($TEMPFILE1);
 
open(TEMP2,">$TEMPFILE2");
print TEMP2 "cd Objects\n";
for $object (@objects)
{
chomp($object);
# print "Adding Removing Object $object\n";
print TEMP2 "cd $object\n";
print TEMP2 "del\n";
}
print TEMP2 "commit\n";
close(TEMP2);
local(@result)=`$HIVEXSH -w $bcd -f $TEMPFILE2`;
if ($? != 0)
{
print("Error Cleaning up BCD file $bcd\n");
return 1;
}
unlink($TEMPFILE2);
return 0;
}
 
sub CreateGuid
{
my($bcdfile)=shift;
my($guid)=shift;
my($type)=shift;
local($TEMPFILE3)="/tmp/bcdtemp3.$$";
open(TEMP,">$TEMPFILE3") || die "Cannot open tempfile";
print TEMP "cd Objects\n";
print TEMP "add $guid\n";
print TEMP "cd $guid\n";
print TEMP "add Description\n";
print TEMP "cd Description\n";
print TEMP "setval 1\n";
print TEMP "Type\n";
print TEMP "dword:$type\n";
print TEMP "cd ..\n";
print TEMP "add Elements\n";
print TEMP "commit\n";
close(TEMP);
local(@result)=`$HIVEXSH -w $bcdfile -f $TEMPFILE3`;
if ($? != 0)
{
print("Error adding guid $guid with type $type to $bcdfile\n");
return 1;
}
unlink($TEMPFILE3);
return 0;
}
 
sub AddElement()
{
my($bcdfile)=shift;
my($guid)=shift;
my($element)=shift;
my($value)=shift;
 
local($TEMPFILE4)="/tmp/bcdtemp4.$$";
open(TEMP,">$TEMPFILE4") || die "Cannot open tempfile";
print TEMP "cd Objects\n";
print TEMP "cd $guid\n";
print TEMP "cd Elements\n";
print TEMP "add $element\n";
print TEMP "cd $element\n";
print TEMP "setval 1\n";
print TEMP "Element\n";
print TEMP "$value\n";
print TEMP "commit\n";
close(TEMP);
 
local(@result)=`$HIVEXSH -w $bcdfile -f $TEMPFILE4`;
if ($? != 0)
{
print("Error adding Element $element with value $value to guid $guid with type in $bcdfile\n");
return 1;
}
unlink($TEMPFILE4);
return 0;
}
 
sub DecToHex
{
my($val)=shift;
my($hexval)=sprintf("%x",$val);
return $hexval;
}
 
sub Guids2MultiSZ
{
my(@guidlist)=@_;
my($multisz)="hex:7:";
for $myguid (@guidlist)
{
my(@chararray)=split(undef,$myguid);
for $mychar (@chararray)
{
$multisz.=",".&DecToHex(ord($mychar));
$multisz.=",00";
}
$multisz.=",00,00";
}
$multisz.=",00,00";
return $multisz;
}
 
sub Path2Binary
{
my($path)=shift;
my($binary)="";
my(@chararray)=split(undef,$path);
for $mychar (@chararray)
{
$binary.=",".&DecToHex(ord($mychar)).",00";
}
return $binary;
}
 
sub Guid2Binary
{
my($guid)=shift;
my($binary)="";
my(@chararray)=split(undef,$guid);
$binary.=$chararray[7];
$binary.=$chararray[8];
$binary.=",";
$binary.=$chararray[5];
$binary.=$chararray[6];
$binary.=",";
$binary.=$chararray[3];
$binary.=$chararray[4];
$binary.=",";
$binary.=$chararray[1];
$binary.=$chararray[2];
$binary.=",";
$binary.=$chararray[12];
$binary.=$chararray[13];
$binary.=",";
$binary.=$chararray[10];
$binary.=$chararray[11];
$binary.=",";
$binary.=$chararray[17];
$binary.=$chararray[18];
$binary.=",";
$binary.=$chararray[15];
$binary.=$chararray[16];
$binary.=",";
$binary.=$chararray[20];
$binary.=$chararray[21];
$binary.=",";
$binary.=$chararray[22];
$binary.=$chararray[23];
$binary.=",";
$binary.=$chararray[25];
$binary.=$chararray[26];
$binary.=",";
$binary.=$chararray[27];
$binary.=$chararray[28];
$binary.=",";
$binary.=$chararray[29];
$binary.=$chararray[30];
$binary.=",";
$binary.=$chararray[31];
$binary.=$chararray[32];
$binary.=",";
$binary.=$chararray[33];
$binary.=$chararray[34];
$binary.=",";
$binary.=$chararray[35];
$binary.=$chararray[36];
 
return $binary;
}
 
sub MyLength
{
my($path)=shift;
my($add)=shift;
my($result)=$add+(2*length($path));
return DecToHex($result);
}
 
 
print "BCDfile = $BCDFILE\n";
 
&Cleanup($BCDFILE);
 
print "Creating Bootmgr Object\n";
&CreateGuid($BCDFILE,$guids{bootmgr},"0x10100002");
&AddElement($BCDFILE,$guids{bootmgr},"25000004","hex:3:1e,00,00,00,00,00,00,00");
&AddElement($BCDFILE,$guids{bootmgr},"12000004","string:Windows Boot Manager");
&AddElement($BCDFILE,$guids{bootmgr},"24000001",&Guids2MultiSZ($newguid));
 
print "Creating New Object\n";
&CreateGuid($BCDFILE,$newguid,"0x10200003");
&AddElement($BCDFILE,$newguid,"12000004","string:Windows PE");
&AddElement($BCDFILE,$newguid,"22000002","string:\\Windows");
&AddElement($BCDFILE,$newguid,"26000010","hex:3:01");
&AddElement($BCDFILE,$newguid,"26000022","hex:3:01");
&AddElement($BCDFILE,$newguid,"11000001","hex:3:".Guid2Binary($guids{ramdiskoptions}).",00,00,00,00,01,00,00,00,".&MyLength($WIMPATH,126).",00,00,00,00,00,00,00,03,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,01,00,00,00,".&MyLength($WIMPATH,86).",00,00,00,05,00,00,00,05,00,00,00,00,00,00,00,48,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00".&Path2Binary($WIMPATH)."00,00");
&AddElement($BCDFILE,$newguid,"21000001","hex:3:".Guid2Binary($guids{ramdiskoptions}).",00,00,00,00,01,00,00,00,".&MyLength($WIMPATH,126).",00,00,00,00,00,00,00,03,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,01,00,00,00,".&MyLength($WIMPATH,86).",00,00,00,05,00,00,00,05,00,00,00,00,00,00,00,48,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00".&Path2Binary($WIMPATH)."00,00");
 
if ($STARTOPTIONS ne "")
{
&AddElement($BCDFILE,$newguid,"12000030","string:".$STARTOPTIONS);
}
 
print "Creating Ramdisk Options\n";
&CreateGuid($BCDFILE,$guids{ramdiskoptions},"0x30000000");
&AddElement($BCDFILE,$guids{ramdiskoptions},"12000004","string:Ramdisk Options");
&AddElement($BCDFILE,$guids{ramdiskoptions},"32000004","string:".$SDIPATH);
&AddElement($BCDFILE,$guids{ramdiskoptions},"31000003","hex:3:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,05,00,00,00,00,00,00,00,48,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00");
 
print "Succesfully updates $BCDFILE\n";
Property changes:
Added: svn:executable
+ *
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/usr/bin/binlsrv2.py
New file
0,0 → 1,1173
#!/usr/bin/env python
# -*- Mode: Python; tab-width: 4 -*-
#
# Boot Information Negotiation Layer - OpenSource Implementation
#
# Copyright (C) 2005-2007 Gianluigi Tiesi <sherpya@netfarm.it>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
# ======================================================================
 
from socket import socket, AF_INET, SOCK_DGRAM, getfqdn, gethostbyname, gethostname
from codecs import utf_16_le_decode, utf_16_le_encode, ascii_encode
from struct import unpack, pack
from sys import argv, exit as sys_exit
from signal import signal, SIGINT, SIGTERM
from time import sleep, time
from datetime import datetime
from md5 import md5
from cPickle import load
from os import chdir, getpid, unlink, listdir, path, popen
from getopt import getopt, error as getopt_error
 
## NTML Auth Code from: NTLM Authorization Proxy Server
## Copyright 2001 Dmitry A. Rozmanov <dima@xenon.spb.ru>
crypto = True
try:
from Crypto.Hash import MD4
from Crypto.Cipher import DES
except:
crypto = False
 
__version__ = '1.0'
__usage__ = """Usage %s: [-h] [-d] [-l logfile] [-a address] [-p port]
[--pid pidfile] [devlist.cache]
-h, --help : show this help
-d, --daemon : daemonize, unix only [false]
-l, --logfile= : logfile when used in daemon mode [/var/log/binlsrv.log]
-a, --address= : ip address to bind to [all interfaces]
-p, --port= : port to bind to [4011]
--pid= : pid file to use instead of the default
devlist.cache : device list cache file [devlist.cache in current dir]
"""
 
OSC_NOTFOUND="""<OSCML>
<META KEY=F3 ACTION="REBOOT">
<TITLE> Client Installation Wizard</TITLE>
<FOOTER> [F3] restart computer</FOOTER>
<BODY left=5 right=75>
<BR><BR>The requested file %s was not found on the server
</BODY>
</OSCML>
"""
 
#############
# Make sure there is the trailing / here
BASEPATH = '/mnt/disk/ris/OSChooser/English/'
WELCOME = 'welcome.osc'
DUMPING = False
 
#############
 
NTLM_NEGOTIATE = 1
NTLM_CHALLENGE = 2
NTLM_AUTHENTICATE = 3
NTLM_ANY = 0
 
#define NTLMSSP_NEGOTIATE_UNICODE 0x00000001
#define NTLMSSP_NEGOTIATE_OEM 0x00000002
#define NTLMSSP_REQUEST_TARGET 0x00000004
#define NTLMSSP_NEGOTIATE_SIGN 0x00000010
#define NTLMSSP_NEGOTIATE_SEAL 0x00000020
#define NTLMSSP_NEGOTIATE_LM_KEY 0x00000080
#define NTLMSSP_NEGOTIATE_NTLM 0x00000200
#define NTLMSSP_NEGOTIATE_00001000 0x00001000
#define NTLMSSP_NEGOTIATE_00002000 0x00002000
#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN 0x00008000
#define NTLMSSP_TARGET_TYPE_DOMAIN 0x00010000
#define NTLMSSP_TARGET_TYPE_SERVER 0x00020000
#define NTLMSSP_NEGOTIATE_NTLM2 0x00080000
#define NTLMSSP_NEGOTIATE_TARGET_INFO 0x00800000
#define NTLMSSP_NEGOTIATE_128 0x20000000
#define NTLMSSP_NEGOTIATE_KEY_EXCH 0x40000000
 
# NTLMSSP_REQUEST_TARGET | NTLMSSP_NEGOTIATE_OEM | NTLMSSP_NEGOTIATE_UNICODE
# NTLMSSP_NEGOTIATE_NTLM
#0x00000000
# 2 5
 
#0x00018206 ->
# X -> NTLMSSP_REQUEST_TARGET | NTLMSSP_NEGOTIATE_OEM
# X -> NTLMSSP_NEGOTIATE_NTLM
# X -> NTLMSSP_NEGOTIATE_ALWAYS_SIGN
# X -> NTLMSSP_TARGET_TYPE_DOMAIN
 
#0x00808011 ->
# X -> NTLMSSP_NEGOTIATE_UNICODE
# X -> NTLMSSP_NEGOTIATE_SIGN
# X -> NTLMSSP_NEGOTIATE_ALWAYS_SIGN
# X -> NTLMSSP_NEGOTIATE_TARGET_INFO
 
#0xa2898215 ->
# X -> NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_REQUEST_TARGET
# X -> NTLMSSP_NEGOTIATE_SIGN
# X -> NTLMSSP_NEGOTIATE_NTLM
# X -> NTLMSSP_NEGOTIATE_ALWAYS_SIGN
# X -> NTLMSSP_NEGOTIATE_NTLM2 | NTLMSSP_TARGET_TYPE_DOMAIN
# X -> ???
# X -> ???
 
 
#0xC000006FL The user is not allowed to log on at this time.
#0xC0000070L The user is not allowed to log on from this workstation.
#0xC0000071L The password of this user has expired.
#0xC0000072L Account currently disabled.
#0xC0000193L This user account has expired.
#0xC0000224L The user.s password must be changed before logging on the first time.
 
AUTH_OK = 0x00000000L
SEC_E_LOGON_DENIED = 0x8009030cL
 
MAGIC_COOKIE = '\x63\x82\x53\x63'
MAGIC_OFFSET = 0xec
 
MAGIC = 'KGS!@#$%'
C = '\x81'
S = '\x82'
 
FILEREQ = C+'RQU' # 8152 5155 - OSC File request
FILEREPLY = S+'RSU' # 8252 5355 - OSC File reply
 
NEG = C+'NEG' # 814e 4547 - NTLM Negotiate
CHL = S+'CHL' # 8243 484c - NTLM Sending Challenge
 
AUT = C+'AUT' # 8141 5554 - NTLM Autorize
RES = S+'RES' # 8252 4553 - NTLM Auth reply
 
NCQ = C+'NCQ' # 814e 4351 - Network Card Query
NCR = S+'NCR' # 824e 4352 - Network Card Reply
 
REQ = C+'REQ' # 8152 4551 - Unknown :(
RSP = S+'RSP' # 8252 5350 - Unknown :(
 
OFF = C+'OFF' # 814f 4646 - Reboot to new pxe rom
 
# Session expired, only works with code 0x1
UNR = S+'UNR' # 8255 4e52
 
myfqdn = getfqdn()
myhostinfo = myfqdn.split('.', 1)
mydomain = myhostinfo.pop()
mynbdomain = 'RIS' # FIXME
 
# workaround if hosts file is misconfigured
try:
myhostname = myhostinfo.pop()
except:
myhostname = mydomain
 
server_data = {
'nbname' : myhostname.upper(),
'nbdomain' : mynbdomain,
'dnshostname': myhostname,
'dnsdomain' : mydomain
}
 
tr_table = {
'%SERVERNAME%' : server_data['nbname'],
'%SERVERDOMAIN%' : server_data['nbdomain'],
'%MACHINENAME%' : 'client',
'%NTLMV2Enabled%' : '0',
'%ServerUTCFileTime%' : str(int(time()))
}
 
users = {
'Administrator': 'secret'
}
 
bootp = {
53: ['h', 'DHCP Request'],
54: ['c', 'Server Identifier'],
55: ['h', 'Paramter Request list'],
57: ['h', 'Max DHCP message size'],
60: ['s', 'Vendor'],
93: ['h', 'Client Arch'],
94: ['h', 'Client Network Device Interface'],
97: ['h', 'Client GUID'],
250: ['h', 'Private'], # 01020006ff
252: ['s', 'Boot Configuration Data File']
}
 
flavordevlist = None
 
count = 0
 
regtype = [ 'REG_NONE', 'REG_SZ', 'REG_EXPAND_SZ', 'REG_BINARY', 'REG_DWORD', 'REG_MULTI_SZ' ]
codes = [ 'None', 'NetBiosName', 'NetBiosDomain', 'DNSHostName', 'DNSDomain', 'DNSDomain2' ]
 
NULL = chr(0x0)
NTLM = 'NTLMSSP\x00'
 
### Logger class wrapper
class Log:
"""file like for writes with auto flush after each write
to ensure that everything is logged, even during an
unexpected exit."""
def __init__(self, f):
self.f = f
def write(self, s):
self.f.write(s)
self.f.flush()
 
def shutdown(signum, frame):
global pidfile, s
try:
s.close()
except:
print 'Cannot shutdown the socket'
try:
unlink(pidfile)
except:
pass
thistime = datetime.now()
print thistime.strftime("%Y-%m-%d %H:%M:%S") + ' Shutdown done'
sys_exit(0)
 
def dotted(data):
res = ''
for i in range(len(data)):
if (ord(data[i]) < 32) or (ord(data[i]) > 127):
res += '.'
else:
res += data[i]
return res
 
def hexdump(data):
data_len = len(data)
off = 0
base = 0
while 1:
start = off
end = off + 8
if end > data_len: end = data_len
values1 = ' '.join([ '%02x' % ord(data[x]) for x in range(start, end) ])
data1 = dotted(data[off:off+8])
off += 8
 
start = off
if start > data_len: start = data_len
end = off + 8
if end > data_len: end = data_len
 
values2 = ' '.join([ '%02x' % ord(data[x]) for x in range(start, end) ])
data2 = dotted(data[off:off+8])
off += 8
 
print '%08x %-23s %-23s |%-8s%-8s|' % (base, values1, values2, data1, data2)
base += 16
if end - start < 8: break
 
def utf2ascii(text):
return ascii_encode(utf_16_le_decode(text, 'ignore')[0], 'ignore')[0]
 
def byte2ip(data):
return '%d.%d.%d.%d' % (ord(data[0]), ord(data[1]), ord(data[2]), ord(data[3]))
 
def ip2byte(ip):
try:
a, b, c, d = ip.split('.')
return chr(int(a)) + chr(int(b)) + chr(int(c)) + chr(int(d))
except:
return '\x00' * 4
 
def get_packet(s):
global pidfile
try:
data, addr = s.recvfrom(1024)
except KeyboardInterrupt:
print 'Server terminated by user request'
shutdown(0, 0)
 
# Binl packet
if (data[0] == C) or (data[0] == S):
pktype = data[:4]
data = data[4:]
l = unpack('<I', data[:4])[0]
print 'Recv BINL %s len = %d' % (str(pktype[1:]), l)
data = data[4:]
return addr, pktype, data
 
## BOOTP WDS Packet
if data[0xec:0xf0] == MAGIC_COOKIE:
return addr, MAGIC_COOKIE, data
 
## Unknown
return addr, None, data
 
 
def translate(text):
for tr in tr_table.keys():
text = tr_table[tr].join(text.split(tr))
return text
 
def send_file(s, addr, u1, basepath, filename):
reply = FILEREPLY
fullpath = basepath + filename
try:
data = open(fullpath).read()
print 'Sending', fullpath
except:
print 'Cannot find file', fullpath
data = OSC_NOTFOUND % filename
 
data = translate(data)
 
l = pack('<I', len(data) + len(u1) + 1)
reply = reply + l + u1 + data + NULL
s.sendto(reply, addr)
 
 
def key56_to_key64(strkey):
key_56 = []
for i in strkey[:7]: key_56.append(ord(i))
key = []
for i in range(8): key.append(0)
 
key[0] = key_56[0];
key[1] = ((key_56[0] << 7) & 0xff) | (key_56[1] >> 1)
key[2] = ((key_56[1] << 6) & 0xff) | (key_56[2] >> 2)
key[3] = ((key_56[2] << 5) & 0xff) | (key_56[3] >> 3)
key[4] = ((key_56[3] << 4) & 0xff) | (key_56[4] >> 4)
key[5] = ((key_56[4] << 3) & 0xff) | (key_56[5] >> 5)
key[6] = ((key_56[5] << 2) & 0xff) | (key_56[6] >> 6)
key[7] = (key_56[6] << 1) & 0xff
 
for i in range(len(key)):
for k in range(7):
bit = 0
t = key[i] >> k
bit = (t ^ bit) & 0x1
key[i] = (key[i] & 0xfe) | bit
 
k = ''
for i in range(len(key)):
k = k + chr(key[i])
return k
 
def do_des(key, chl):
key = key56_to_key64(key)
obj = DES.new(key)
return obj.encrypt(chl)
 
def nt_response(password, challenge):
md4 = MD4.new()
md4.update(password.encode('utf-16le'))
pw = md4.digest() + (NULL * 5)
return do_des(pw[0:7], challenge) + do_des(pw[7:14], challenge) + do_des(pw[14:21], challenge)
 
def gen_challenge(addr):
c = md5()
c.update(addr[0])
c.update(str(addr[1]))
return c.digest()[:8]
 
def send_challenge(s, addr, sd):
nbname = sd['nbname'].encode('utf-16le')
nbdomain = sd['nbdomain'].encode('utf-16le')
dnshostname = sd['dnshostname'].encode('utf-16le')
dnsdomain = sd['dnsdomain'].encode('utf-16le')
 
payload = pack('<H', codes.index('NetBiosDomain')) + pack('<H', len(nbdomain)) + nbdomain + \
pack('<H', codes.index('NetBiosName')) + pack('<H', len(nbname)) + nbname + \
pack('<H', codes.index('DNSDomain')) + pack('<H', len(dnsdomain)) + dnsdomain + \
pack('<H', codes.index('DNSHostName')) + pack('<H', len(dnshostname)) + dnshostname + \
pack('<H', codes.index('DNSDomain2')) + pack('<H', len(dnsdomain)) + dnsdomain + \
(NULL * 4)
 
data = NTLM + pack('<I', NTLM_CHALLENGE)
challenge = gen_challenge(addr)
auth_u1 = '\x05\x02\xCE\x0E\x00\x00\x00\x0F'
 
off = 0x38
#flags = 0xa2898215L
flags = 0x00010206L # NTLM v1
 
data = data + encodehdr(nbdomain, off)
off = off + len(nbdomain)
 
data = data + pack('<I', flags)
 
data = data + challenge + (NULL*8)
data = data + encodehdr(payload, off)
data = data + auth_u1
data = data + nbdomain + payload
 
reply = CHL + pack('<I', len(data)) + data
decode_ntlm('[S]', data)
s.sendto(reply, addr)
 
def send_res(s, addr, data):
res = decodehdr(data[20:], data)
domain = decodehdr(data[28:], data)
user = decodehdr(data[36:], data)
 
result = SEC_E_LOGON_DENIED
if crypto \
and (domain == server_data['nbdomain']) \
and users.has_key(user) \
and (res == nt_response(users[user], gen_challenge(addr))):
print '[S]', 'User Authenticated'
result = AUTH_OK
 
reply = RES
data = pack('<I', result)
l = pack('<I', len(data))
reply = reply + l + data
print 'Sending Reply 0x%x' % result
s.sendto(reply, addr)
 
def dumphdr(data, pkt):
return repr(utf2ascii(decodehdr(data, pkt)))
 
def decodehdr(data, pkt):
slen, maxlen, off = unpack('<HHI', data[:8])
value = pkt[off:off+slen]
return value
 
def encodehdr(value, off):
return pack('<HHI', len(value), len(value), off)
 
 
def format_hex(data):
res = ''
for i in range(len(data)):
res += '%02x' % ord(data[i])
return res
 
def bootp_dump(p, opt, value):
t, name = bootp.get(opt, ['h', 'Unknown opt %d' % opt])
if t == 'h': value = format_hex(value)
if t == 'c': value = byte2ip(value)
print p, 'DHCP option %s value: %s' % (name, value)
 
def decode_bootp(p, data):
print p, '-' * 78
print p, 'WDS Packet: Vista network client'
 
info = {}
 
packet = data[:]
if len(data) < (2 + 0xe6): ## FIXME
print p, 'Short packet'
return info
 
opts = data[MAGIC_OFFSET+4:]
mt, ht = ord(data[0]), ord(data[1]) # ht == 1 -> Ethernet
data = data[2:]
 
if mt == 1:
print p, 'Boot Request'
elif mt == 2:
print p, 'Boot Reply'
else:
print p, 'Unsupported BootP Type', mt
hexdump(data)
 
hl, hops = ord(data[0]), ord(data[1])
print p, 'Hardware Len', hl
data = data[2:]
 
tid = unpack('>I', data[:4])[0]
info['tid'] = tid
print p, 'Transaction ID 0x%08x' % tid
data = data[4:]
 
sec = unpack('>H', data[:2])[0]
print p, 'Seconds elapsed %d' % sec
data = data[2:]
 
bpf = unpack('>H', data[:2])[0]
print p, 'BootP flags = 0x%04x' % bpf
data = data[2:]
 
clientip = data[:4]
print p, 'Client IP', byte2ip(clientip)
data = data[4:]
 
yourip = data[:4]
print p, 'Your IP', byte2ip(yourip)
data = data[4:]
 
next = data[:4]
print p, 'Next Server IP', byte2ip(next)
data = data[4:]
 
ragent = data[:4]
print p, 'Relay Agent IP', byte2ip(ragent)
data = data[4:]
 
hl = min(hl, 16)
mac = [ord(x) for x in data[:hl]]
print p, 'Mac address', ':'.join(['%02x' % x for x in mac])
info['mac'] = data[:16]
data = data[16:]
 
hostname = data[:64].replace(NULL, '').strip()
print p, 'Hostname:', hostname
data = data[64:]
 
bootfile = data[:128].replace(NULL, '').strip()
print p, 'Boot file:', bootfile
data = data[128:]
 
magic = data[:4]
if magic != MAGIC_COOKIE:
print p, 'Magic cookie is not on the right place', repr(magic)
#open('bad_cookie.hex', 'wb').write(packet)
return info
data = data[4:]
 
if opts != data:
print p, 'Options not in the right place', repr(opts[:16]), repr(data[:16])
return info
 
while len(opts) > 1: # FIXME: there is always at least 1 byte padded?
opt = ord(opts[0])
if opt == 0xff: break # End packet
length = ord(opts[1])
opts = opts[2:]
if len(opts) < length: break # Bad packet
value = opts[:length]
opts = opts[length:]
## FIXME
if opt == 97: info['guid'] = value
bootp_dump(p, opt, value)
return info
 
def send_bootp(s, addr, info):
getipcmd='/sbin/ifconfig eth0 | grep "inet addr" | awk \'{print $2}\' | awk \'{print $2}\' FS=:'
ipf=popen(getipcmd)
hostip=ipf.readline().rstrip()
ipf.close
# hostip = gethostbyname(gethostname())
# print 'hostip = ' + hostip
p = chr(0x2) # Boot Reply
p = p + chr(0x1) # hw type: ethernet
p = p + chr(0x6) # hw addr len
p = p + chr(0x0) # hops
p = p + pack('>I', info['tid']) # TID
p = p + pack('>H', 4) # seconds
p = p + pack('>H', 0) # flags 0 = unicast
p = p + ip2byte(addr[0]) # client ip
p = p + ip2byte('0.0.0.0') # your ip
p = p + ip2byte(hostip) # next server
p = p + ip2byte('0.0.0.0') # relay agent ip
p = p + info['mac'] # client mac addr
 
mymac=[ord(x) for x in info['mac']]
mymacstr = ':'.join(['%02x' % x for x in mymac])
commandline='/work/bin/getbcdlocation.sh ' + addr[0] + ' ' + mymacstr
f = popen(commandline)
templateinfo = f.readline().rstrip().split(' ')
f.close
bootfile = 'pxelinux.cfg\\pxeboot.com'
bcdpath='pxelinux.cfg\\templates\\' + templateinfo[0] + '\\' + templateinfo[1] + '\\bcd'
hostname = myhostname + (NULL * (64 - len(myhostname)))
p = p + hostname # hostname
bf = bootfile + (NULL * (128 - len(bootfile)))
p = p + bf # Boot File
 
p = p + MAGIC_COOKIE
 
p = p + '\x35\x01\x05' # DHCP ACK
p = p + chr(54) + chr(4) + ip2byte(hostip) # Server ID
p = p + chr(97) + chr(len(info['guid'])) + info['guid']
p = p + chr(60) + chr(9) + 'PXEClient'
p = p + chr(252) + chr(len(bcdpath)) + bcdpath
p = p + chr(0xff)
decode_bootp('[S]', p)
#open('out', 'wb').write(p)
if s != -1: s.sendto(p, addr)
 
def decode_ntlm(p, data):
global count
pkt = data
 
if DUMPING:
filename = '/tmp/' + p[1:-1] + '.log'
open(filename, 'wb').write(AUT + pack('<I', len(data)) + data)
 
data = data[8:]
 
hexdump(data)
if DUMPING: open('/tmp/' + str(count) + '.hex', 'wb').write(data)
count =+ 1
 
t = unpack('<I', data[:4])[0]
data = data[4:]
 
if t == NTLM_NEGOTIATE:
print p, 'Packet type is NTLM_NEGOTIATE'
flags = unpack('<I', data[:4])[0]
print p, 'Flags = 0x%x' % flags
data = data[4:]
print p, 'Host', dumphdr(data, pkt)
data = data[8:]
print p, 'Domain', dumphdr(data, pkt)
elif t == NTLM_CHALLENGE:
print p, 'Packet type is NTLM_CHALLENGE'
 
print p, 'Domain', dumphdr(data, pkt)
data = data[8:]
 
flags = unpack('<I', data[:4])[0]
data = data[4:]
print p, 'Flags = 0x%x' % flags
 
challenge = data[:8]
print p, 'Challenge:', repr(challenge)
data = data[8:]
 
# NULL * 8
data = data[8:]
 
info = decodehdr(data, pkt)
data = data[8:]
 
while 1:
if len(info) < 4:
break
t = unpack('<H', info[:2])[0]
info = info[2:]
l = unpack('<H', info[:2])[0]
info = info[2:]
value = utf2ascii(info[:l])
info = info[l:]
print p, '%s : %s' % (codes[t], repr(value))
 
print p, 'u2 = %s' % repr(data[:8])
elif t == NTLM_AUTHENTICATE:
print p, 'Packet type is NTLM_AUTHENTICATE'
 
print p, 'LANMAN challenge response', repr(decodehdr(data, pkt))
data = data[8:]
 
print p, 'NT challenge response', repr(decodehdr(data, pkt))
data = data[8:]
 
print p, 'Domain to auth', decodehdr(data, pkt)
data = data[8:]
 
print p, 'Username', decodehdr(data, pkt)
data = data[8:]
 
print p, 'Workstation', decodehdr(data, pkt)
data = data[8:]
 
print p, 'SessionKey', repr(decodehdr(data, pkt))
data = data[8:]
 
flags = unpack('<I', data[:4])[0]
data = data[4:]
print p, 'Flags = 0x%x' % flags
elif t == NTLM_ANY:
print p, 'Packet type is NTLM_ANY'
 
decode_aut = decode_ntlm
 
## Only PCI Cards are supported for now
def send_ncr(s, addr, vid, pid, subsys, flavor):
global flavordevlist
devlist=flavordevlist[flavor]
#reply = open('vmware.hex', 'rb').read()
#decode_ncr('[VmWare]', reply[8:])
#s.sendto(reply, addr)
#return
 
#vid = 0x10b7
#pid = 0x9200
#subsys = 0x100010B7
 
device = 'PCI\\VEN_%04X&DEV_%04X' % (vid, pid)
device_sub = device + '&SUBSYS_%08X' % subsys
 
dev = None
try:
print 'Checking', device_sub
dev = devlist[device_sub]
dev_uni = device_sub
except:
try:
print 'Checking', device
dev = devlist[device]
dev_uni = device
except: pass
 
if dev is None:
reply = NCR + pack('<I', 0x4) + pack('<I', 0xc000000dL)
print 'Driver not found'
s.sendto(reply, addr)
return
 
print 'Found', dev_uni, 'in', dev['inf']
 
unidata = dev_uni.encode('utf-16le') + (NULL * 2) + \
dev['drv'].encode('utf-16le') + (NULL * 2) + \
dev['svc'].encode('utf-16le') + (NULL * 2)
 
drv_off = 0x24 + (len(dev_uni) + 1) * 2
svc_off = drv_off + (len(dev['drv']) + 1) * 2
p_off = svc_off + (len(dev['svc']) + 1) * 2
 
parms = 'Description\x002\x00' + dev['desc'] + '\x00' + \
'Characteristics\x001\x00' + dev['char'] + '\x00' + \
'BusType\x001\x00' + dev['btype'] + '\x00\x00'
 
plen = len(parms)
 
# Now packet creation
data = pack('<I', 0x0) # Result: ok
data = data + pack('<I', 0x2) # Type
data = data + pack('<I', 0x24) # base offset
data = data + pack('<I', drv_off) # Driver offset
data = data + pack('<I', svc_off) # Service offset
data = data + pack('<I', plen) # params len
data = data + pack('<I', p_off) # params offset
 
data = data + unidata
data = data + parms
 
decode_ncr('[S]', data)
reply = NCR + pack('<I', len(data)) + data + (NULL*2)
s.sendto(reply, addr)
 
def decode_ncr(p, data):
result = unpack('<I', data[:4])[0]
 
if result != 0x0:
if result == 0xc000000dL:
value = 'Driver not found'
else:
value = 'Unknown Error'
print p, 'NCR Failed - %s (code 0x%x)' % (value, result)
return
 
pktlen = len(data)
#pkt = data ## Not used
print p, 'Packet len = 0x%x (%d)' % (pktlen, pktlen)
print p, 'Result code: 0x%x' % result
data = data[4:] # 0x0 = OK
 
print p, 'type: 0x%x' % unpack('<I', data[:4])
data = data[4:] # 0x2 - fixed (type?)
 
b_off = unpack('<I', data[:4])[0]
print p, 'base offset = 0x%x (%d)' % (b_off, b_off)
data = data[4:] # 0x24 - fixed
 
drv_off = unpack('<I', data[:4])[0]
print p, 'drv_off = 0x%x (%d)' % (drv_off, drv_off)
#print p, '---->', pkt[drv_off-8:].replace('\x00','.')
data = data[4:] # 0x50 - offset to driver file, -8 from start of packet
 
srv_off = unpack('<I', data[:4])[0]
print p, 'srv_off: 0x%x (%d) -> %d from start' % (srv_off, srv_off, srv_off-8)
#print p, '--->', pkt[srv_off-8:]
#print p, '--->', data[srv_off-32:]
data = data[4:] # 0x6a - offset for unicode string to service name
 
plen = unpack('<I', data[:4])[0]
print p, 'plen: 0x%x (%d)' % (plen, plen)
data = data[4:] # 0xcc - size of params (wihout ending 2*NULL)
 
p_off = unpack('<I', data[:4])[0]
print p, 'p_off: 0x%x (%d) -> %d from start' % (p_off, p_off, p_off-8)
#print p, '--->', pkt[p_off-8:].replace('\x00', '.')
data = data[4:] # 0x76 - offset from start for params
 
s1 = data.find('\x00\x00')
hid = utf2ascii(data[:s1+1])
data = data[s1+3:]
print p, 'hid: %s - Len 0x%x (%d)' % (hid, len(hid), len(hid))
 
s1 = data.find('\x00\x00')
drv = utf2ascii(data[:s1+1])
data = data[s1+3:]
print p, 'drv: %s - Len 0x%x (%d)' % (drv, len(drv), len(drv))
 
s1 = data.find('\x00\x00')
srv = utf2ascii(data[:s1+1])
data = data[s1+3:]
print p, 'srv: %s - Len 0x%x (%d)' % (srv, len(srv), len(srv))
 
sets = data.split(NULL)
parms = 0
for i in range(0, len(sets), 3):
if sets[i] == '':
break
if sets[i+2] == '':
continue
name = sets[i]
try:
t = int(sets[i+1])
except:
t = 0
value = sets[i+2]
print p, '%s (%s [%d]) = %s' % (name, regtype[t], t, value)
parms = parms + 1
print p, 'Total Params:', parms
 
def send_ncq(s, vid, pid, subsys, spath):
#vid = 0x1022
#pid = 0x2000
#rev_u1 = 0x2
#rev_u2 = 0x0
#rev_u3 = 0x0
#rev = 0x10
#rev2 = 0x88
#subsys = 0x20001022
#spath = '\\\\Attila\\RemInst\\winpe'
#vid = 0x10b7
#pid = 0x9200
rev_u1 = 0x2
rev_u2 = 0x0
rev_u3 = 0x0
#rev_u4 = 0x0
rev = 0x0
rev2 = 0x0
#subsys = 0x0
#spath = '\\\\Attila\RemInst\\Setup\\Italian\\IMAGES\\WINDOWS'
 
data = pack('<I', 0x2) # u1
data = data + pack('<I', 0x0) # u2
data = data + pack('<I', 0x12345678L) # mac1/2
data = data + pack('<I', 0x9abc) # mac2/2
data = data + pack('<I', 0x0) # u3
data = data + pack('<I', 0x0) # u4
data = data + pack('<I', 0x2) # u5
data = data + pack('<H', vid)
data = data + pack('<H', pid)
data = data + chr(rev_u1) + chr(rev_u2) + chr(rev_u3)
data = data + chr(rev)
data = data + pack('<I', rev2)
data = data + pack('<I', subsys)
data = data + pack('<H', len(spath)) + spath + (NULL *2)
 
reply = NCQ + pack('<I', len(data)) + data
decode_ncq('[R]', data)
s.send(reply)
 
def decode_ncq(p, data):
#print p, 'u1: 0x%x' % unpack('<I', data[:4])
data = data[4:] # always 0x2
 
#print p, 'u2: 0x%x' % unpack('<I', data[:4])
data = data[4:] # always 0x0
 
mac = [ord(x) for x in data[:6]]
print p, 'Mac address', ':'.join(['%02x' % x for x in mac])
data = data[6:]
 
data = data[2:] # Padding
 
#print p, 'u3: 0x%x' % unpack('<I', data[:4])
data = data[4:] # always 0x0
 
#print p, 'u4: 0x%x' % unpack('<I', data[:4])
data = data[4:] # always 0x0
 
#print p, 'u5: 0x%x' % unpack('<I', data[:4])
data = data[4:] # always 0x2
 
vid = unpack('<H', data[:2])[0]
print p, 'Vid: 0x%x' % vid
data = data[2:]
pid = unpack('<H', data[:2])[0]
print p, 'Pid: 0x%x' % pid
data = data[2:]
 
print p, 'rev_u1 = 0x%x' % unpack('<B', data[0])
print p, 'rev_u2 = 0x%x' % unpack('<B', data[1])
print p, 'rev_u3 = 0x%x' % unpack('<B', data[2])
print p, 'rev = 0x%x' % unpack('<B', data[3])
data = data[4:]
 
print p, 'rev2 = 0x%x' % unpack('<I', data[:4])
data = data[4:]
 
subsys = unpack('<I', data[:4])[0]
print p, 'subsys = 0x%x' % subsys
data = data[4:]
 
l = unpack('<H', data[:2])[0]
data = data[2:]
 
data = data[:l]
print p, 'Source path:', data.replace('\x00','')
return vid, pid, subsys
 
 
def decode_req(p, data):
print p, 'Decoding REQ:'
 
print p, 'f1: 0x%x' % unpack('<I', data[:4])
data = data[4:] # 0x1
 
print p, 'f2: 0x%x' % unpack('<I', data[:4])
data = data[4:] # 0x10001
 
print p, 'f3: 0x%x' % unpack('<I', data[:4])
data = data[4:] # 0x10
 
print p, 'f4: 0x%x' % unpack('<I', data[:4])
data = data[4:] # 0x1
 
 
print p, 'u1: 0x%x' % unpack('<I', data[:4])
data = data[4:]
 
print p, 'u2: 0x%x' % unpack('<I', data[:4])
data = data[4:]
 
### end of fixed data
hexdump(data)
 
def send_req(s, addr):
reply = open('data1.req', 'rb').read()
reply = REQ + pack('<I', len(data))
s.sendto(reply, addr)
 
def decode_rsp(p, data):
print p, 'Decoding RSP:'
 
print p, 'u1: 0x%x' % unpack('<I', data[:4])
data = data[4:] # 0x1
 
print p, 'u2: 0x%x' % unpack('<I', data[:4])
data = data[4:] # 0x10001
 
print p, 'u3: 0x%x' % unpack('<I', data[:4])
data = data[4:] # 0x10
 
print p, 'u4: 0x%x' % unpack('<I', data[:4])
data = data[4:] # 0x1
 
### end of fixed data
hexdump(data)
 
def decode_off(p, data):
print p, 'Decoding OFF:'
 
print p, 'u1: 0x%x' % unpack('<I', data[:4])
data = data[4:] # 0x4
 
print p, 'u2: 0x%x' % unpack('<I', data[:4])
data = data[4:] # 0x10001
 
print p, 'u3: 0x%x' % unpack('<I', data[:4])
data = data[4:] # 0x10
 
print p, 'u4: 0x%x' % unpack('<I', data[:4])
data = data[4:] # 0x1
 
print p, 'u5: 0x%x' % unpack('<I', data[:4])
data = data[4:] # Variable
 
print p, 'u6: 0x%x' % unpack('<I', data[:4])
data = data[4:] # Variable
 
print p, 'u7: 0x%x' % unpack('<I', data[:4])
data = data[4:] # 0x3
 
def send_rsp(s, addr, data):
data = open('data1.rsp', 'rb').read()[8:]
reply = RSP
l = pack('<I', len(data))
reply = reply + l + data
print 'Sending RSP'
decode_rsp('[S]', data)
s.sendto(reply, addr)
 
def send_unr(s, addr):
reply = UNR
data = pack('<I', 0x1)
l = pack('<I', len(data))
reply = reply + l + data
print 'Sending UNR (Session Expired)'
s.sendto(reply, addr)
 
def parse_arguments(params):
### Parse RQU arguments (like a cgi)
if len(params) < 2: return {}
arglist = params.split('\n')
plist = {}
for arg in arglist:
try:
key, value = arg.split('=', 1)
except: continue
plist[key] = value
return plist
 
def daemonize(logfile):
try:
from os import fork
from posix import close
except:
print 'Daemon mode is not supported on this platform (missing fork() syscall or posix module)'
sys_exit(-1)
 
import sys
if (fork()): sys_exit(0) # parent return to shell
 
### Child
close(sys.stdin.fileno())
sys.stdin = open('/dev/null')
close(sys.stdout.fileno())
sys.stdout = Log(open(logfile, 'a+'))
close(sys.stderr.fileno())
sys.stderr = Log(open(logfile, 'a+'))
chdir('/')
 
if __name__ == '__main__':
## Defaults
global pidfile, s
daemon = False
logfile = '/var/log/binlsrv.log'
address = ''
port = 4011
devfile = 'devlist.cache'
pidfile = '/var/run/binlsrv.pid'
 
## Parse command line arguments
shortopts = 'hdl:a:p:'
longopts = [ 'help', 'daemon', 'logfile=', 'address=', 'port=' ]
 
try:
opts, args = getopt(argv[1:], shortopts, longopts)
if len(args) > 1:
raise getopt_error, 'Too many device lists files specified %s' % ','.join(args)
except getopt_error, errstr:
print 'Error:', errstr
print __usage__ % argv[0]
sys_exit(-1)
 
for opt, arg in opts:
opt = opt.split('-').pop()
 
if opt in ('h', 'help'):
print __usage__ % argv[0]
sys_exit(0)
 
if opt in ('d', 'daemon'):
daemon = True
continue
if opt in ('l', 'logfile'):
logfile = arg
continue
if opt in ('a', 'address'):
address = arg
continue
if opt in ('p', 'port'):
try:
port = int(arg)
except:
port = -1
if opt in ('pid'):
pidfile = arg
 
if (port <= 0) or (port >= 0xffff):
print 'Port not in range 1-65534'
sys_exit(-1)
 
#if len(args):
# devfile = args[0]
 
#try:
# devlist = load(open(devfile, 'rb'))
#except:
# print 'Could not load %s as cache, build it with infparser.py' % devfile
# sys_exit(-1)
thistime = datetime.now()
print thistime.strftime("%Y-%m-%d %H:%M:%S") + ' Starting binlsrv'
 
flavordevlist={}
tftpdir='/var/public/tftproot/windows5'
filelist=listdir(tftpdir)
for x in filelist:
if path.isdir(tftpdir + "/" + str(x)):
if x.rfind('_extra') != -1:
cachefile=tftpdir + "/" + str(x) + "/devlist.cache"
if path.isfile(cachefile):
flavor=x.replace("_extra","");
#thistime = datetime.now()
#print thistime.strftime("%Y-%m-%d %H:%M:%S") + ' Loading cache file for flavor %s' % flavor
devlist=load(open(cachefile))
#print thistime.strftime("%Y-%m-%d %H:%M:%S") + ' Succesfully loaded %d devices' % len(devlist)
flavordevlist[flavor]=devlist
 
if daemon: daemonize(logfile)
thistime = datetime.now()
print thistime.strftime("%Y-%m-%d %H:%M:%S") + ' Succesfully loaded %d flavors' % len(flavordevlist)
 
s = socket(AF_INET, SOCK_DGRAM)
s.bind((address, port))
 
thistime = datetime.now()
print thistime.strftime("%Y-%m-%d %H:%M:%S") + ' Binlserver started... pid %d' % getpid()
 
if daemon:
## Install signal int handlers
signal(SIGINT, shutdown)
signal(SIGTERM, shutdown)
try:
fd = open(pidfile, 'w')
fd.write('%d' % getpid() )
fd.close()
except:
print 'Cannot write pidfile', pidfile
 
while 1:
addr, t, data = get_packet(s)
if t == FILEREQ:
u1 = data[:7*4]
data = data[7*4:]
if data == '\n':
send_file(s, addr, u1, BASEPATH, WELCOME)
else:
filename, params = data.split('\n', 1)
filename = filename.lower() + '.osc'
params = parse_arguments(params)
print 'Client requested:', filename
if len(params): print 'Arguments:', repr(params)
## TODO: there are also other actions
if filename.startswith('launch'):
send_file(s, addr, u1, BASEPATH, 'warning.osc')
else:
send_file(s, addr, u1, BASEPATH, filename)
elif t == NEG:
decode_ntlm('[C]', data)
print 'NEG request, sending CHALLENGE'
send_challenge(s, addr, server_data)
sleep(1)
elif t == AUT:
print 'AUT request'
decode_ntlm('[C]', data)
send_res(s, addr, data)
sleep(1)
elif t == NCQ:
print 'NCQ Driver request'
if DUMPING: open('/tmp/ncq.hex','wb').write(data)
vid, pid, subsys = decode_ncq('[R]', data)
send_ncr(s, addr, vid, pid, subsys, flavor)
elif t == REQ:
print 'REQ request, sending Session Expired (RSP not implemented)'
decode_req('[C]', data)
if DUMPING: open('/tmp/req.hex','wb').write(REQ+pack('<I',len(data))+data)
send_unr(s, addr)
#send_rsp(s, addr, data)
elif t == MAGIC_COOKIE:
info = decode_bootp('[C]', data)
send_bootp(s, addr, info)
else:
print 'Unknown Packet: ', repr(data)
if DUMPING: open('/tmp/unknown.hex','wb').write(data)
 
Property changes:
Added: svn:executable
+ *
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/usr/bin/getbcdlocation.sh
New file
0,0 → 1,12
#!/bin/sh
 
IPADDR=$1
MACADDR=$2
 
LOGFILE=/work/log/tftpd.log
 
tail -1000 $LOGFILE | \
grep "RRQ from $IPADDR " | \
grep wdsnbp.0 | \
tail -1 | \
awk '{print $2 }' FS=\/
Property changes:
Added: svn:keywords
+ Id URL Revision Author
Added: svn:eol-style
+ native
Added: svn:executable
+ *
/trunk/se3-seven/etc/tftpd.conf
New file
0,0 → 1,71
# Convert everything to lower case
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
 
# Convert wi2ks os dirs back to upper case
rG wi2ks WI2KS
rG wi2ks_sys WI2KS_SYS
rG wi2ks_extra WI2KS_EXTRA
 
# Convert winxp os dirs back to upper case
rG winxp WINXP
rG winxp_sys WINXP_SYS
rG winxp_extra WINXP_EXTRA
 
# Convert wi2k3 os dirs back to upper case
rG wi2k3 WI2K3
rG wi2k3_sys WI2K3_SYS
rG wi2k3_extra WI2K3_EXTRA
 
# Convert backslash to slash
rg \\ /
 
# WINDOWS network drivers section
rgi /WI2K3/i386/WI2K3_SYS/(.*) /WI2K3_SYS/\1
rgi /WI2KS/i386/WI2KS_SYS/(.*) /WI2KS_SYS/\1
rgi /WINXP/i386/WINXP_SYS/(.*) /WINXP_SYS/\1
 
# WINDOWS pxelinux.0 bug
rgi pxelinux\.0ntd(.+) ntd\1
rgi pxelinux\.0(.+) \1
 
# Solaris 10 Section
rgi boot/grub/ /
 
# WINXP OS'es
rG /inst_src/windows-xp-pro-dk-sp3-32bit/WINXP_SYS/ /win_nic_drivers/
rG /inst_src/windows-xp-pro-se-sp3-32bit/WINXP_SYS/ /win_nic_drivers/
rG /inst_src/windows-xp-pro-en-sp3-32bit/WINXP_SYS/ /win_nic_drivers/
 
# WIN2K OS'es
rG /inst_src/windows-2000-pro-dk-sp4/WI2KS_SYS/ /win_nic_drivers/
rG /inst_src/windows-2000-pro-se-sp4/WI2KS_SYS/ /win_nic_drivers/
rG /inst_src/windows-2000-pro-en-sp4/WI2KS_SYS/ /win_nic_drivers/
 
#WINPE OS'es
rG /diskless/windows/ubcd4win/WINXP/i386/system32/drivers/WINXP_SYS/ /win_nic_drivers/
rG /diskless/windows/winpe/WINXP/i386/system32/drivers/WINXP_SYS/ /win_nic_drivers/
Property changes:
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/etc/init.d/binl
New file
0,0 → 1,69
#!/bin/bash
#
# binl This shell script takes care of starting and stopping
# the binl service
#
# chkconfig: - 58 74
# description: binl service for windows RIS.
 
# Source function library.
. /etc/init.d/functions
 
# Source networking configuration.
. /etc/sysconfig/network
 
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
 
devcache=/work/conf/devlist.cache
logfile=/var/log/binl.log
 
RETVAL=0
prog="binlserver"
 
start() {
# Start daemons.
echo -n $"Starting $prog: "
/work/bin/binlsrv.py -d -l $logfile $devcache
RETVAL=$?
return $RETVAL
}
 
stop() {
echo -n $"Shutting down $prog: "
pkill -f binlsrv2.py
rm -f /var/run/binlsrv.pid
RETVAL=$?
return $RETVAL
}
 
# See how we were called.
case "$1" in
start)
start
RETVAL=$?
[ $RETVAL -eq 0 ] && echo_success || echo_failure
echo
;;
stop)
stop
RETVAL=$?
[ $RETVAL -eq 0 ] && echo_success || echo_failure
echo
;;
restart|reload)
stop
[ $RETVAL -eq 0 ] && echo_success || echo_failure
echo
start
RETVAL=$?
[ $RETVAL -eq 0 ] && echo_success || echo_failure
echo
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
 
exit $RETVAL
 
Property changes:
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/etc/dhcpd.conf
New file
0,0 → 1,20
log-facility local6;
 
ddns-update-style ad-hoc;
ddns-hostname = concat("station-",binary-to-ascii(10,8,"-",leased-address));
option host-name = config-option server.ddns-hostname;
 
next-server 192.168.178.105 ;
 
if substring ( option vendor-class-identifier, 0, 9) = "PXEClient"
{
filename "pxelinux.0" ;
next-server 192.168.178.105 ;
}
 
subnet 192.168.178.0 netmask 255.255.255.0 {
option routers 192.168.178.105;
option domain-name-servers 192.168.178.105 ;
range 192.168.178.150 192.168.178.200 ;
max-lease-time 300;
}
Property changes:
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/etc/devlist.cache
___________________________________________________________________
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/._.DS_Store
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/tftproot/pxelinux.0
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/tftproot/pxelinux.cfg/default
New file
0,0 → 1,34
default menu.c32
prompt 0
noescape 1
allowoptions 0
menu title Choose the system to install
menu color tabmsg 37;40 #80ffffff #00000000
menu color hotsel 30;47 #40000000 #20ffffff
menu color sel 30;47 #40000000 #20ffffff
menu color scrollbar 30;47 #40000000 #20ffffff
menu width 80
menu margin 22
menu passwordmargin 26
menu rows 6
menu tabmsgrow 15
menu cmdlinerow 15
menu endrow 24
menu passwordrow 12
menu timeoutrow 13
menu vshift 6
menu passprompt Enter Password:
 
label LOCALBOOT
menu label ^Boot local disk
localboot 0
timeout 100
 
label system1
menu label system1
kernel system1/wdsnbp.0
 
label system2
menu label system2
kernel system2/wdsnbp.0
 
Property changes:
Added: svn:keywords
+ Id URL Revision Author
/trunk/se3-seven/tftproot/menu.c32
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
Added: svn:keywords
+ Id URL Revision Author