forked from sonic011gamer/msm8909Pkg
-
Notifications
You must be signed in to change notification settings - Fork 8
/
build_boot_images.sh
executable file
·26 lines (22 loc) · 1.22 KB
/
build_boot_images.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
if [ $1 == 'Leo' ]; then
cat BootShim/BootShim.bin workspace/Build/HtcLeo/DEBUG_GCC/FV/QSD8250_UEFI.fd >>ImageResources/Leo/bootpayload.bin
mkbootimg --kernel ImageResources/Leo/bootpayload.bin --base 0x11800000 --kernel_offset 0x00008000 -o ImageResources/Leo/uefi.img
# NBH creation
if [ ! -f ImageResources/Leo/nbgen ]; then
gcc -std=c99 ImageResources/Leo/nbgen.c -o ImageResources/Leo/nbgen
fi
# We're using a prebuild yang binary for now, since the compiled version doesn't seem to produce a valid NBH for Leo
if [ ! -f ImageResources/Leo/yang ]; then
gcc ImageResources/Leo/yang/nbh.c ImageResources/Leo/yang/nbhextract.c ImageResources/Leo/yang/yang.c -o ImageResources/Leo/yangbin
fi
cd ImageResources/Leo/
./nbgen os.nb
./yang -F LEOIMG.nbh -f logo.nb,os.nb -t 0x600,0x400 -s 64 -d PB8110000 -c 11111111 -v EDK2 -l WWE
cd ../../
elif [ $1 == 'Schubert' ]; then
cat BootShim/BootShim.bin workspace/Build/HtcSchubert/DEBUG_GCC/FV/QSD8250_UEFI.fd >>ImageResources/$1/bootpayload.bin
mkbootimg --kernel ImageResources/$1/bootpayload.bin --base 0x20000000 --kernel_offset 0x00008000 -o ImageResources/$1/uefi.img
else
echo "Bootimages: Invalid platform"
fi