How can I force all files during the PXE boot process to come from the local Package Server?

Article:HOWTO5215  |  Created: 2006-09-27  |  Updated: 2007-01-26  |  Article URL http://www.symantec.com/docs/HOWTO5215
Article Type
How To



Question

I have a slow connection between my DS and computers on a remote site. The link is so slow that it takes a very long time to even run bootworks remotely. How can I use a local Package Server to load these files?

Answer

To do this you need to edit the autoexec.bat of the PXE boot option you are using and create a file structure on the Package Server:

  1. Open the PXE Configuration Utility.
  2. Go to File > Choose PXE Server and select the appropriate local PXE server.
  3. Choose the applicable boot option and click Edit.
  4. Choose Edit Boot Image.
  5. Select Autoexec.bat.
  6. Take a backup of this file by selecting all the text and copying to a text file (in some cases Ctrl + A does not appear to work; place the cursor at the start of the first line, hold down shift, and click at the end of the last line).
  7. Ensure a drive is mapped to a share on your local Package Server. In the example below, the G drive is mapped to \\PackageServer\eXpress where express is a shared folder on the Package Server. This folder should contain the following files and  folders (including all subfolders), which should be copied from the eXpress share on the DS:
    1. Bootwiz
    2. RDeploy (if you wish to manually configure image deployment jobs to use local RDeploy files as opposed to using the standard DS image jobs)
    3. BootWork.exe
  8. Make the following changes highlighted in red to the Autoexec.bat:

@echo off
REM BDC_TASK_TYPE= autopart or auto or pxe or network
set BDC_TASK_TYPE=$$Task$$
REM ramtype=full or partial or none
set ramtype=$$RamType$$
set ram=none

if %BDC_TASK_TYPE%==autopart if exist \kbdsclk.exe \kbdsclk.exe $$ScreenLock_Param$$
if %ramtype%==none goto ramdone

REM Autoexec.bat for Microsoft Client.Supports Automation Partition, Automation Boot, PXE Boot, Network Boot
REM Please do not hand edit any words or phrases surrounded with $$. These are variables and will be
REM populated by boot disk creator at the time a boot disk is created.

rem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
rem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
rem Ramdrive for booting USB and CD
rem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
rem See if ram drive has already loaded
if not exist \vdisk.sys goto ramdone
if exist \ramdone.txt goto ramdone

rem Find the ram drive

\drvdtect.exe -findRamdrive
if errorlevel 0 set ram=A
if errorlevel 1 set ram=B
if errorlevel 2 set ram=C
if errorlevel 3 set ram=D
if errorlevel 4 set ram=E
if errorlevel 5 set ram=F
if errorlevel 6 set ram=G
if errorlevel 7 set ram=H
if errorlevel 8 set ram=I
if errorlevel 9 set ram=J
if errorlevel 10 set ram=K
if errorlevel 11 set ram=L
if errorlevel 12 set ram=M
if errorlevel 13 set ram=N
if errorlevel 14 set ram=O
if errorlevel 15 set ram=P
if errorlevel 16 set ram=Q
if errorlevel 17 set ram=R
if errorlevel 18 set ram=S
if errorlevel 19 set ram=T
if errorlevel 20 set ram=U
if errorlevel 21 set ram=V
if errorlevel 22 set ram=W
if errorlevel 23 set ram=X
if errorlevel 24 set ram=Y
if errorlevel 25 set ram=Z

echo The ram drive is "%ram%"

rem Load the ram drive
goto %ramtype%

:partial
md %ram%:\net
xcopy /e \net %ram%:\net
xcopy \*.pwl %ram%:\
xcopy \bwlogin.exe %ram%:\
xcopy \aname.exe %ram%:\
xcopy \command.com %ram%:\
xcopy \*.bat %ram%:\
if NOT BDC_TASK_TYPE==network xcopy \bootwork.ini %ram%:\
xcopy \drvdtect.exe %ram%:\
goto ramdone

:full
xcopy /e \ %ram%:\

echo Ram drive has been created >%ram%:\ramdone.txt

rem Transfer to the ram drive
%ram%:
set comspec=%ram%:\command.com /p /e:1024
%ram%:\command.com /p
echo Oops, shouldn't be here
exit
:ramdone
:none
rem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
rem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

set CUR_DRV=c
\drvdtect.exe
if errorlevel 0 set CUR_DRV=A
if errorlevel 1 set CUR_DRV=B
if errorlevel 2 set CUR_DRV=C
if errorlevel 3 set CUR_DRV=D
if errorlevel 4 set CUR_DRV=E
if errorlevel 5 set CUR_DRV=F
if errorlevel 6 set CUR_DRV=G
if errorlevel 7 set CUR_DRV=H
if errorlevel 8 set CUR_DRV=I
if errorlevel 9 set CUR_DRV=J

set net=%ram%
if %ram%==none set net=%CUR_DRV%

set share=$$SHARE$$
set LocalShare=G

echo Booting drive %CUR_DRV%
set PATH=%net%:\;%net%:\dos;%net%:\net;%LocalShare%:\bootwiz\dos

REM Run the detect utility for PCI cards
%net%:
cd %net%:\net
if exist %net%:\net\PCIdtect.exe %net%:\net\PCIdtect.exe
cd \
REM Cardsrvc.bat (optional) is manually created by the user and must be placed in the
REM correct driver folder (i.e. myConfig\net\myDriver).  PCIdtect copies it to the
REM net folder (along with the appropriate protocol.ini, system.ini files).
REM The user must specify the name of the card bus services executable file inside cardsrvc.bat
REM and supply Boot Disk Creator with this executable file by adding it to the
REM ""Additional files"" folder or placing it in the ""net"" folder of the configuration.

