Re: [edk2] DUET CreateBootDisk.bat modifies checked-in binary

Subject: Re: [edk2] DUET CreateBootDisk.bat modifies checked-in binary

From: "Sun, Rui" <rui.sun@intel.com>

To: "edk2-devel@lists.sourceforge.net" <edk2-devel@lists.sourceforge.net>

Date: 2012-02-27 10:35:19

Thanks! We will review this patch and have it integrated.

-----Original Message-----
From: Doug Azzarito [mailto:azzarito@bigfoot.com] 
Sent: Saturday, February 25, 2012 6:37 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] DUET CreateBootDisk.bat modifies checked-in binary

When I looked at the Linux script, I thought it did copy the
checked-in binary, but that was only in the "file" mode. In "floppy"
or "usb" mode it doesn't. So, I patched the .bat and .sh. I noticed
that in one place, the boot sector from the source medium was deleted,
and in others it wasn't. Since having that file would allow someone to
remove the UEFI bootstrap and restore the original (doubtful this is
useful, but who knows), I left that file in all cases, but deleted the
"patched" file I create that is written to the boot medium (it serves
no purpose after this script runs).

Now, when I create a Duet boot disk, all the checked-in files are left
as they are. Here's the patch file you asked for.

Index: CreateBootDisk.bat
===================================================================
--- CreateBootDisk.bat	(revision 13016)
+++ CreateBootDisk.bat	(working copy)
@@ -53,9 +53,11 @@
 @del FormatCommandInput.txt
 @echo Create boot sector ...
 %BASETOOLS_DIR%\Genbootsector.exe -i %EFI_BOOT_DISK% -o FDBs.com
-%BASETOOLS_DIR%\Bootsectimage.exe -g FDBs.com
%BOOTSECTOR_BIN_DIR%\Bootsect.com -f
+@copy %BOOTSECTOR_BIN_DIR%\Bootsect.com FDBs-1.com
+%BASETOOLS_DIR%\Bootsectimage.exe -g FDBs.com FDBs-1.com -f
 @REM @del FDBS.com
-%BASETOOLS_DIR%\Genbootsector.exe -o %EFI_BOOT_DISK% -i
%BOOTSECTOR_BIN_DIR%\Bootsect.com
+%BASETOOLS_DIR%\Genbootsector.exe -o %EFI_BOOT_DISK% -i FDBs-1.com
+@del FDBs-1.com
 @echo Done.
 copy %BUILD_DIR%\FV\EfiLdr %EFI_BOOT_DISK%
 mkdir %EFI_BOOT_DISK%\efi\boot
@@ -68,9 +70,11 @@
 @echo Start to create file boot disk ...
 @echo Create boot sector ...
 %BASETOOLS_DIR%\Genbootsector.exe -i %EFI_BOOT_DISK% -o FDBs.com
-%BASETOOLS_DIR%\Bootsectimage.exe -g FDBs.com
%BOOTSECTOR_BIN_DIR%\Bootsect.com -f
+copy %BOOTSECTOR_BIN_DIR%\Bootsect.com FDBs-1.com
+%BASETOOLS_DIR%\Bootsectimage.exe -g FDBs.com FDBs-1.com -f
 @REM @del FDBS.com
-%BASETOOLS_DIR%\Genbootsector.exe -o %EFI_BOOT_DISK% -i
%BOOTSECTOR_BIN_DIR%\Bootsect.com
+%BASETOOLS_DIR%\Genbootsector.exe -o %EFI_BOOT_DISK% -i FDBs-1.com
+@del FDBs-1.com
 @echo Done.
 @goto end

@@ -88,9 +92,11 @@
 @del FormatCommandInput.txt
 @echo Create boot sector ...
 @%BASETOOLS_DIR%\Genbootsector.exe -i %EFI_BOOT_DISK% -o UsbBs16.com
-@%BASETOOLS_DIR%\Bootsectimage.exe -g UsbBs16.com
%BOOTSECTOR_BIN_DIR%\Bs16.com -f
-@%BASETOOLS_DIR%\Genbootsector.exe -o %EFI_BOOT_DISK% -i
%BOOTSECTOR_BIN_DIR%\Bs16.com
+@copy %BOOTSECTOR_BIN_DIR%\Bs16.com UsbBs16-1.com
+@%BASETOOLS_DIR%\Bootsectimage.exe -g UsbBs16.com UsbBs16-1.com -f
+@%BASETOOLS_DIR%\Genbootsector.exe -o %EFI_BOOT_DISK% -i UsbBs16-1.com
 @%BASETOOLS_DIR%\Genbootsector.exe -m -o %EFI_BOOT_DISK% -i
%BOOTSECTOR_BIN_DIR%\Mbr.com
+@del UsbBs16-1.com
 @echo Done.
 @echo PLEASE UNPLUG USB, THEN PLUG IT AGAIN!
 @goto end
@@ -110,10 +116,12 @@
 @del FormatCommandInput.txt
 @echo Create boot sector ...
 @%BASETOOLS_DIR%\Genbootsector.exe -i %EFI_BOOT_DISK% -o UsbBs32.com
