]>
Commit | Line | Data |
---|---|---|
5b7021e6 | 1 | |
2 | # Set up environment at fisrt. | |
536c563d | 3 | export BUILD_DIR=$WORKSPACE/Build/DuetPkg/DEBUG_UNIXGCC |
4 | export BASETOOLS_DIR=$WORKSPACE/Conf/BaseToolsSource/Source/C/bin | |
5b7021e6 | 5 | export DISK_LABEL=DUET |
6 | ||
7 | if [ \ | |
8 | -z "$*" -o \ | |
9 | "$*" = "-?" -o \ | |
10 | "$*" = "-h" -o \ | |
11 | "$*" = "--help" \ | |
12 | ] | |
13 | then | |
536c563d | 14 | echo "Usage: CreateBootDisk [usb|floppy|ide] MediaPath DevicePath [FAT12|FAT16|FAT32]" |
15 | echo "e.g. : CreateBootDisk floppy /media/floppy0 /dev/fd0 FAT12 " | |
5b7021e6 | 16 | exit 1 |
17 | fi | |
18 | ||
536c563d | 19 | export EFI_BOOT_MEDIA=$2 |
20 | export EFI_BOOT_DEVICE=$3 | |
5b7021e6 | 21 | |
22 | case "$1" in | |
23 | floppy) | |
536c563d | 24 | if [ "$4" = FAT12 ] |
5b7021e6 | 25 | then |
26 | echo Start to create floppy boot disk ... | |
536c563d | 27 | echo Format $EFI_BOOT_MEDIA ... |
5b7021e6 | 28 | ## Do some format things , not done yet. |
29 | echo Create boot sector ... | |
30 | ## Linux version of GenBootSector has not pass build yet. | |
536c563d | 31 | $BASETOOLS_DIR/GnuGenBootSector -i $EFI_BOOT_DEVICE -o FDBs.com |
32 | echo aaa | |
33 | $BASETOOLS_DIR/BootSectImage -g FDBs.com $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/bootsect.com -f | |
34 | echo bbb | |
35 | $BASETOOLS_DIR/GnuGenBootSector -o $EFI_BOOT_DEVICE -i $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/bootsect.com | |
36 | echo ccc | |
5b7021e6 | 37 | |
536c563d | 38 | cp $BUILD_DIR/FV/Efildr $EFI_BOOT_MEDIA |
39 | ||
40 | mkdir -p $EFI_BOOT_MEDIA/efi | |
41 | mkdir -p $EFI_BOOT_MEDIA/efi/boot | |
42 | ||
43 | cp $WORKSPACE/EdkShellBinPkg/Bin/Ia32/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootia32.efi | |
5b7021e6 | 44 | |
45 | echo Done. | |
46 | else | |
536c563d | 47 | echo "Wrong FAT type $4 for floppy!" |
5b7021e6 | 48 | exit |
49 | fi | |
50 | ;; | |
51 | ||
52 | file) # CreateFile | |
536c563d | 53 | if [ "$4" = FAT12 ] |
5b7021e6 | 54 | then |
55 | echo "Start to create file boot disk ..." | |
56 | echo Create boot sector ... | |
57 | ||
58 | ## Linux version of GenBootSector has not pass build yet. | |
536c563d | 59 | $BASETOOLS_DIR/GnuGenBootSector -i $EFI_BOOT_MEDIA -o FDBs.com |
60 | $BASETOOLS_DIR/BootSectImage -g FDBs.com $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/Bootsect.com -f | |
61 | $BASETOOLS_DIR/GnuGenBootSector -o $EFI_BOOT_MEDIA -i $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/Bootsect.com | |
5b7021e6 | 62 | echo Done. |
63 | else | |
536c563d | 64 | echo "Wrong FAT type" $4 "for floppy!" |
5b7021e6 | 65 | exit |
66 | fi | |
67 | ;; | |
68 | ||
69 | usb) # CreateUsb | |
70 | ||
536c563d | 71 | if [ "$4" = FAT16 ] |
5b7021e6 | 72 | then |
536c563d | 73 | if [ "$5" = step2 ] |
5b7021e6 | 74 | then |
536c563d | 75 | cp $BUILD_DIR/FV/Efildr16 $EFI_BOOT_MEDIA |
76 | mkdir $EFI_BOOT_MEDIA/efi/boot | |
77 | cp $WORKSPACE/EdkShellBinPkg/bin/ia32/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootia32.efi | |
5b7021e6 | 78 | echo "step2 Done!" |
79 | else | |
536c563d | 80 | echo Format $EFI_BOOT_DEVICE ... |
5b7021e6 | 81 | #Do format command. |
82 | echo Create boot sector ... | |
83 | ## Linux version of GenBootSector & Bootsectimage has not pass build yet. | |
536c563d | 84 | $BASETOOLS_DIR/GnuGenBootSector -i $EFI_BOOT_DEVICE -o UsbBs16.com |
85 | $BASETOOLS_DIR/BootSectImage -g UsbBs16.com $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/Bs16.com -f | |
86 | $BASETOOLS_DIR/GnuGenBootSector -o $EFI_BOOT_DEVICE -i $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/Bs16.com | |
87 | $BASETOOLS_DIR/GnuGenBootSector -m -o $EFI_BOOT_DEVICE -i $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/Mbr.com | |
5b7021e6 | 88 | echo Done. |
89 | echo PLEASE UNPLUG USB, THEN PLUG IT AGAIN TO DO STEP2! | |
90 | exit 1 | |
91 | fi | |
536c563d | 92 | elif [ "$4" = FAT32 ] |
5b7021e6 | 93 | then |
536c563d | 94 | if [ "$5" = step2 ] |
5b7021e6 | 95 | then |
536c563d | 96 | cp $BUILD_DIR/FV/Efildr20 $EFI_BOOT_MEDIA |
97 | mkdir $EFI_BOOT_MEDIA/efi/boot | |
98 | cp $WORKSPACE/EdkShellBinPkg/bin/ia32/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootia32.efi | |
5b7021e6 | 99 | echo "step2 Done!" |
100 | else | |
536c563d | 101 | echo Format $EFI_BOOT_DEVICE ... |
5b7021e6 | 102 | #Do format command. |
103 | echo Create boot sector ... | |
104 | ## Linux version of GenBootSector & Bootsectimage has not pass build yet. | |
536c563d | 105 | $BASETOOLS_DIR/GnuGenBootSector -i $EFI_BOOT_DEVICE -o UsbBs32.com |
106 | $BASETOOLS_DIR/BootSectImage -g UsbBs32.com $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/Bs32.com -f | |
107 | $BASETOOLS_DIR/GnuGenBootSector -o $EFI_BOOT_DEVICE -i $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/Bs32.com | |
108 | $BASETOOLS_DIR/GnuGenBootSector -m -o $EFI_BOOT_DEVICE -i $BUILD_DIR/IA32/DuetPkg/BootSector/BootSector/OUTPUT/Mbr.com | |
5b7021e6 | 109 | echo Done. |
110 | echo PLEASE UNPLUG USB, THEN PLUG IT AGAIN TO DO STEP2! | |
111 | exit 1 | |
112 | fi | |
113 | else | |
114 | echo "Wrong FAT type $1 for floppy!" | |
115 | fi | |
116 | ||
117 | ;; | |
118 | ||
119 | ide) # CreateIde | |
120 | exit 1 | |
121 | ;; | |
122 | *) | |
123 | echo "Arg1 should be [floopy | file | usb | ide] !" | |
124 | exit 1 | |
125 | ||
126 | esac | |
127 |