X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=DuetPkg%2FPostBuild.sh;h=c77c0f345542fc52b25ee04f92f158fc7756d303;hp=5218b3bb232436a66f4d6a4e44346ad09ceb8cd3;hb=30a3e833ea8543f9b9d6957852c02d970b81cfec;hpb=e7b2c17aad3953d1c314c1e82cb5c6cad97885cd diff --git a/DuetPkg/PostBuild.sh b/DuetPkg/PostBuild.sh old mode 100644 new mode 100755 index 5218b3bb23..c77c0f3455 --- a/DuetPkg/PostBuild.sh +++ b/DuetPkg/PostBuild.sh @@ -1,13 +1,29 @@ #!/bin/sh +## @file # # Currently, Build system does not provide post build mechanism for module # and platform building, so just use a sh file to do post build commands. # Originally, following post building command is for EfiLoader module. # +# Copyright (c) 2010, Intel Corporation. All rights reserved.
+# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +## -export BUILD_DIR=$WORKSPACE/Build/DuetPkg/DEBUG_UNIXGCC +if [ -z "$EDK_TOOLS_PATH" ] +then +export BASETOOLS_DIR=$WORKSPACE/Conf/BaseToolsSource/Source/C/bin +else export BASETOOLS_DIR=$EDK_TOOLS_PATH/Source/C/bin +fi + export BOOTSECTOR_BIN_DIR=$WORKSPACE/DuetPkg/BootSector/bin export PROCESSOR="" if [ \ @@ -18,7 +34,7 @@ if [ \ ] then echo Error! Please specific the architecture. - echo Usage: "./PostBuild.sh [IA32|X64]" + echo Usage: "./PostBuild.sh [IA32|X64] [UNIXGCC|GCC44]" fi case "$1" in @@ -33,6 +49,21 @@ case "$1" in return 1 esac +case "$2" in + UNIXGCC) + export TOOLTAG=UNIXGCC + ;; + GCC44) + export TOOLTAG=GCC44 + ;; + *) + echo Invalid tool tag, should be only UNIXGCC or GCC44 + return 1 +esac + +export BUILD_DIR=$WORKSPACE/Build/DuetPkg$PROCESSOR/DEBUG_$TOOLTAG + + # # Boot sector module could only be built under IA32 tool chain # @@ -50,24 +81,26 @@ echo Generate Loader Image ... if [ $PROCESSOR = IA32 ] then + $BASETOOLS_DIR/GenFw --rebase 0x10000 -o $BUILD_DIR/$PROCESSOR/EfiLoader.efi $BUILD_DIR/$PROCESSOR/EfiLoader.efi $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 cat $BOOTSECTOR_BIN_DIR/Start.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 > $BUILD_DIR/FV/Efildr # # It is safe to use "bcat" to cat following binary file, if bcat command is avaiable for your system # - #bcat -o $BUILD_DIR/FV/Efildr.bcat $BOOTSECTOR_BIN_DIR/Start.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 + #bcat -o $BUILD_DIR/FV/Efildr.bcat $BOOTSECTOR_BIN_DIR/start.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 cat $BOOTSECTOR_BIN_DIR/Start16.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 > $BUILD_DIR/FV/Efildr16 - #bcat -o $BUILD_DIR/FV/Efildr16.bcat $BOOTSECTOR_BIN_DIR/Start16.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 + #bcat -o $BUILD_DIR/FV/Efildr16.bcat $BOOTSECTOR_BIN_DIR/start16.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 cat $BOOTSECTOR_BIN_DIR/Start32.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 > $BUILD_DIR/FV/Efildr20 - #bcat -o $BUILD_DIR/FV/Efildr20.bcat $BOOTSECTOR_BIN_DIR/Start32.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 + #bcat -o $BUILD_DIR/FV/Efildr20.bcat $BOOTSECTOR_BIN_DIR/start32.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 echo Done! fi if [ $PROCESSOR = X64 ] then + $BASETOOLS_DIR/GenFw --rebase 0x10000 -o $BUILD_DIR/$PROCESSOR/EfiLoader.efi $BUILD_DIR/$PROCESSOR/EfiLoader.efi $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 cat $BOOTSECTOR_BIN_DIR/Start64.com $BOOTSECTOR_BIN_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64 > $BUILD_DIR/FV/EfildrPure - #bcat -o $BUILD_DIR/FV/EfildrPure $BOOTSECTOR_BIN_DIR/Start64.com $BOOTSECTOR_BIN_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64 + #bcat -o $BUILD_DIR/FV/EfildrPure $BOOTSECTOR_BIN_DIR/start64.com $BOOTSECTOR_BIN_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64 $BASETOOLS_DIR/GenPage $BUILD_DIR/FV/EfildrPure -o $BUILD_DIR/FV/Efildr cat $BOOTSECTOR_BIN_DIR/St16_64.com $BOOTSECTOR_BIN_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64 > $BUILD_DIR/FV/Efildr16Pure #bcat -o $BUILD_DIR/FV/Efildr16Pure $BOOTSECTOR_BIN_DIR/st16_64.com $BOOTSECTOR_BIN_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64