-@%BASETOOLS_DIR%\Bootsectimage.exe -g UsbBs32.com
%BOOTSECTOR_BIN_DIR%\Bs32.com -f
-@del UsbBs32.com
-@%BASETOOLS_DIR%\Genbootsector.exe -o %EFI_BOOT_DISK% -i
%BOOTSECTOR_BIN_DIR%\Bs32.com
+@copy %BOOTSECTOR_BIN_DIR%\Bs32.com UsbBs32-1.com
+@%BASETOOLS_DIR%\Bootsectimage.exe -g UsbBs32.com UsbBs32-1.com -f
+@REM @del UsbBs32.com
+@%BASETOOLS_DIR%\Genbootsector.exe -o %EFI_BOOT_DISK% -i UsbBs32-1.com
 @%BASETOOLS_DIR%\Genbootsector.exe -m -o %EFI_BOOT_DISK% -i
%BOOTSECTOR_BIN_DIR%\Mbr.com
+@del UsbBs32-1.com
 @echo Done.
 @echo PLEASE UNPLUG USB, THEN PLUG IT AGAIN!
 @goto end
@@ -147,4 +155,4 @@
 :Help
 @echo "Usage: CreateBootDisk [usb|floppy|ide] DiskNumber
[FAT12|FAT16|FAT32] [IA32|X64]"
 :end
-@echo on
\ No newline at end of file
+@echo on
Index: CreateBootDisk.sh
===================================================================
--- CreateBootDisk.sh	(revision 13016)
+++ CreateBootDisk.sh	(working copy)
@@ -79,8 +79,10 @@
 				echo Create boot sector ...
 				## Linux version of GenBootSector has not pass build yet.
 				$BASETOOLS_DIR/GnuGenBootSector -i $EFI_BOOT_DEVICE -o FDBs.com
-				$BASETOOLS_DIR/BootSectImage -g FDBs.com
$BOOTSECTOR_BIN_DIR/bootsect.com -f
-				$BASETOOLS_DIR/GnuGenBootSector -o $EFI_BOOT_DEVICE -i
$BOOTSECTOR_BIN_DIR/bootsect.com
+				cp $BOOTSECTOR_BIN_DIR/bootsect.com FDBs-1.com
+				$BASETOOLS_DIR/BootSectImage -g FDBs.com FDBs-1.com -f
+				$BASETOOLS_DIR/GnuGenBootSector -o $EFI_BOOT_DEVICE -i FDBs-1.com
+				rm FDBs-1.com
 	
 				cp $BUILD_DIR/FV/Efildr $EFI_BOOT_MEDIA
 	
@@ -161,9 +163,11 @@
 					echo Create boot sector ...
 					## Linux version of GenBootSector & Bootsectimage has not pass build yet.
 					$BASETOOLS_DIR/GnuGenBootSector -i $EFI_BOOT_DEVICE -o UsbBs16.com
-					$BASETOOLS_DIR/BootSectImage -g UsbBs16.com
$BOOTSECTOR_BIN_DIR/bs16.com -f
-					$BASETOOLS_DIR/GnuGenBootSector -o $EFI_BOOT_DEVICE -i
$BOOTSECTOR_BIN_DIR/bs16.com
+					cp $BOOTSECTOR_BIN_DIR/bs16.com UsbBs16-1.com
+					$BASETOOLS_DIR/BootSectImage -g UsbBs16.com UsbBs16-1.com -f
+					$BASETOOLS_DIR/GnuGenBootSector -o $EFI_BOOT_DEVICE -i UsbBs16-1.com
 					$BASETOOLS_DIR/GnuGenBootSector -m -o $EFI_BOOT_DEVICE -i
$BOOTSECTOR_BIN_DIR/Mbr.com
+					rm UsbBs16-1.com
 					echo Done.
 					echo PLEASE UNPLUG USB, THEN PLUG IT AGAIN TO DO STEP2!
 				fi
@@ -191,9 +195,11 @@
 					echo Create boot sector ...
 					## Linux version of GenBootSector & Bootsectimage has not pass build yet.
 					$BASETOOLS_DIR/GnuGenBootSector -i $EFI_BOOT_DEVICE -o UsbBs32.com
-					$BASETOOLS_DIR/BootSectImage -g UsbBs32.com
$BOOTSECTOR_BIN_DIR/bs32.com -f
-					$BASETOOLS_DIR/GnuGenBootSector -o $EFI_BOOT_DEVICE -i
$BOOTSECTOR_BIN_DIR/bs32.com
+					cp $BOOTSECTOR_BIN_DIR/bs32.com UsbBs32-1.com
+					$BASETOOLS_DIR/BootSectImage -g UsbBs32.com UsbBs32-1.com -f
+					$BASETOOLS_DIR/GnuGenBootSector -o $EFI_BOOT_DEVICE -i UsbBs32-1.com
 					$BASETOOLS_DIR/GnuGenBootSector -m -o $EFI_BOOT_DEVICE -i
$BOOTSECTOR_BIN_DIR/Mbr.com
+					rm UsbBs32-1.com
 					echo Done.
 					echo PLEASE UNPLUG USB, THEN PLUG IT AGAIN TO DO STEP2!
 				fi

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel