summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2010-10-16 18:50:43 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2010-10-16 18:50:43 +0000
commit5c1138b0f0800c00c1194235eb45fbe727183080 (patch)
tree23760abe51ded85e5987571ff2ad1fea601f5528
parent9046a2f9d318e6aeb62395b1e94af79d0465b6c7 (diff)
downloadedk2-platforms-5c1138b0f0800c00c1194235eb45fbe727183080.tar.xz
DuetPkg CreateBootDisk.sh: Enable building a DUET floppy image
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10947 6f19259b-4bc3-4df7-8a09-765794883524
-rwxr-xr-xDuetPkg/CreateBootDisk.sh40
1 files changed, 34 insertions, 6 deletions
diff --git a/DuetPkg/CreateBootDisk.sh b/DuetPkg/CreateBootDisk.sh
index 00f502d985..69a642074e 100755
--- a/DuetPkg/CreateBootDisk.sh
+++ b/DuetPkg/CreateBootDisk.sh
@@ -16,7 +16,13 @@
# Set up environment at fisrt.
+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,7 +34,7 @@ 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
@@ -45,7 +51,14 @@ case "$5" in
return 1
esac
-export BUILD_DIR=$WORKSPACE/Build/DuetPkg$PROCESSOR/DEBUG_UNIXGCC
+if [ -z "$6" ]
+then
+ TOOLCHAIN=GCC44
+else
+ TOOLCHAIN=$6
+fi
+
+export BUILD_DIR=$WORKSPACE/Build/DuetPkg$PROCESSOR/DEBUG_$TOOLCHAIN
export EFI_BOOT_MEDIA=$2
@@ -94,11 +107,26 @@ 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 -i $EFI_BOOT_MEDIA -o $EFI_BOOT_MEDIA.bs0
+ cp $EFI_BOOT_MEDIA.bs0 $EFI_BOOT_MEDIA.bs1
+ $BASETOOLS_DIR/BootSectImage -g $EFI_BOOT_MEDIA.bs1 $BOOTSECTOR_BIN_DIR/bootsect.com
$BASETOOLS_DIR/GnuGenBootSector -o $EFI_BOOT_MEDIA -i $BOOTSECTOR_BIN_DIR/bootsect.com
echo Done.
else