if exist %net%:\net\cardsrvc.bat call %net%:\net\cardsrvc.bat

REM Autoexec.bat file for Bootworks and Network Boot

REM ==============================================================
REM The following lines contain 'set' environment variables that
REM are use later in the program.  You may wish to change them by
REM simply changing the values or REMing and unREMing them
REM --------------------------------------------------------------

REM ==============================================================
REM Bootwork Variables/Switches
REM --------------------------------------------------------------

REM set DEBUG=-log\bootwork.log

REM ==============================================================
REM Network and System Variables
REM --------------------------------------------------------------

set WATTCP.CFG=%net%:\net
set TEMP=%net%:\TEMP

REM ==============================================================
REM See if BootWorks should always be run from the share
REM --------------------------------------------------------------

set agentdir=%CUR_DRV%
$$RunRemoteAgent$$ if exist %LocalShare%:\bootwork.exe set agentdir=%LocalShare%

REM ==============================================================
REM If BootWorks exists in the root, you did an install instead
REM of creating a simple boot disk. This determines what type of
REM disk you created and runs bootworks appropriately
REM --------------------------------------------------------------

if exist %CUR_DRV%:\bootwork.exe goto bootwork
if exist %CUR_DRV%:\pxepatch.exe %CUR_DRV%:\pxepatch.exe

%net%:\net\net initialize
%net%:\net\netbind.com
%net%:\aname.exe
%net%:\net\tcptsr.exe
%net%:\net\tinyrfc.exe
if exist %net%:\net\connect.dat del %net%:\net\connect.dat > NUL
%net%:\bwlogin $$PwlFileTitle$$
if errorlevel 1 goto loginerror
call %net%:\mapdrv.bat
cls
%share%:
if %BDC_TASK_TYPE%==network goto network
if not exist %LocalShare%:\bootwork.exe goto mapdrverror
goto reload3
:network
$$RemRdeploy$$ rdeploy.exe $$Client$$ $$ClientConfig$$
goto end

:reload3
if exist %net%:\bwscript.bat del %net%:\bwscript.bat > NUL
%LocalShare%:\bootwork.exe %NEWCOMP%
if not exist %net%:\bwscript.bat goto end
call %net%:\bwscript.bat
goto reload3

:bootwork
REM ==============================================================
REM This call to bootworks simple configures the network with
REM information from the Windows client
REM --------------------------------------------------------------

%agentdir%:\bootwork.exe -cfg -nodiag

REM ==============================================================
REM 1.  Initialize the Network Card
REM 2.  Bind the Network Card to the network
REM 3.  Assign a unique computer name to the bootwork client
REM
REM We only load the minimal network stack/drivers in order to
REM communicate with the Altiris eXpress Server to see if there is
REM work that needs to be done from bootworks.  We are not logging
REM into the file server or establishing a drive mapping at this
REM time.
REM --------------------------------------------------------------

%net%:\net\net initialize
%net%:\net\netbind.com
%net%:\aname.exe
%net%:\net\tcptsr.exe

REM ==============================================================
REM Bootwork will check to see if there is any work to process.
REM
REM Bootwork will boot to production if there is no work to do,
REM otherwise, it will continue to load the rest of the network
REM stack and execute the job (errorlevel 150 - Login).
REM --------------------------------------------------------------

:reload1
cls
%agentdir%:\bootwork.exe -nologin %DEBUG%
if errorlevel 161 goto end
if errorlevel 160 goto reload1
if errorlevel 150 goto login
if errorlevel 100 goto boot_production
goto end

REM ==============================================================
REM Load the remainder of the network stack/drivers.
REM 1. Load the protocol stack (TCP/IP, IPX)
REM 2. Bind the network card to the protocol
REM 3. Login and start the network connection
REM 4. Establish a network drive mapping
REM
REM When this section is finished, we should be logged into the
REM File Server, having a drive mapped to the File Server.
REM Bootworks can now update it's status with the console and
REM execute the scheduled job/s.
REM --------------------------------------------------------------

:login

%net%:\net\tinyrfc.exe
if exist %net%:\net\connect.dat del %net%:\net\connect.dat > NUL
%net%:\bwlogin $$PwlFileTitle$$
if errorlevel 1 goto loginerror
call %net%:\mapdrv.bat
%LocalShare%:
:reload2

if exist %net%:\bwscript.bat del %net%:\bwscript.bat > NUL
cls

%agentdir%:\bootwork.exe %DEBUG%
if errorlevel 160 goto reload2
if errorlevel 100 goto boot_production
if not exist %net%:\bwscript.bat goto end
call %net%:\bwscript.bat
goto reload2
goto end

REM ==============================================================
REM Production Boot for errorlevel 100.
REM Unload the LAN drivers (logout) then call the dreboot program
REM to quickly boot the local operating system.
REM

REM NOTE:  Normal bootwork execution should not get to this
REM section of the batch file.
REM --------------------------------------------------------------

:boot_production
call %net%:\unmapdrv.bat
%net%:\net\net stop /yes
%CUR_DRV%:\dreboot.exe

:loginerror
echo Unable to login
if %BDC_TASK_TYPE%==network goto end
goto sleepAndRestart

:mapdrverror
echo Unable to map drive

:sleepAndRestart
%CUR_DRV%:\await.exe 5 ""
%CUR_DRV%:\dreboot.exe

:end

Note: There is one %Share% that should remain unchanged (highlighted in blue). This will leave the current directory mapped to the DS (F:\) at the end of the boot process ready to process the required jobs. It is possible to change this to point at the local Package Server also, but this will require the replication of the temp folder from the DS eXpress share to the Package Server every time a job is created/modified.


Legacy ID



27887


Article URL http://www.symantec.com/docs/HOWTO5215


Terms of use for this information are found in Legal Notices