]>
Commit | Line | Data |
---|---|---|
1 | @echo off\r | |
2 | @REM ## @file\r | |
3 | @REM #\r | |
4 | @REM # Post build script that will be automatically run after build.\r | |
5 | @REM #\r | |
6 | @REM # Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>\r | |
7 | @REM #\r | |
8 | @REM # This program and the accompanying materials\r | |
9 | @REM # are licensed and made available under the terms and conditions of the BSD License\r | |
10 | @REM # which accompanies this distribution. The full text of the license may be found at\r | |
11 | @REM # http://opensource.org/licenses/bsd-license.php\r | |
12 | @REM # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
13 | @REM # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
14 | @REM #\r | |
15 | @REM #\r | |
16 | @REM ##\r | |
17 | \r | |
18 | set BASETOOLS_DIR=%EDK_TOOLS_BIN%\r | |
19 | set BOOTSECTOR_BIN_DIR=%WORKSPACE%\DuetPkg\BootSector\bin\r | |
20 | \r | |
21 | :SetDefault\r | |
22 | set TARGET_ARCH=\r | |
23 | set TARGET=\r | |
24 | set TOOL_CHAIN_TAG=\r | |
25 | \r | |
26 | :ParseParamsLoop\r | |
27 | if "%1"=="" goto EndPParseParamsLoop\r | |
28 | if /I "%1"=="-p" goto ParseParamsLoopNext\r | |
29 | if /I "%1"=="-a" set TARGET_ARCH=%2& goto ParseParamsLoopNext\r | |
30 | if /I "%1"=="-b" set TARGET=%2& goto ParseParamsLoopNext\r | |
31 | if /I "%1"=="-t" set TOOL_CHAIN_TAG=%2& goto ParseParamsLoopNext\r | |
32 | if /I "%1"=="-h" goto Help\r | |
33 | \r | |
34 | :ParseParamsLoopNext\r | |
35 | shift\r | |
36 | shift\r | |
37 | goto ParseParamsLoop\r | |
38 | \r | |
39 | :EndPParseParamsLoop\r | |
40 | if "%TARGET_ARCH%"=="" goto Help\r | |
41 | if "%TARGET%"=="" goto Help\r | |
42 | if "%TOOL_CHAIN_TAG%"=="" goto Help\r | |
43 | \r | |
44 | set PROCESSOR=%TARGET_ARCH%\r | |
45 | set BUILD_DIR=%WORKSPACE%\Build\DuetPkg%PROCESSOR%\%TARGET%_%TOOL_CHAIN_TAG%\r | |
46 | \r | |
47 | @REM Store environment variables used by CreateBootDisk.bat\r | |
48 | echo set TARGET=%TARGET%> %WORKSPACE%\DuetPkg\SetEnv_%PROCESSOR%.bat\r | |
49 | echo set TOOL_CHAIN_TAG=%TOOL_CHAIN_TAG%>> %WORKSPACE%\DuetPkg\SetEnv_%PROCESSOR%.bat\r | |
50 | \r | |
51 | echo Compressing DUETEFIMainFv.FV ...\r | |
52 | %BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DUETEFIMAINFV.z %BUILD_DIR%\FV\DUETEFIMAINFV.Fv\r | |
53 | \r | |
54 | echo Compressing DxeMain.efi ...\r | |
55 | %BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\%PROCESSOR%\DxeCore.efi\r | |
56 | \r | |
57 | echo Compressing DxeIpl.efi ...\r | |
58 | %BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\%PROCESSOR%\DxeIpl.efi\r | |
59 | \r | |
60 | echo Generate Loader Image ...\r | |
61 | if "%PROCESSOR%"=="IA32" goto GENERATE_IMAGE_IA32\r | |
62 | if "%PROCESSOR%"=="X64" goto GENERATE_IMAGE_X64\r | |
63 | \r | |
64 | :GENERATE_IMAGE_IA32\r | |
65 | %BASETOOLS_DIR%\EfiLdrImage.exe -o %BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\%PROCESSOR%\EfiLoader.efi %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\FV\DUETEFIMAINFV.z\r | |
66 | copy /b %BOOTSECTOR_BIN_DIR%\Start.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr\r | |
67 | copy /b %BOOTSECTOR_BIN_DIR%\Start16.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr16\r | |
68 | copy /b %BOOTSECTOR_BIN_DIR%\Start32.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr20\r | |
69 | goto end\r | |
70 | \r | |
71 | :GENERATE_IMAGE_X64\r | |
72 | %BASETOOLS_DIR%\EfiLdrImage.exe -o %BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\%PROCESSOR%\EfiLoader.efi %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\FV\DUETEFIMAINFV.z\r | |
73 | copy /b %BOOTSECTOR_BIN_DIR%\Start64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\EfildrPure\r | |
74 | %BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\EfildrPure -o %BUILD_DIR%\FV\Efildr\r | |
75 | copy /b %BOOTSECTOR_BIN_DIR%\St16_64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr16Pure\r | |
76 | %BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr16Pure -o %BUILD_DIR%\FV\Efildr16\r | |
77 | copy /b %BOOTSECTOR_BIN_DIR%\St32_64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr20Pure\r | |
78 | %BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr20Pure -o %BUILD_DIR%\FV\Efildr20\r | |
79 | goto end\r | |
80 | \r | |
81 | :Help\r | |
82 | echo Usage: This script will be run automatically after build.\r | |
83 | :end\r |