Skip to content

Commit

Permalink
Split build scripts to support standard and slow-gpu variants
Browse files Browse the repository at this point in the history
Usually we do not change the framework, but recent Android-12 UI changes
made some of the devices unusable. Let's patch AOSP for such devices
and ship releases patched to give our users better use experience.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Change-Id: I907a825e38122779279b7b6a6be4457c63badf9d
  • Loading branch information
rsglobal committed Jun 13, 2022
1 parent c538a6e commit 5ef7848
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
31 changes: 23 additions & 8 deletions .ci/Makefile
Expand Up @@ -2,19 +2,19 @@ SHELL = bash

VARIANT := userdebug

TARGETS := \
pinephonepro\
TARGETS_STANDARD += \
pinephonepro \
opi4 \
rpi4 \

TARGETS_SLOWGPU := \
opi3 \
pinephone \
pinetab \
opi3 \
opi4 \
rpi4 \
opi_win \
opi_pc2 \
opi_prime \
opi_pc \

TARGETS += \
opi_plus2 \
opi_plus2e \

Expand Down Expand Up @@ -52,6 +52,21 @@ $(AOSP_PATH)/out_images/gd-$$(VER)-$1-$2.tar.gz: $(AOSP_PATH)/out_images/gd-$$(V

endef

TARGETS := $(TARGETS_STANDARD) $(TARGETS_SLOWGPU)
$(foreach target,$(TARGETS),$(eval $(call process-target,$(target),$(VARIANT))))

build_all: $(foreach target,$(TARGETS),$(AOSP_PATH)/out_images/gd-$(VER)-$(target)-$(VARIANT).tar.gz ) ## Build all GloDroid targets, put images into <AOSP tree>/out_images/...
build_standard: $(foreach target,$(TARGETS_STANDARD),$(AOSP_PATH)/out_images/gd-$(VER)-$(target)-$(VARIANT).tar.gz ) ## Build all standard GloDroid targets, put images into <AOSP tree>/out_images/...

build_slowgpu: $(foreach target,$(TARGETS_SLOWGPU),$(AOSP_PATH)/out_images/gd-$(VER)-$(target)-$(VARIANT).tar.gz ) ## Build all slow-gpu GloDroid targets, put images into <AOSP tree>/out_images/...

patch_slowgpu: ## Patch the framework to reduce load on slow GPU
cd $(AOSP_PATH)/frameworks/base
git fetch https://android.googlesource.com/platform/frameworks/base refs/changes/33/2121633/1 && git cherry-pick FETCH_HEAD --allow-empty --keep-redundant-commits
git fetch https://android.googlesource.com/platform/frameworks/base refs/changes/52/2123752/1 && git cherry-pick FETCH_HEAD --allow-empty --keep-redundant-commits
cd $(AOSP_PATH)/frameworks/native
git fetch https://android.googlesource.com/platform/frameworks/native refs/changes/73/2123073/1 && git cherry-pick FETCH_HEAD --allow-empty --keep-redundant-commits

unpatch_slowgpu: ## Restore the framework code after the patching
cd $(AOSP_PATH)
repo sync -l frameworks/base
repo sync -l frameworks/native
2 changes: 2 additions & 0 deletions .docker/Dockerfile
Expand Up @@ -59,4 +59,6 @@ USER ${RUN_USER}
# Install repo
RUN wget -P ${USER_HOME}/bin http://commondatastorage.googleapis.com/git-repo-downloads/repo && chmod a+x ${USER_HOME}/bin/repo

RUN git config --global user.name "FIRST_NAME LAST_NAME" && git config --global user.email "MY_NAME@example.com"

CMD [ "/bin/bash" ]
5 changes: 4 additions & 1 deletion .docker/Makefile
Expand Up @@ -37,4 +37,7 @@ build_all: ## Build all targets within a container (for CI purposes)
make clean
make build
make run `cd ../../.. && pwd`
$(docker_bin) exec -it $(image_name) bash -c "cd .repo/manifests/.ci && make build_all"
$(docker_bin) exec -it $(image_name) bash -c "cd .repo/manifests/.ci && make unpatch_slowgpu"
$(docker_bin) exec -it $(image_name) bash -c "cd .repo/manifests/.ci && make build_standard"
$(docker_bin) exec -it $(image_name) bash -c "cd .repo/manifests/.ci && make patch_slowgpu"
$(docker_bin) exec -it $(image_name) bash -c "cd .repo/manifests/.ci && make build_slowgpu"

0 comments on commit 5ef7848

Please sign in to comment.