Add createBuildBundle operation

This commit is contained in:
Fivel Sotheby 2019-05-30 20:39:02 +01:00
parent cd67425553
commit 029f844c71

View File

@ -3,6 +3,9 @@
set -e
build_directory="/build"
output_directory="$build_directory/out"
date="$(date '+%Y%m%d%H%M')"
function initializeSourceTree() {
manifest="$1"
@ -61,6 +64,20 @@ function cleanBuild() {
make clean
}
function createBuildBundle() {
device="$1"
device_output_directory="$output_directory/target/product/$device"
cd "$device_output_directory"
tar \
-C "$device_output_directory" \
-cvf "$output_directory/$device-replicant-$date.tar.xz" \
"boot.img" \
"system.img" \
"userdata.img" \
"recovery.img" \
replicant_*.root.zip
}
cd "$build_directory"
if [ $# -eq 0 ]; then
@ -108,6 +125,12 @@ else
cleanBuild
;;
-P | --package )
device="$2"
createBuildBundle "$device"
shift
;;
esac
shift
done