X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=DuetPkg%2FPostBuild.sh;h=4912fcf5825ab05b751ab1084158ee28951ab6a7;hb=f8b30ae529b451e6bda94d30ed68f8492c309d8c;hp=e6e8793961c5f76d6c1ba1fad25a8644e526201c;hpb=3ef254bb509b9c8151fde88a77d39ee6fefdf407;p=mirror_edk2.git diff --git a/DuetPkg/PostBuild.sh b/DuetPkg/PostBuild.sh index e6e8793961..4912fcf582 100644 --- a/DuetPkg/PostBuild.sh +++ b/DuetPkg/PostBuild.sh @@ -1,8 +1,11 @@ -# -# 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. +#!/bin/sh + +# +# 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. # + export BUILD_DIR=$WORKSPACE/Build/DuetPkg/DEBUG_UNIXGCC export BASETOOLS_DIR=$WORKSPACE/Conf/BaseToolsSource/Source/C/bin export PROCESSOR="" @@ -14,20 +17,25 @@ if [ \ ] then echo Error! Please specific the architecture. - echo Usage: ". PostBuild.sh [IA32|X64]" + echo Usage: "./PostBuild.sh [IA32|X64]" fi -if [ "$1" = IA32 ] -then - export PROCESSOR=IA32 -fi +case "$1" in + IA32) + export PROCESSOR=IA32 + ;; + X64) + export PROCESSOR=X64 + ;; + *) + echo Invalid Architecture string, should be only IA32 or X64 + return 1 +esac -if [ "$1" = X64 ] -then - export PROCESSOR=X64 -fi - -export OUTPUT_DIR=$BUILD_DIR/$PROCESSOR/DuetPkg/BootSector/BootSector/OUTPUT +# +# Boot sector module could only be built under IA32 tool chain +# +export OUTPUT_DIR=$BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT echo Compressing DUETEFIMainFv.FV ... $BASETOOLS_DIR/TianoCompress -e -o $BUILD_DIR/FV/DUETEFIMAINFV.z $BUILD_DIR/FV/DUETEFIMAINFV.Fv @@ -43,30 +51,32 @@ echo Generate Loader Image ... if [ $PROCESSOR = IA32 ] then $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 - mkdir -p $BUILD_DIR/FV/Efildr - mkdir -p $BUILD_DIR/FV/Efildr16 - mkdir -p $BUILD_DIR/FV/Efildr20 - - cp $OUTPUT_DIR/start.com $OUTPUT_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 $BUILD_DIR/FV/Efildr - cp $OUTPUT_DIR/start16.com $OUTPUT_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 $BUILD_DIR/FV/Efildr16 - cp $OUTPUT_DIR/start32.com $OUTPUT_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 $BUILD_DIR/FV/Efildr20 + cat $OUTPUT_DIR/start.com $OUTPUT_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 $OUTPUT_DIR/start.com $OUTPUT_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 + cat $OUTPUT_DIR/start16.com $OUTPUT_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 > $BUILD_DIR/FV/Efildr16 + #bcat -o $BUILD_DIR/FV/Efildr16.bcat $OUTPUT_DIR/start16.com $OUTPUT_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 + cat $OUTPUT_DIR/start32.com $OUTPUT_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 > $BUILD_DIR/FV/Efildr20 + #bcat -o $BUILD_DIR/FV/Efildr20.bcat $OUTPUT_DIR/start32.com $OUTPUT_DIR/efi32.com2 $BUILD_DIR/FV/Efildr32 echo Done! fi if [ $PROCESSOR = X64 ] then $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 - mkdir -p $BUILD_DIR/FV/EfildrPure - mkdir -p $BUILD_DIR/FV/Efildr16Pure - mkdir -p $BUILD_DIR/FV/Efildr20Pure - - cp $OUTPUT_DIR/start64.com $OUTPUT_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64 $BUILD_DIR/FV/EfildrPure + cat $OUTPUT_DIR/start64.com $OUTPUT_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64 > $BUILD_DIR/FV/EfildrPure + #bcat -o $BUILD_DIR/FV/EfildrPure $OUTPUT_DIR/start64.com $OUTPUT_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64 $BASETOOLS_DIR/GenPage $BUILD_DIR/FV/EfildrPure -o $BUILD_DIR/FV/Efildr - cp $OUTPUT_DIR/st16_64.com $OUTPUT_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64 $BUILD_DIR/FV/Efildr16Pure + cat $OUTPUT_DIR/st16_64.com $OUTPUT_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64 > $BUILD_DIR/FV/Efildr16Pure + #bcat -o $BUILD_DIR/FV/Efildr16Pure $OUTPUT_DIR/st16_64.com $OUTPUT_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64 $BASETOOLS_DIR/GenPage $BUILD_DIR/FV/Efildr16Pure -o $BUILD_DIR/FV/Efildr16 - cp $OUTPUT_DIR/st32_64.com $OUTPUT_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64 $BUILD_DIR/FV/Efildr20Pure + cat $OUTPUT_DIR/st32_64.com $OUTPUT_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64 > $BUILD_DIR/FV/Efildr20Pure + #bcat -o $BUILD_DIR/FV/Efildr20Pure $OUTPUT_DIR/st32_64.com $OUTPUT_DIR/efi64.com2 $BUILD_DIR/FV/Efildr64 $BASETOOLS_DIR/GenPage $BUILD_DIR/FV/Efildr20Pure -o $BUILD_DIR/FV/Efildr20 echo Done! fi +