Add RHSA (remapping hardware static Affinity) structure definition according to VT...
[edk2.git] / DuetPkg / PostBuild.sh
blob5218b3bb232436a66f4d6a4e44346ad09ceb8cd3
1 #!/bin/sh
4 # Currently, Build system does not provide post build mechanism for module
5 # and platform building, so just use a sh file to do post build commands.
6 # Originally, following post building command is for EfiLoader module.
9 export BUILD_DIR=$WORKSPACE/Build/DuetPkg/DEBUG_UNIXGCC
10 export BASETOOLS_DIR=$EDK_TOOLS_PATH/Source/C/bin
11 export BOOTSECTOR_BIN_DIR=$WORKSPACE/DuetPkg/BootSector/bin
12 export PROCESSOR=""
13 if [ \
14 -z "$1" -o \
15 "$1" = "-?" -o \
16 "$1" = "-h" -o \
17 "$1" = "--help" \
19 then
20 echo Error! Please specific the architecture.
21 echo Usage: "./PostBuild.sh [IA32|X64]"
24 case "$1" in
25 IA32)
26 export PROCESSOR=IA32
28 X64)
29 export PROCESSOR=X64
32 echo Invalid Architecture string, should be only IA32 or X64
33 return 1
34 esac
37 # Boot sector module could only be built under IA32 tool chain
40 echo Compressing DUETEFIMainFv.FV ...
41 $BASETOOLS_DIR/LzmaCompress -e -o $BUILD_DIR/FV/DUETEFIMAINFV.z $BUILD_DIR/FV/DUETEFIMAINFV.Fv
43 echo Compressing DxeMain.efi ...
44 $BASETOOLS_DIR/LzmaCompress -e -o $BUILD_DIR/FV/DxeMain.z $BUILD_DIR/$PROCESSOR/DxeCore.efi
46 echo Compressing DxeIpl.efi ...
47 $BASETOOLS_DIR/LzmaCompress -e -o $BUILD_DIR/FV/DxeIpl.z $BUILD_DIR/$PROCESSOR/DxeIpl.efi
49 echo Generate Loader Image ...
51 if [ $PROCESSOR = IA32 ]
52 then
53 $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
54 cat $BOOTSECTOR_BIN_DIR/Start.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 > $BUILD_DIR/FV/Efildr
56 # It is safe to use "bcat" to cat following binary file, if bcat command is avaiable for your system
58 #bcat -o $BUILD_DIR/FV/Efildr.bcat $BOOTSECTOR_BIN_DIR/Start.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32
59 cat $BOOTSECTOR_BIN_DIR/Start16.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 > $BUILD_DIR/FV/Efildr16
60 #bcat -o $BUILD_DIR/FV/Efildr16.bcat $BOOTSECTOR_BIN_DIR/Start16.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32
61 cat $BOOTSECTOR_BIN_DIR/Start32.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 > $BUILD_DIR/FV/Efildr20
62 #bcat -o $BUILD_DIR/FV/Efildr20.bcat $BOOTSECTOR_BIN_DIR/Start32.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32
63 echo Done!
66 if [ $PROCESSOR = X64 ]
67 then
68 $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
69 cat $BOOTSECTOR_BIN_DIR/Start64.com $BOOTSECTOR_BIN_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64 > $BUILD_DIR/FV/EfildrPure
70 #bcat -o $BUILD_DIR/FV/EfildrPure $BOOTSECTOR_BIN_DIR/Start64.com $BOOTSECTOR_BIN_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64
71 $BASETOOLS_DIR/GenPage $BUILD_DIR/FV/EfildrPure -o $BUILD_DIR/FV/Efildr
72 cat $BOOTSECTOR_BIN_DIR/St16_64.com $BOOTSECTOR_BIN_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64 > $BUILD_DIR/FV/Efildr16Pure
73 #bcat -o $BUILD_DIR/FV/Efildr16Pure $BOOTSECTOR_BIN_DIR/st16_64.com $BOOTSECTOR_BIN_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64
74 $BASETOOLS_DIR/GenPage $BUILD_DIR/FV/Efildr16Pure -o $BUILD_DIR/FV/Efildr16
75 cat $BOOTSECTOR_BIN_DIR/St32_64.com $BOOTSECTOR_BIN_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64 > $BUILD_DIR/FV/Efildr20Pure
76 #bcat -o $BUILD_DIR/FV/Efildr20Pure $BOOTSECTOR_BIN_DIR/st32_64.com $BOOTSECTOR_BIN_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64
77 $BASETOOLS_DIR/GenPage $BUILD_DIR/FV/Efildr20Pure -o $BUILD_DIR/FV/Efildr20
79 echo Done!