Source code of Windows XP (NT5)
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.

222 lines
5.1 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM makebfloppy.cmd
  5. REM
  6. REM
  7. REM Copyright (c) Microsoft Corporation. All rights reserved.
  8. REM
  9. REM ------------------------------------------------------------------
  10. if defined _CPCMAGIC goto CPCBegin
  11. perl -x "%~f0" %*
  12. goto :EOF
  13. #!perl
  14. use strict;
  15. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  16. use lib $ENV{RAZZLETOOLPATH};
  17. use PbuildEnv;
  18. use ParseArgs;
  19. use Logmsg;
  20. sub Usage { print<<USAGE; exit(1) }
  21. makebfloppy.cmd
  22. USAGE
  23. sub Dependencies {
  24. if ( !open DEPEND, ">>$ENV{_NTPOSTBLD}\\..\\build_logs\\dependencies.txt" ) {
  25. errmsg("Unable to open dependency list file.");
  26. die;
  27. }
  28. print DEPEND<<DEPENDENCIES;
  29. \[$0\]
  30. IF {...} ADD {
  31. idw\\setup\\no_tbomb.hiv
  32. bfcab.inf
  33. bflics.txt
  34. makeboot\\makeboot.exe
  35. makeboot\\makebt32.exe
  36. }
  37. IF { txtsetup.sif }
  38. ADD { realsign\\txtsetup.sif }
  39. DEPENDENCIES
  40. close DEPEND;
  41. exit;
  42. }
  43. my $qfe;
  44. parseargs('?' => \&Usage,
  45. 'plan' => \&Dependencies,
  46. 'qfe:' => \$qfe);
  47. if ( -f "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  48. if ( !open SKIP, "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  49. errmsg("Unable to open skip list file.");
  50. die;
  51. }
  52. while (<SKIP>) {
  53. chomp;
  54. exit if lc$_ eq lc$0;
  55. }
  56. close SKIP;
  57. }
  58. # *** NEXT FEW LINES ARE TEMPLATE ***
  59. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  60. __END__
  61. :CPCBegin
  62. set _CPCMAGIC=
  63. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  64. REM
  65. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  66. REM
  67. @echo off
  68. REM
  69. REM Set local variable's state
  70. REM
  71. set BFBUILDERROR=0
  72. set OldCurrentDirectory=%cd%
  73. REM
  74. REM We only create boot floppy images on fre compressed i386 builds.
  75. REM
  76. if /i "%_BuildType%" == "chk" (
  77. goto :bfloppy_done
  78. )
  79. if /i "%BUILD_CHECKED_KERNEL%" == "1" (
  80. goto :bfloppy_done
  81. )
  82. if not defined 386 (
  83. goto :bfloppy_done
  84. )
  85. set Share=i386
  86. if NOT defined Comp (
  87. set Comp=No
  88. if /i %NUMBER_OF_PROCESSORS% GEQ 4 (
  89. set Comp=Yes
  90. )
  91. if defined OFFICIAL_BUILD_MACHINE (
  92. set Comp=Yes
  93. )
  94. )
  95. if /i not "%Comp%" EQU "Yes" GOTO :bfloppy_done
  96. echo.
  97. echo ---------------------------------------
  98. echo Beginning Boot Floppy image generation
  99. echo ---------------------------------------
  100. echo.
  101. call logmsg.cmd /t "Beginning Boot Floppy image generation"
  102. REM
  103. REM Product List Fields:
  104. REM Display Name,CD Root,Sku,'Ordered links','CD Product membership',CD Tag letter
  105. REM
  106. REM
  107. REM Product List Fields:
  108. REM Display Name,CD Root,Sku,'Ordered links','CD Product membership',CD Tag letter
  109. REM
  110. set NumProds=0
  111. set Products=;
  112. REM Personal
  113. perl %RazzleToolPath%\cksku.pm -t:per -l:%lang% -a:%_BuildArch%
  114. if not errorlevel 1 (
  115. set /a NumProds=!NumProds! + 1
  116. set Products=!Products!;Personal,%_NTPOSTBLD%,per,'perinf','a p wp',c,no
  117. )
  118. REM Professional
  119. perl %RazzleToolPath%\cksku.pm -t:pro -l:%lang% -a:%_BuildArch%
  120. if not errorlevel 1 (
  121. set /a NumProds=!NumProds! + 1
  122. set Products=!Products!;Professional,%_NTPOSTBLD%,pro,'','a w wp xp',p,no
  123. )
  124. REM
  125. REM Create Images.
  126. REM
  127. REM Loop through products
  128. for /l %%a in ( 1,1,%NumProds% ) do (
  129. CALL :GetProductData %%a
  130. cd /d %_NTPostBld%\!OrderedLinks!
  131. mkdir bootfloppy
  132. cd bootfloppy
  133. echo !CDRoot!\!Sku!\!Share!
  134. perl %RazzleToolPath%\postbuildscripts\makeimg.pl !CDRoot!\slp\!Sku!\!Share!
  135. if errorlevel 1 (
  136. call errmsg.cmd "Could not cab boot floppy images."
  137. set BFBUILDERROR=1
  138. )else (
  139. REM
  140. REM Munge the path so we use the correct wextract.exe to build the package with...
  141. REM NOTE: We *want* to use the one we just built (and for Intl localized)!
  142. REM
  143. set _NEW_PATH_TO_PREPEND=!RazzleToolPath!\!PROCESSOR_ARCHITECTURE!\loc\!LANG!
  144. set _OLD_PATH_BEFORE_PREPENDING=!PATH!
  145. set PATH=!_NEW_PATH_TO_PREPEND!;!PATH!
  146. call ExecuteCmd.cmd "start /min /wait iexpress.exe /M /N /Q ..\bfcab.inf"
  147. REM
  148. REM Return the path to what it was before...
  149. REM
  150. set PATH=!_OLD_PATH_BEFORE_PREPENDING!
  151. )
  152. )
  153. goto :bfloppy_done
  154. REM Function: GetProductData
  155. REM
  156. REM accesses the global %Products% variable and
  157. REM sets global values that reflect entry %1
  158. REM in that list (1,2,3,...)
  159. REM
  160. REM Note: have to use a function like this in
  161. REM order to access a random number of
  162. REM entries, even though this is really
  163. REM bad about using and setting globals
  164. REM that are used elsewhere
  165. :GetProductData
  166. set EntryNum=%1
  167. for /f "tokens=%EntryNum% delims=;" %%z in ("%Products%") do (
  168. for /f "tokens=1-7 delims=," %%a in ("%%z") do (
  169. set DisplayName=%%a
  170. set CDRoot=%%b
  171. set Sku=%%c
  172. set OrderedLinks=%%d
  173. set CDProductGroups=%%e
  174. set CDTagLetter=%%f
  175. REM Replace single-quote in list variables with double-quotes
  176. REM so they can be passed into subroutines as a single parameter
  177. set OrderedLinks=!OrderedLinks:'="!
  178. set CDProductGroups=!CDProductGroups:'="!
  179. ))
  180. :bfloppy_done
  181. call logmsg.cmd /t "Done with boot floppy image generation"
  182. echo.
  183. echo ---------------------------------------
  184. echo Done with boot floppy generation
  185. echo ---------------------------------------
  186. echo.
  187. seterror.exe "%BFBUILDERROR%"