]> git.proxmox.com Git - mirror_edk2.git/blobdiff - DuetPkg/CreateBootDisk.sh
Program SD Cards into 4-bit mode (support for this is required in the spec). This...
[mirror_edk2.git] / DuetPkg / CreateBootDisk.sh
index fb54a31b0d42a3e743f549e71e87c63136d98a54..00f502d98559a8c60be67d6ff06f5aa6e843f5a6 100755 (executable)
@@ -1,7 +1,21 @@
 #! /bin/sh
 
+## @file
+#
+#  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+#
+#  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.
+#
+#
+##
+
 # Set up environment at fisrt.
-export BUILD_DIR=$WORKSPACE/Build/DuetPkg/DEBUG_UNIXGCC
+
 export BASETOOLS_DIR=$WORKSPACE/Conf/BaseToolsSource/Source/C/bin
 export BOOTSECTOR_BIN_DIR=$WORKSPACE/DuetPkg/BootSector/bin
 export DISK_LABEL=DUET
@@ -14,11 +28,26 @@ if [ \
      "$*" = "--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
 
+case "$5" in
+   IA32)
+     export PROCESSOR=IA32
+     ;;
+   X64)
+     export PROCESSOR=X64
+     ;;
+   *)
+     echo Invalid Architecture string, should be only IA32 or X64
+     return 1
+esac
+
+export BUILD_DIR=$WORKSPACE/Build/DuetPkg$PROCESSOR/DEBUG_UNIXGCC
+
+
 export EFI_BOOT_MEDIA=$2
 export EFI_BOOT_DEVICE=$3
 
@@ -44,9 +73,17 @@ then
        
                                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 +110,21 @@ then
 
                        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 +140,21 @@ then
                                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 ...