general: simplifications; fixes
Oops Bugfix in LOS script More bugfixes
This commit is contained in:
+18
-19
@@ -11,11 +11,10 @@ readonly MANIFEST_LOCAL="local_manifests/rubenslte.xml"
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
usage: $0 [-hn] [bootimage|bacon|clean|prune]
|
||||
usage: $0 [-h] [bootimage|bacon|clean|prune]
|
||||
|
||||
flags:
|
||||
-h show this help
|
||||
-n build only, skip repo sync and tree updates
|
||||
|
||||
commands:
|
||||
bootimage build boot.img (kernel + dt.img + ramdisk, fast gate)
|
||||
@@ -29,7 +28,7 @@ append_seandroidenforce() {
|
||||
local img="$1"
|
||||
|
||||
[ -f "$img" ] || return
|
||||
[ tail -c 16 "$img" | grep -q "SEANDROIDNEFORCE" ] || \
|
||||
tail -c 16 "$img" | grep -q "SEANDROIDNEFORCE" || \
|
||||
printf 'SEANDROIDENFORCE' >> "$img"
|
||||
}
|
||||
|
||||
@@ -37,28 +36,27 @@ do_build() {
|
||||
mkdir -p los-build
|
||||
cd los-build
|
||||
|
||||
echo "[$0] Setting up or syncing repositories"
|
||||
|
||||
if [ ! -d .repo ]; then
|
||||
rlte_print "Setting up repo"
|
||||
repo init --depth 1 -u "$MANIFEST_URL" -b "$MANIFEST_BRANCH"
|
||||
fi
|
||||
|
||||
if [ ! -v "NO_SYNC" ]; then
|
||||
mkdir -p .repo/local_manifests
|
||||
cp "$ROOT/$MANIFEST_LOCAL" .repo/local_manifests/
|
||||
repo sync -c -j"$(nproc)"
|
||||
apply_patches "$ROOT/patches/kernel"
|
||||
apply_patches "$ROOT/patches/los"
|
||||
fi
|
||||
|
||||
rlte_print "Syncing repositories"
|
||||
repo sync -c -j"$(nproc)"
|
||||
rlte_print "Applying patches"
|
||||
apply_patches "$ROOT/patches/kernel"
|
||||
apply_patches "$ROOT/patches/los"
|
||||
|
||||
export LC_ALL=C LANG=C USE_CCACHE=1 CCACHE_DIR="$ROOT/.ccache" \
|
||||
JACK_SERVER=false JACK_NO_SERVER=1 \
|
||||
JACK_REPOSITORY="$ROOT/.jack-repository" TOP="$PWD" \
|
||||
ANDROID_BUILD_TOP="$TOP"
|
||||
ANDROID_BUILD_TOP="$PWD"
|
||||
|
||||
mkdir -p "$ROOT/.jack-repository"
|
||||
cp -n "$PWD/prebuilts/sdk/tools/jacks/jack-*.jar" "$ROOT/.jack-repository"
|
||||
cp -n "$PWD/prebuilts/sdk/tools/jacks/jill-*.jar" "$ROOT/.jack-repository"
|
||||
cp -n "$TOP"/prebuilts/sdk/tools/jacks/jack-*.jar "$ROOT/.jack-repository"
|
||||
cp -n "$TOP"/prebuilts/sdk/tools/jills/jill-*.jar "$ROOT/.jack-repository"
|
||||
|
||||
set +eu
|
||||
source build/envsetup.sh
|
||||
@@ -66,23 +64,24 @@ do_build() {
|
||||
set -e
|
||||
|
||||
if [ -z "${TARGET_PRODUCT:-}" ]; then
|
||||
echo "[$0] ERROR: lunch failed - TARGET_PRODUCT not set"
|
||||
rlte_error "lunch failed - TARGET_PRODUCT not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[$0] Commencing build (command: $CMD)"
|
||||
rlte_print "Commencing build (command: $CMD)"
|
||||
mka "$CMD"
|
||||
|
||||
if [ "$CMD" != "clean" ]; then
|
||||
echo "[$0] Appending SEANDROIDENFORCE"
|
||||
rlte_print "Appending SEANDROIDENFORCE"
|
||||
append_seandroidenforce "$ROOT/los-build/out/target/product/rubenslte/boot.img"
|
||||
fi
|
||||
|
||||
rlte_ok "Done."
|
||||
}
|
||||
|
||||
while getopts ":hn" opt; do
|
||||
while getopts ":h" opt; do
|
||||
case "$opt" in
|
||||
h) usage; exit 0 ;;
|
||||
n) NO_SYNC=1 ;;
|
||||
*) usage; exit 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
+15
-19
@@ -13,11 +13,10 @@ readonly RECOVERY_BUDGET=10485248
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
usage: $0 [-hn] [build|clean|prune]
|
||||
usage: $0 [-h] [build|clean|prune]
|
||||
|
||||
flags:
|
||||
-h show this help
|
||||
-n build only, skip repo sync and tree updates
|
||||
|
||||
commands:
|
||||
build build recovery.img (must be explicit)
|
||||
@@ -30,50 +29,47 @@ do_build() {
|
||||
mkdir -p twrp-build
|
||||
cd twrp-build
|
||||
|
||||
echo "[$0] Setting up or syncing repositories"
|
||||
|
||||
if [ ! -d .repo ]; then
|
||||
rlte_print "Setting up repo"
|
||||
repo init --depth 1 -u "$MANIFEST_URL" -b "$MANIFEST_BRANCH"
|
||||
mkdir -p .repo/local_manifests
|
||||
cp "$ROOT/$MANIFEST_LOCAL" .repo/local_manifests/
|
||||
fi
|
||||
|
||||
if [ ! -v "NO_SYNC" ]; then
|
||||
mkdir -p .repo/local_manifests
|
||||
cp "$ROOT/$MANIFEST_LOCAL" .repo/local_manifests/
|
||||
repo sync -c -j"$(nproc)"
|
||||
apply_patches "$ROOT/patches/twrp"
|
||||
apply_patches "$ROOT/patches/kernel"
|
||||
fi
|
||||
rlte_print "Syncing repositories"
|
||||
repo sync -c -j"$(nproc)"
|
||||
rlte_print "Applying patches"
|
||||
apply_patches "$ROOT/patches/twrp"
|
||||
apply_patches "$ROOT/patches/kernel"
|
||||
|
||||
export LC_ALL=C LANG=C LC_CTYPE=C \
|
||||
PATH="$PWD/$TOOLCHAIN_DIR/bin:$PATH" TOP="$PWD"
|
||||
export LC_ALL=C LANG=C LC_CTYPE=C TOP="$PWD"
|
||||
|
||||
set +u
|
||||
source build/envsetup.sh
|
||||
lunch omni_rubenslte-userdebug
|
||||
set -u
|
||||
|
||||
echo "[$0] Commencing TWRP build"
|
||||
rlte_print "Commencing TWRP build"
|
||||
mka recoveryimage
|
||||
|
||||
if [ ! -f out/target/product/rubenslte/recovery.img ]; then
|
||||
echo "[$0] ERROR: Build did not produce recovery.img"
|
||||
rlte_error "Build did not produce recovery.img"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cp out/target/product/rubenslte/recovery.img "$ROOT/recovery.img"
|
||||
|
||||
if [ "$(stat -c%s "$ROOT/recovery.img")" -gt "$RECOVERY_BUDGET" ]; then
|
||||
echo "[$0] ERROR: $ROOT/recovery.img exceeds the recovery partition budget"
|
||||
rlte_error "$ROOT/recovery.img exceeds the recovery partition budget"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[$0] Done: $ROOT/recovery.img"
|
||||
rlte_ok "Image at: $ROOT/recovery.img"
|
||||
}
|
||||
|
||||
while getopts ":hn" opt; do
|
||||
while getopts ":h" opt; do
|
||||
case "$opt" in
|
||||
h) usage; exit 0 ;;
|
||||
n) NO_SYNC=1 ;;
|
||||
*) usage; exit 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
rlte_print() { printf '\033[34m[%s] %s\033[0m\n' "$0" "$*" ; }
|
||||
rlte_error() { printf '\033[31m[%s] error: %s\033[0m\n' "$0" "$*" >&2 ; exit 1; }
|
||||
rlte_ok() { printf '\033[32m[%s] ok: %s\033[0m\n' "$0" "$*" ; exit 0; }
|
||||
|
||||
apply_patches() {
|
||||
local dir="$1"
|
||||
for p in "$dir"/*.patch; do
|
||||
[ -e "$p" ] || continue
|
||||
patch -p1 --forward --batch --dry-run >/dev/null || continue
|
||||
patch -p1 --forward --batch --dry-run < "$p" || continue
|
||||
patch -p1 --batch < "$p"
|
||||
done
|
||||
}
|
||||
|
||||
@@ -12,4 +12,4 @@ index 2a48022c..51531eab 100755
|
||||
+HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC) -fcommon
|
||||
|
||||
# dependencies on generated files need to be listed explicitly
|
||||
$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
|
||||
$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
|
||||
|
||||
@@ -12,4 +12,4 @@ index dc2b714..984bbbf 100644
|
||||
+ $(cmsdk_LOCAL_JAVA_LIBRARIES)
|
||||
|
||||
# SDK version as defined
|
||||
cmplat_docs_SDK_VERSION := 14.0
|
||||
cmplat_docs_SDK_VERSION := 14.0
|
||||
|
||||
Reference in New Issue
Block a user