forked from AnwariJr/vendor_intel_build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fastboot-test-prepare
executable file
·35 lines (26 loc) · 1.08 KB
/
fastboot-test-prepare
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
27
28
29
30
31
32
33
34
35
#!/bin/bash
# Bail on any errors
set -e
if [ -z "$ANDROID_BUILD_TOP" ]; then
echo "Run lunch first!"
exit 1
fi
if [[ -z "$1" ]]; then
echo "No target-files-package provided!"
exit 1
fi
pushd $ANDROID_BUILD_TOP &> /dev/null
rm -rf fastboot
mkdir fastboot
cp $1 fastboot/tfp.zip
make clean
make -j16 fastboot otatools keystore_signer
./build/tools/releasetools/img_from_target_files --verbose fastboot/tfp.zip fastboot/update.zip
./device/intel/build/releasetools/flashfiles_from_target_files --verbose -x $2 -x $3 fastboot/tfp.zip fastboot/flashfiles.zip
unzip fastboot/flashfiles.zip -d fastboot/
simg2img fastboot/system.img fastboot/unsparse.img
./device/intel/build/releasetools/bootloader_from_target_files --bootable --verbose fastboot/tfp.zip fastboot/fastboot-usb.zip
openssl pkcs8 -nocrypt -inform DER -outform PEM -in device/intel/build/testkeys/oem.pk8 -out fastboot/oem.key
openssl rsa -pubout -inform PEM -outform DER -in device/intel/build/testkeys/production-test/verity -out fastboot/verity.pub
keystore_signer fastboot/oem.key fastboot/keystore fastboot/verity.pub
popd