X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=DuetPkg%2FCreateBootDisk.sh;h=8d8543fc5b923a70ca8d90de9dd01d448308dabe;hb=0677cc4925d580f7016ac092dc591be0ebe03495;hp=09038055766f75ecfadd5b2bd567654a1dfda6bb;hpb=c4ae2792f250bce176cf68ecdd64d4bf246c3fb0;p=mirror_edk2.git diff --git a/DuetPkg/CreateBootDisk.sh b/DuetPkg/CreateBootDisk.sh index 0903805576..8d8543fc5b 100755 --- a/DuetPkg/CreateBootDisk.sh +++ b/DuetPkg/CreateBootDisk.sh @@ -1,22 +1,28 @@ -#! /bin/sh - -## @file -# -# 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. -# -# -## +#! /bin/sh + +## @file +# +# 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. +# +# +## # Set up environment at fisrt. -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 DISK_LABEL=DUET export PROCESS_MARK=TRUE @@ -28,11 +34,33 @@ if [ \ "$*" = "--help" \ ] then - echo "Usage: CreateBootDisk [usb|floppy|ide] MediaPath DevicePath [FAT12|FAT16|FAT32] [IA32|X64]" + echo "Usage: CreateBootDisk [usb|floppy|ide|file] MediaPath DevicePath [FAT12|FAT16|FAT32] [IA32|X64] [GCC44|UNIXGCC]" 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 + +if [ -z "$6" ] +then + TOOLCHAIN=GCC44 +else + TOOLCHAIN=$6 +fi + +export BUILD_DIR=$WORKSPACE/Build/DuetPkg$PROCESSOR/DEBUG_$TOOLCHAIN + + export EFI_BOOT_MEDIA=$2 export EFI_BOOT_DEVICE=$3 @@ -79,12 +107,28 @@ then if [ "$4" = FAT12 ] then echo "Start to create file boot disk ..." - echo Create boot sector ... - + dd bs=512 count=2880 if=/dev/zero of=$EFI_BOOT_MEDIA + mkfs.msdos -F 12 $EFI_BOOT_MEDIA + + mcopy -i $EFI_BOOT_MEDIA $BUILD_DIR/FV/Efildr ::/Efildr + mmd -i $EFI_BOOT_MEDIA ::/efi ::/efi/boot + if [ "$5" = IA32 ] + then + mcopy -i $EFI_BOOT_MEDIA $WORKSPACE/EdkShellBinPkg/MinimumShell/Ia32/Shell.efi ::/efi/boot/bootia32.efi + elif [ "$5" = X64 ] + then + mcopy -i $EFI_BOOT_MEDIA $WORKSPACE/EdkShellBinPkg/MinimumShell/X64/Shell.efi ::/efi/boot/bootx64.efi + else + echo Wrong Arch! + fi + mdir -i $EFI_BOOT_MEDIA -s :: + ## Linux version of GenBootSector has not pass build yet. - $BASETOOLS_DIR/GnuGenBootSector -i $EFI_BOOT_MEDIA -o FDBs.com - $BASETOOLS_DIR/BootSectImage -g FDBs.com $BOOTSECTOR_BIN_DIR/bootsect.com -f - $BASETOOLS_DIR/GnuGenBootSector -o $EFI_BOOT_MEDIA -i $BOOTSECTOR_BIN_DIR/bootsect.com + $BASETOOLS_DIR/GnuGenBootSector -i $EFI_BOOT_MEDIA -o $EFI_BOOT_MEDIA.bs0 + cp $BOOTSECTOR_BIN_DIR/bootsect.com $EFI_BOOT_MEDIA.bs1 + $BASETOOLS_DIR/BootSectImage -g $EFI_BOOT_MEDIA.bs0 $EFI_BOOT_MEDIA.bs1 + $BASETOOLS_DIR/GnuGenBootSector -o $EFI_BOOT_MEDIA -i $EFI_BOOT_MEDIA.bs1 + rm $EFI_BOOT_MEDIA.bs[0-1] echo Done. else echo "Wrong FAT type" $4 "for floppy!"