Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

153 lines
5.2 KiB

  1. @REM -----------------------------------------------------------------
  2. @REM
  3. @REM makeProCD2.cmd - surajp
  4. @REM Creates cd images for the second PRO CD which will contain TabletPc and Ehome
  5. @REM
  6. @REM Copyright (c) Microsoft Corporation. All rights reserved.
  7. @REM
  8. @REM -----------------------------------------------------------------
  9. @if defined _CPCMAGIC goto CPCBegin
  10. @perl -x "%~f0" %*
  11. @goto :EOF
  12. #!perl
  13. use strict;
  14. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  15. use lib $ENV{RAZZLETOOLPATH};
  16. use PbuildEnv;
  17. use ParseArgs;
  18. sub Usage { print<<USAGE; exit(1) }
  19. makeProCD2 [-d <release] [-c <comp|uncomp>] [-l lang]
  20. -d Release Running on Archive server, compute CD image and make it
  21. but do not perform compression.
  22. -c Comp Force compression regardless of number of procs.
  23. -c Uncomp Force no compression regardless of number of procs.
  24. -l lang
  25. Creates Second CD for PRO containg TabletPC and Ehome specific files
  26. USAGE
  27. parseargs('?' => \&Usage,
  28. 'd:'=> \$ENV{CLDATA},
  29. 'c:'=> \$ENV{CLCOMP});
  30. # *** TEMPLATE CODE ***
  31. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  32. __END__
  33. @:CPCBegin
  34. @set _CPCMAGIC=
  35. @setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  36. @if not defined DEBUG echo off
  37. @REM *** CMD SCRIPT BELOW ***
  38. set Share=i386
  39. set CompDr=%_NTPostBld%\comp
  40. set Release=No
  41. if /i "%cldata%" EQU "release" (set Release=Yes)
  42. if /i "%clcomp%" EQU "comp" (set Comp=Yes)
  43. if /i "%clcomp%" EQU "uncomp" (set Comp=No)
  44. REM Make uncomp default for now except on 4 proc machines
  45. if NOT defined Comp (
  46. set Comp=No
  47. if /i %NUMBER_OF_PROCESSORS% GEQ 4 (
  48. set Comp=Yes
  49. )
  50. if defined OFFICIAL_BUILD_MACHINE (
  51. set Comp=Yes
  52. )
  53. )
  54. set UseCompressedLinks=yes
  55. if /i "%Release%" EQU "no" if /i "%Comp%" EQU "no" set UseCompressedLinks=no
  56. REM Exclude skus even they are defined in prodskus.txt
  57. REM
  58. set CmdIni=perl %RazzleToolPath%\PostBuildScripts\CmdIniSetting.pl
  59. set CommandLine=%CmdIni% -l:%lang% -f:ExcludeSkus::%_BuildArch%%_BuildType%
  60. %CommandLine% >nul 2>nul
  61. if ERRORLEVEL 0 (
  62. for /f "tokens=1 delims=" %%a in ('%CommandLine%') do (
  63. set ExcludeSkus=%%a
  64. )
  65. )
  66. call logmsg "Exclude skus are [%ExcludeSkus%]"
  67. for %%a in ( %ExcludeSkus% ) do (
  68. if /i "%%a" == "pro" set ExcludePro=1
  69. )
  70. if not defined ExcludePro (
  71. if /i "%_BuildArch%" == "x86" (
  72. perl %RazzleToolPath%\cksku.pm -t:pro -l:%lang% -a:%_BuildArch%
  73. if not errorlevel 1 (
  74. CALL :LinkTabletPC pro cmpnents tabletpc %share% PROCD1 PROCD2
  75. )
  76. )
  77. )
  78. REM Done
  79. if defined errors seterror.exe "%errors%"& goto :EOF
  80. GOTO :EOF
  81. REM Function: LinkTabletPC
  82. REM
  83. REM Links all the Tablet PC specific files to PRO\cmpnents\taletpc\i386 directory
  84. REM Links all the files under pro except for the tabletpc dir to %NTPOSTBLD%\PROCD1
  85. REM Links all the tabletpc files under PRO\cmpnents to %NTPOSTBLD%\PROCD1
  86. REM PROCD1 and PROCD2 will be burnlab for burning PRO CDs.
  87. :LinkTabletPC
  88. setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
  89. set SKUNAME=%1& shift
  90. set DIRNAME1=%1& shift
  91. set DIRNAME2=%1& shift
  92. set SHARE=%1& shift
  93. set CD1=%1& shift
  94. set CD2=%1& shift
  95. REM Linking the TabletPC Files to the PRO directory
  96. if not exist %_NTPostBld%\%SKUNAME%\%DIRNAME1%\%DIRNAME2%\%share% (
  97. mkdir %_NTPostBld%\%SKUNAME%\%DIRNAME1%\%DIRNAME2%\%share%
  98. )
  99. if "%UseCompressedLinks%" == "yes" (
  100. if exist %tmp%\TabletPcComp.lst (
  101. echo Running compdir /kerlntsd /m:%tmp%\TabletPcComp.lst %CompDr% %_NTPostBld%\%SKUNAME%\%DIRNAME1%\%DIRNAME2%\%share%
  102. call ExecuteCmd.cmd "compdir /kerlntsd /m:%tmp%\TabletPcComp.lst %CompDr% %_NTPostBld%\%SKUNAME%\%DIRNAME1%\%DIRNAME2%\%share%" >nul
  103. )
  104. if exist %tmp%\TabletPcUnComp.lst (
  105. echo Running compdir /kerlntsd /m:%tmp%\TabletPcUnComp.lst %_NTPostBld% %_NTPostBld%\%SKUNAME%\%DIRNAME1%\%DIRNAME2%\%share%
  106. call ExecuteCmd.cmd "compdir /kerlntsd /m:%tmp%\TabletPcUnComp.lst %_NTPostBld% %_NTPostBld%\%SKUNAME%\%DIRNAME1%\%DIRNAME2%\%share%" >nul
  107. )
  108. ) else (
  109. if exist %tmp%\TabletPc.lst (
  110. echo Running compdir /kerlntsd /m:%tmp%\TabletPc.lst %_NTPostBld% %_NTPostBld%\%SKUNAME%\%DIRNAME1%\%DIRNAME2%\%share%
  111. call ExecuteCmd.cmd "compdir /kerlntsd /m:%tmp%\TabletPc.lst %_NTPostBld% %_NTPostBld%\%SKUNAME%\%DIRNAME1%\%DIRNAME2%\%share%"
  112. )
  113. )
  114. echo running compdir /kelntsd %_NTPostBld%\%SKUNAME%\cmpnents %_NTPostBld%\%CD2%\cmpnents
  115. call Executecmd.cmd "compdir /kelntsd %_NTPostBld%\%SKUNAME%\cmpnents %_NTPostBld%\%CD2%\cmpnents"
  116. dir /a-d /b %_NTPostBld%\%SKUNAME% >%TMP%\flatFileList.lst
  117. dir /ad /b %_NTPostBld%\%SKUNAME% |findstr /v cmpnents >%TMP%\dirlist.lst
  118. echo compdir /kerlntsd /m:%TMP%\flatFileList.lst %_NTPostBld%\%SKUNAME% %_NTPostBld%\%CD1%
  119. call Executecmd.cmd "compdir /kerlntsd /m:%TMP%\flatFileList.lst %_NTPostBld%\%SKUNAME% %_NTPostBld%\%CD1%"
  120. for /F %%a in (%TMP%\dirlist.lst) do (
  121. if not exist %_NTPostBld%\%CD1%\%%a md %_NTPostBld%\%CD1%\%%a
  122. echo Running compdir /kelntsd %_NTPostBld%\%SKUNAME%\%%a %_NTPostBld%\%CD1%\%%a
  123. call Executecmd.cmd "compdir /kelntsd %_NTPostBld%\%SKUNAME%\%%a %_NTPostBld%\%CD1%\%%a"
  124. )
  125. del %TMP%\flatFileList.lst
  126. del %TMP%\DirList.lst
  127. )
  128. GOTO :EOF