blob: 70b534f6170bd2b0444eb0cdf7bcf01bc4c885a2 [file] [log] [blame]
gikidy5b7021e2009-03-03 06:27:07 +00001
2# Set up environment at fisrt.
3export BASETOOLS_DIR=$WORKSPACE_TOOLS_PATH/Bin/Win32
4export BUILD_DIR=$WORKSPACE/Conf/BaseToolsSource/Source/C/bin
5export DISK_LABEL=DUET
6
7if [ \
8 -z "$*" -o \
9 "$*" = "-?" -o \
10 "$*" = "-h" -o \
11 "$*" = "--help" \
12 ]
13then
14 echo "Usage: CreateBootDisk [usb|floppy|ide] DiskNumber [FAT12|FAT16|FAT32]"
15 exit 1
16fi
17
18export EFI_BOOT_DISK=$2
19
20case "$1" in
21 floppy)
22 if [ "$3" = FAT12 ]
23 then
24 echo Start to create floppy boot disk ...
25 echo Format $EFI_BOOT_DISK ...
26 ## Do some format things , not done yet.
27 echo Create boot sector ...
28 ## Linux version of GenBootSector has not pass build yet.
29 $BASETOOLS_DIR/Genbootsector -i $EFI_BOOT_DISK -o FDBs.com
30 $BASETOOLS_DIR/Bootsectimage -g FDBs.com $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/Bootsect.com -f
31 $BASETOOLS_DIR/Genbootsector -o $EFI_BOOT_DISK -i $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/Bootsect.com
32
33 cp $BUILD_DIR/FV/EfiLdr $EFI_BOOT_DISK
34 cat $WORKSPACE/EdkShellBinPkg/bin/ia32/Shell.efi > $EFI_BOOT_DISK/efi/boot/bootia32.efi
35
36 echo Done.
37 else
38 echo "Wrong FAT type $3 for floppy!"
39 exit
40 fi
41 ;;
42
43 file) # CreateFile
44 if [ "$3" = FAT12 ]
45 then
46 echo "Start to create file boot disk ..."
47 echo Create boot sector ...
48
49 ## Linux version of GenBootSector has not pass build yet.
50 $BASETOOLS_DIR/Genbootsector -i $EFI_BOOT_DISK -o FDBs.com
51 $BASETOOLS_DIR/Bootsectimage -g FDBs.com $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/Bootsect.com -f
52 $BASETOOLS_DIR/Genbootsector -o $EFI_BOOT_DISK -i $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/Bootsect.com
53 echo Done.
54 else
55 echo "Wrong FAT type" $3 "for floppy!"
56 exit
57 fi
58 ;;
59
60 usb) # CreateUsb
61
62 if [ "$3" = FAT16 ]
63 then
64 if [ "$4" = step2 ]
65 then
66 cp $BUILD_DIR/FV/EfiLdr16 $EFI_BOOT_DISK
67 mkdir $EFI_BOOT_DISK/efi/boot
68 cp $WORKSPACE/EdkShellBinPkg/bin/ia32/Shell.efi $EFI_BOOT_DISK/efi/boot/bootia32.efi
69 echo "step2 Done!"
70 else
71 echo Format $EFI_BOOT_DISK ...
72 #Do format command.
73 echo Create boot sector ...
74 ## Linux version of GenBootSector & Bootsectimage has not pass build yet.
75 $BASETOOLS_DIR/Genbootsector -i $EFI_BOOT_DISK -o UsbBs16.com
76 $BASETOOLS_DIR/Bootsectimage -g UsbBs16.com $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/Bs16.com -f
77 $BASETOOLS_DIR/Genbootsector -o $EFI_BOOT_DISK -i $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/Bs16.com
78 $BASETOOLS_DIR/Genbootsector -m -o $EFI_BOOT_DISK -i $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/Mbr.com
79 echo Done.
80 echo PLEASE UNPLUG USB, THEN PLUG IT AGAIN TO DO STEP2!
81 exit 1
82 fi
83 elif [ "$3" = FAT32 ]
84 then
85 if [ "$4" = step2 ]
86 then
87 cp $BUILD_DIR/FV/EfiLdr20 $EFI_BOOT_DISK
88 mkdir $EFI_BOOT_DISK/efi/boot
89 cp $WORKSPACE/EdkShellBinPkg/bin/ia32/Shell.efi $EFI_BOOT_DISK/efi/boot/bootia32.efi
90 echo "step2 Done!"
91 else
92 echo Format $EFI_BOOT_DISK ...
93 #Do format command.
94 echo Create boot sector ...
95 ## Linux version of GenBootSector & Bootsectimage has not pass build yet.
96 $BASETOOLS_DIR/Genbootsector -i $EFI_BOOT_DISK -o UsbBs32.com
97 $BASETOOLS_DIR/Bootsectimage -g UsbBs32.com $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/Bs32.com -f
98 $BASETOOLS_DIR/Genbootsector -o $EFI_BOOT_DISK -i $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/Bs32.com
99 $BASETOOLS_DIR/Genbootsector -m -o $EFI_BOOT_DISK -i $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/Mbr.com
100 echo Done.
101 echo PLEASE UNPLUG USB, THEN PLUG IT AGAIN TO DO STEP2!
102 exit 1
103 fi
104 else
105 echo "Wrong FAT type $1 for floppy!"
106 fi
107
108 ;;
109
110 ide) # CreateIde
111 exit 1
112 ;;
113 *)
114 echo "Arg1 should be [floopy | file | usb | ide] !"
115 exit 1
116
117esac
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151