X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=DuetPkg%2FPostBuild.sh;h=f032de3a9de4f092a2daaf7d2d01bbba802206c3;hb=05bf4747dd8e412d10fccbe35346aa2597b4167b;hp=1523738ea492c0b66516eb33176c1bcfd854b93d;hpb=e4c0074b680ed8b6ced593ae3605fca0cd1fdd22;p=mirror_edk2.git diff --git a/DuetPkg/PostBuild.sh b/DuetPkg/PostBuild.sh index 1523738ea4..f032de3a9d 100755 --- a/DuetPkg/PostBuild.sh +++ b/DuetPkg/PostBuild.sh @@ -1,26 +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 + +## @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 - 2016, 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. +# +## + +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 [ \ @@ -31,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 @@ -46,6 +49,21 @@ case "$1" in return 1 esac +case "$2" in + UNIXGCC) + export TOOLTAG=UNIXGCC + ;; + GCC4*) + export TOOLTAG=$2 + ;; + *) + echo Invalid tool tag, should be only UNIXGCC or GCC4\* + return 1 +esac + +export BUILD_DIR=$WORKSPACE/Build/DuetPkg$PROCESSOR/DEBUG_$TOOLTAG + + # # Boot sector module could only be built under IA32 tool chain # @@ -63,21 +81,23 @@ 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 + 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 - cat $BOOTSECTOR_BIN_DIR/start16.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 > $BUILD_DIR/FV/Efildr16 + 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 - cat $BOOTSECTOR_BIN_DIR/start32.com $BOOTSECTOR_BIN_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 > $BUILD_DIR/FV/Efildr20 + 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 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