5 # Post build script that will be automatically run after build.
7 # Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
9 # This program and the accompanying materials
10 # are licensed and made available under the terms and conditions of the BSD License
11 # which accompanies this distribution. The full text of the license may be found at
12 # http://opensource.org/licenses/bsd-license.php
13 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 if [ -z "$EDK_TOOLS_PATH" ]
20 export BASETOOLS_DIR
=$WORKSPACE/Conf
/BaseToolsSource
/Source
/C
/bin
22 export BASETOOLS_DIR
=$EDK_TOOLS_PATH/Source
/C
/bin
25 export BOOTSECTOR_BIN_DIR
=$WORKSPACE/DuetPkg
/BootSector
/bin
29 while [ $# -gt 0 ]; do
30 if [ "$1" = "-a" ]; then
32 elif [ "$1" = "-t" ]; then
34 elif [ "$1" = "-h" ]; then
35 echo Usage
: This
script will be run automatically after build.
42 if [ "$PROCESSOR" = "" -o "$TOOLTAG" = "" ]; then
43 echo Usage
: This
script will be run automatically after build.
47 export BUILD_DIR
=$WORKSPACE/Build
/DuetPkg
$PROCESSOR/DEBUG_
$TOOLTAG
50 # Store environment variables used by CreateBootDisk.sh
52 echo export TOOLCHAIN
=$TOOLTAG> $WORKSPACE/DuetPkg
/SetEnv_
$PROCESSOR.sh
53 chmod +x
$WORKSPACE/DuetPkg
/SetEnv_
$PROCESSOR.sh
56 # Boot sector module could only be built under IA32 tool chain
59 echo Compressing DUETEFIMainFv.FV ...
60 $BASETOOLS_DIR/LzmaCompress
-e -o $BUILD_DIR/FV
/DUETEFIMAINFV.z
$BUILD_DIR/FV
/DUETEFIMAINFV.Fv
62 echo Compressing DxeMain.efi ...
63 $BASETOOLS_DIR/LzmaCompress
-e -o $BUILD_DIR/FV
/DxeMain.z
$BUILD_DIR/$PROCESSOR/DxeCore.efi
65 echo Compressing DxeIpl.efi ...
66 $BASETOOLS_DIR/LzmaCompress
-e -o $BUILD_DIR/FV
/DxeIpl.z
$BUILD_DIR/$PROCESSOR/DxeIpl.efi
68 echo Generate Loader Image ...
70 if [ $PROCESSOR = IA32
]
72 $BASETOOLS_DIR/GenFw
--rebase 0x10000 -o $BUILD_DIR/$PROCESSOR/EfiLoader.efi
$BUILD_DIR/$PROCESSOR/EfiLoader.efi
73 $BASETOOLS_DIR/EfiLdrImage
-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
74 cat $BOOTSECTOR_BIN_DIR/Start.com
$BOOTSECTOR_BIN_DIR/efi32.com2
$BUILD_DIR/FV
/Efildr32
> $BUILD_DIR/FV
/Efildr
76 # It is safe to use "bcat" to cat following binary file, if bcat command is avaiable for your system
78 #bcat -o $BUILD_DIR/FV/Efildr.bcat $BOOTSECTOR_BIN_DIR/start.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32
79 cat $BOOTSECTOR_BIN_DIR/Start16.com
$BOOTSECTOR_BIN_DIR/efi32.com2
$BUILD_DIR/FV
/Efildr32
> $BUILD_DIR/FV
/Efildr16
80 #bcat -o $BUILD_DIR/FV/Efildr16.bcat $BOOTSECTOR_BIN_DIR/start16.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32
81 cat $BOOTSECTOR_BIN_DIR/Start32.com
$BOOTSECTOR_BIN_DIR/efi32.com2
$BUILD_DIR/FV
/Efildr32
> $BUILD_DIR/FV
/Efildr20
82 #bcat -o $BUILD_DIR/FV/Efildr20.bcat $BOOTSECTOR_BIN_DIR/start32.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32
86 if [ $PROCESSOR = X64
]
88 $BASETOOLS_DIR/GenFw
--rebase 0x10000 -o $BUILD_DIR/$PROCESSOR/EfiLoader.efi
$BUILD_DIR/$PROCESSOR/EfiLoader.efi
89 $BASETOOLS_DIR/EfiLdrImage
-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
90 cat $BOOTSECTOR_BIN_DIR/Start64.com
$BOOTSECTOR_BIN_DIR/efi64.com2
$BUILD_DIR/FV
/Efildr64
> $BUILD_DIR/FV
/EfildrPure
91 #bcat -o $BUILD_DIR/FV/EfildrPure $BOOTSECTOR_BIN_DIR/start64.com $BOOTSECTOR_BIN_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64
92 $BASETOOLS_DIR/GenPage
$BUILD_DIR/FV
/EfildrPure
-o $BUILD_DIR/FV
/Efildr
93 cat $BOOTSECTOR_BIN_DIR/St16_64.com
$BOOTSECTOR_BIN_DIR/efi64.com2
$BUILD_DIR/FV
/Efildr64
> $BUILD_DIR/FV
/Efildr16Pure
94 #bcat -o $BUILD_DIR/FV/Efildr16Pure $BOOTSECTOR_BIN_DIR/st16_64.com $BOOTSECTOR_BIN_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64
95 $BASETOOLS_DIR/GenPage
$BUILD_DIR/FV
/Efildr16Pure
-o $BUILD_DIR/FV
/Efildr16
96 cat $BOOTSECTOR_BIN_DIR/St32_64.com
$BOOTSECTOR_BIN_DIR/efi64.com2
$BUILD_DIR/FV
/Efildr64
> $BUILD_DIR/FV
/Efildr20Pure
97 #bcat -o $BUILD_DIR/FV/Efildr20Pure $BOOTSECTOR_BIN_DIR/st32_64.com $BOOTSECTOR_BIN_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64
98 $BASETOOLS_DIR/GenPage
$BUILD_DIR/FV
/Efildr20Pure
-o $BUILD_DIR/FV
/Efildr20