3 @REM
Set up environment at fisrt.
5 @
set BASETOOLS_DIR
=%WORKSPACE_TOOLS_PATH%\Bin\Win32
6 @
set BUILD_DIR
=%WORKSPACE%\Build\DuetPkg\DEBUG_MYTOOLS
11 @
if "%1"=="" goto Help
12 @
if "%2"=="" goto Help
13 @
if "%3"=="" goto Help
15 @
if "%1"=="floppy" goto CreateFloppy
16 @
if "%1"=="file" goto CreateFile
17 @
if "%1"=="usb" goto CreateUsb
18 @
if "%1"=="ide" goto CreateIde
22 @
if NOT "%3"=="FAT12" goto WrongFATType
23 @
echo Start to create floppy
boot disk ...
24 @
echo Format %EFI_BOOT_DISK% ...
25 @
echo.
> FormatCommandInput.txt
26 @
echo.n
>> FormatCommandInput.txt
27 @
format /v
:%DISK_LABEL% /q
%EFI_BOOT_DISK% < FormatCommandInput.txt
> NUL
28 @
del FormatCommandInput.txt
29 @
echo Create
boot sector ...
30 %BASETOOLS_DIR%\Genbootsector.exe
-i
%EFI_BOOT_DISK% -o FDBs.com
31 %BASETOOLS_DIR%\Bootsectimage.exe
-g FDBs.com
%BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bootsect.com
-f
33 %BASETOOLS_DIR%\Genbootsector.exe
-o
%EFI_BOOT_DISK% -i
%BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bootsect.com
35 copy %BUILD_DIR%\FV\EfiLdr
%EFI_BOOT_DISK%
36 mkdir %EFI_BOOT_DISK%\efi
\boot
37 copy %WORKSPACE%\EdkShellBinPkg
\bin\ia32\
Shell.efi
%EFI_BOOT_DISK%\efi
\boot
\bootia
32.efi
/y
41 @
if NOT "%3"=="FAT12" goto WrongFATType
42 @
echo Start to create file
boot disk ...
43 @
echo Create
boot sector ...
44 %BASETOOLS_DIR%\Genbootsector.exe
-i
%EFI_BOOT_DISK% -o FDBs.com
45 %BASETOOLS_DIR%\Bootsectimage.exe
-g FDBs.com
%BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bootsect.com
-f
47 %BASETOOLS_DIR%\Genbootsector.exe
-o
%EFI_BOOT_DISK% -i
%BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bootsect.com
52 @
echo Start to create usb
boot disk ...
53 @
if "%3"=="FAT16" goto CreateUsb_FAT16
54 @
if "%3"=="FAT32" goto CreateUsb_FAT32
55 @
if "%3"=="FAT12" goto WrongFATType
58 @
if "%4"=="step2" goto CreateUsb_FAT16_step2
59 @
echo Format %EFI_BOOT_DISK% ...
60 @
echo.
> FormatCommandInput.txt
61 @
format /FS
:FAT /v
:%DISK_LABEL% /q
%EFI_BOOT_DISK% < FormatCommandInput.txt
> NUL
62 @
del FormatCommandInput.txt
63 @
echo Create
boot sector ...
64 @
%BASETOOLS_DIR%\Genbootsector.exe
-i
%EFI_BOOT_DISK% -o UsbBs16.com
65 @
%BASETOOLS_DIR%\Bootsectimage.exe
-g UsbBs16.com
%BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bs16.com
-f
66 @
%BASETOOLS_DIR%\Genbootsector.exe
-o
%EFI_BOOT_DISK% -i
%BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bs16.com
67 @
%BASETOOLS_DIR%\Genbootsector.exe
-m
-o
%EFI_BOOT_DISK% -i
%BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Mbr.com
69 @
echo PLEASE UNPLUG USB
, THEN PLUG IT AGAIN
!
72 :CreateUsb_FAT16_step2
73 @
copy %BUILD_DIR%\FV\EfiLdr16
%EFI_BOOT_DISK%
74 @
mkdir %EFI_BOOT_DISK%\efi
\boot
75 @
copy %WORKSPACE%\EdkShellBinPkg
\bin\ia32\
Shell.efi
%EFI_BOOT_DISK%\efi
\boot
\bootia
32.efi
/y
79 @
if "%4"=="step2" goto CreateUsb_FAT32_step2
80 @
echo Format %EFI_BOOT_DISK% ...
81 @
echo.
> FormatCommandInput.txt
82 @
format /FS
:FAT32 /v
:%DISK_LABEL% /q
%EFI_BOOT_DISK% < FormatCommandInput.txt
> NUL
83 @
del FormatCommandInput.txt
84 @
echo Create
boot sector ...
85 @
%BASETOOLS_DIR%\Genbootsector.exe
-i
%EFI_BOOT_DISK% -o UsbBs32.com
86 @
%BASETOOLS_DIR%\Bootsectimage.exe
-g UsbBs32.com
%BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bs32.com
-f
88 @
%BASETOOLS_DIR%\Genbootsector.exe
-o
%EFI_BOOT_DISK% -i
%BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bs32.com
89 @
%BASETOOLS_DIR%\Genbootsector.exe
-m
-o
%EFI_BOOT_DISK% -i
%BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Mbr.com
91 @
echo PLEASE UNPLUG USB
, THEN PLUG IT AGAIN
!
94 :CreateUsb_FAT32_step2
95 @
copy %BUILD_DIR%\FV\EfiLdr20
%EFI_BOOT_DISK%
96 @
mkdir %EFI_BOOT_DISK%\efi
\boot
97 @
copy %WORKSPACE%\EdkShellBinPkg
\bin\ia32\
Shell.efi
%EFI_BOOT_DISK%\efi
\boot
\bootia
32.efi
/y
104 @
echo Wrong FAT
type %3 for %1
108 @
echo "Usage: CreateBootDisk [usb|floppy|ide] DiskNumber [FAT12|FAT16|FAT32]"