3 # Set up environment at fisrt.
4 export BUILD_DIR
=$WORKSPACE/Build
/DuetPkg
/DEBUG_UNIXGCC
5 export BASETOOLS_DIR
=$WORKSPACE/Conf
/BaseToolsSource
/Source
/C
/bin
6 export BOOTSECTOR_BIN_DIR
=$WORKSPACE/DuetPkg
/BootSector
/bin
8 export PROCESS_MARK
=TRUE
17 echo "Usage: CreateBootDisk [usb|floppy|ide] MediaPath DevicePath [FAT12|FAT16|FAT32]"
18 echo "e.g. : CreateBootDisk floppy /media/floppy0 /dev/fd0 FAT12 "
22 export EFI_BOOT_MEDIA
=$2
23 export EFI_BOOT_DEVICE
=$3
25 if [ "$PROCESS_MARK" = TRUE
]
31 echo Start to create floppy boot disk ...
32 echo Format
$EFI_BOOT_MEDIA ...
34 umount
$EFI_BOOT_MEDIA
35 mkfs.msdos
$EFI_BOOT_DEVICE
36 mount
$EFI_BOOT_DEVICE $EFI_BOOT_MEDIA
37 echo Create boot sector ...
38 ## Linux version of GenBootSector has not pass build yet.
39 $BASETOOLS_DIR/GnuGenBootSector
-i $EFI_BOOT_DEVICE -o FDBs.com
40 $BASETOOLS_DIR/BootSectImage
-g FDBs.com
$BOOTSECTOR_BIN_DIR/bootsect.com
-f
41 $BASETOOLS_DIR/GnuGenBootSector
-o $EFI_BOOT_DEVICE -i $BOOTSECTOR_BIN_DIR/bootsect.com
43 cp $BUILD_DIR/FV
/Efildr
$EFI_BOOT_MEDIA
45 mkdir
-p $EFI_BOOT_MEDIA/efi
46 mkdir
-p $EFI_BOOT_MEDIA/efi
/boot
48 cp $WORKSPACE/EdkShellBinPkg
/MinimumShell
/Ia32
/Shell.efi
$EFI_BOOT_MEDIA/efi
/boot
/bootia32.efi
52 echo "Wrong FAT type $4 for floppy!"
59 echo "Start to create file boot disk ..."
60 echo Create boot sector ...
62 ## Linux version of GenBootSector has not pass build yet.
63 $BASETOOLS_DIR/GnuGenBootSector
-i $EFI_BOOT_MEDIA -o FDBs.com
64 $BASETOOLS_DIR/BootSectImage
-g FDBs.com
$BOOTSECTOR_BIN_DIR/bootsect.com
-f
65 $BASETOOLS_DIR/GnuGenBootSector
-o $EFI_BOOT_MEDIA -i $BOOTSECTOR_BIN_DIR/bootsect.com
68 echo "Wrong FAT type" $4 "for floppy!"
78 cp $BUILD_DIR/FV
/Efildr16
$EFI_BOOT_MEDIA
79 mkdir
$EFI_BOOT_MEDIA/efi
/boot
80 cp $WORKSPACE/EdkShellBinPkg
/MinimumShell
/ia32
/Shell.efi
$EFI_BOOT_MEDIA/efi
/boot
/bootia32.efi
83 echo Format
$EFI_BOOT_DEVICE ...
85 echo Create boot sector ...
86 ## Linux version of GenBootSector & Bootsectimage has not pass build yet.
87 $BASETOOLS_DIR/GnuGenBootSector
-i $EFI_BOOT_DEVICE -o UsbBs16.com
88 $BASETOOLS_DIR/BootSectImage
-g UsbBs16.com
$BOOTSECTOR_BIN_DIR/bs16.com
-f
89 $BASETOOLS_DIR/GnuGenBootSector
-o $EFI_BOOT_DEVICE -i $BOOTSECTOR_BIN_DIR/bs16.com
90 $BASETOOLS_DIR/GnuGenBootSector
-m -o $EFI_BOOT_DEVICE -i $BOOTSECTOR_BIN_DIR/Mbr.com
92 echo PLEASE UNPLUG USB
, THEN PLUG IT AGAIN TO DO STEP2
!
98 cp $BUILD_DIR/FV
/Efildr20
$EFI_BOOT_MEDIA
99 mkdir
$EFI_BOOT_MEDIA/efi
/boot
100 cp $WORKSPACE/EdkShellBinPkg
/MinimumShell
/ia32
/Shell.efi
$EFI_BOOT_MEDIA/efi
/boot
/bootia32.efi
103 echo Format
$EFI_BOOT_DEVICE ...
105 echo Create boot sector ...
106 ## Linux version of GenBootSector & Bootsectimage has not pass build yet.
107 $BASETOOLS_DIR/GnuGenBootSector
-i $EFI_BOOT_DEVICE -o UsbBs32.com
108 $BASETOOLS_DIR/BootSectImage
-g UsbBs32.com
$BOOTSECTOR_BIN_DIR/bs32.com
-f
109 $BASETOOLS_DIR/GnuGenBootSector
-o $EFI_BOOT_DEVICE -i $BOOTSECTOR_BIN_DIR/bs32.com
110 $BASETOOLS_DIR/GnuGenBootSector
-m -o $EFI_BOOT_DEVICE -i $BOOTSECTOR_BIN_DIR/Mbr.com
112 echo PLEASE UNPLUG USB
, THEN PLUG IT AGAIN TO DO STEP2
!
115 echo "Wrong FAT type $1 for floppy!"
121 echo "Not support yet!"
124 echo "Arg1 should be [floppy | file | usb | ide] !"