1. update bat file to generate right bootia32.efi/bootx64.efi file according to command line parameters.
2. fix a print error in which a %x in format string exists but the corresponding variable argument is not present!
3. fix CONSUME_MEMORY too small issue. In X64 arch, cpu may cause the paging table is too big and beyond the pei memory scope between EfiMemoryTop and EfimemoryBottom. for example, a cpu support 44bits addressing memory space may occupied ~64M paging table.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9794 6f19259b-4bc3-4df7-8a09-765794883524
diff --git a/DuetPkg/CreateBootDisk.sh b/DuetPkg/CreateBootDisk.sh
index fb54a31..bfe1abd 100755
--- a/DuetPkg/CreateBootDisk.sh
+++ b/DuetPkg/CreateBootDisk.sh
@@ -14,8 +14,8 @@
      "$*" = "--help" \
    ]
 then
-	echo "Usage: CreateBootDisk [usb|floppy|ide] MediaPath DevicePath [FAT12|FAT16|FAT32]"
-	echo "e.g. : CreateBootDisk floppy /media/floppy0 /dev/fd0 FAT12 "
+	echo "Usage: CreateBootDisk [usb|floppy|ide] MediaPath DevicePath [FAT12|FAT16|FAT32] [IA32|X64]"
+	echo "e.g. : CreateBootDisk floppy /media/floppy0 /dev/fd0 FAT12 IA32"
 	PROCESS_MARK=FALSE
 fi
 
@@ -44,9 +44,17 @@
 	
 				mkdir -p $EFI_BOOT_MEDIA/efi
 				mkdir -p $EFI_BOOT_MEDIA/efi/boot
-
-				cp $WORKSPACE/EdkShellBinPkg/MinimumShell/Ia32/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootia32.efi 
-	
+				if [ "$5" = IA32 ]
+				then
+					cp $WORKSPACE/EdkShellBinPkg/MinimumShell/Ia32/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootia32.efi 
+				else
+					if [ "$5" = X64 ]
+					then
+						cp $WORKSPACE/EdkShellBinPkg/MinimumShell/X64/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootx64.efi 
+					else
+						echo Wrong Arch!
+					fi
+				fi
 				echo Done.
 			else
 				echo "Wrong FAT type $4 for floppy!"
@@ -73,11 +81,21 @@
 
 			if [ "$4" = FAT16 ]
 			then
-				if [ "$5" = step2 ]
+				if [ "$6" = step2 ]
 				then
 					cp $BUILD_DIR/FV/Efildr16 $EFI_BOOT_MEDIA
 					mkdir $EFI_BOOT_MEDIA/efi/boot
-					cp $WORKSPACE/EdkShellBinPkg/MinimumShell/ia32/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootia32.efi
+					if [ "$5" = IA32 ]
+					then
+						cp $WORKSPACE/EdkShellBinPkg/MinimumShell/Ia32/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootia32.efi 
+					else
+						if [ "$5" = X64 ]
+						then
+							cp $WORKSPACE/EdkShellBinPkg/MinimumShell/X64/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootx64.efi 
+						else
+							echo Wrong Arch!
+						fi
+					fi
 					echo "step2 Done!"
 				else
 					echo Format $EFI_BOOT_DEVICE ...
@@ -93,11 +111,21 @@
 				fi
 			elif [ "$4" = FAT32 ]
 			then 
-				if [ "$5" = step2 ]
+				if [ "$6" = step2 ]
 				then
 					cp $BUILD_DIR/FV/Efildr20 $EFI_BOOT_MEDIA
 					mkdir $EFI_BOOT_MEDIA/efi/boot
-					cp $WORKSPACE/EdkShellBinPkg/MinimumShell/ia32/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootia32.efi
+					if [ "$5" = IA32 ]
+					then
+						cp $WORKSPACE/EdkShellBinPkg/MinimumShell/Ia32/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootia32.efi 
+					else
+						if [ "$5" = X64 ]
+						then
+							cp $WORKSPACE/EdkShellBinPkg/MinimumShell/X64/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootx64.efi 
+						else
+							echo Wrong Arch!
+						fi
+					fi
 					echo "step2 Done!"
 				else
 					echo Format $EFI_BOOT_DEVICE ...