From 7edb656bf3fdfbde1efad853a42f00dc538e7813 Mon Sep 17 00:00:00 2001 From: Joey Huab Date: Fri, 5 Sep 2025 21:42:40 +0900 Subject: [PATCH] Revert "bootanimation: Convert to Android.bp" This reverts commit 3b29ed3826f9ec5c2d5fa3da45df5dc57ebf83fb. --- bootanimation/Android.bp | 61 ----------------------------- bootanimation/Android.mk | 63 ++++++++++++++++++++++++++++++ bootanimation/gen-bootanimation.sh | 56 -------------------------- config/BoardConfigSoong.mk | 10 ----- config/common.mk | 3 +- 5 files changed, 64 insertions(+), 129 deletions(-) delete mode 100644 bootanimation/Android.bp create mode 100644 bootanimation/Android.mk delete mode 100755 bootanimation/gen-bootanimation.sh diff --git a/bootanimation/Android.bp b/bootanimation/Android.bp deleted file mode 100644 index bcd8e3fa..00000000 --- a/bootanimation/Android.bp +++ /dev/null @@ -1,61 +0,0 @@ -// -// SPDX-FileCopyrightText: The LineageOS Project -// SPDX-License-Identifier: Apache-2.0 -// - -genrule { - name: "gen-bootanimation.zip", - tools: [ - "mogrify", - "soong_zip", - ], - tool_files: [ - "bootanimation.tar", - "desc.txt", - "gen-bootanimation.sh", - ], - out: ["bootanimation.zip"], - - cmd: select((soong_config_variable("lineage_bootanimation", "height"), - soong_config_variable("lineage_bootanimation", "width"), - soong_config_variable("lineage_bootanimation", "half_res"), - soong_config_variable("lineage_bootanimation", "prebuilt_file")), { - (any @ height, any @ width, any @ half_res, any @ prebuilt_file): - "cp ../../../../../" + prebuilt_file + " $(out)", - (any @ height, any @ width, any @ half_res, default): - "$(location gen-bootanimation.sh)" + - " $(out)" + - " $(genDir)" + - " $(location bootanimation.tar)" + - " $(location desc.txt)" + - " $(location mogrify)" + - " $(location soong_zip)" + - " " + height + - " " + width + - " " + half_res, - (default, default, default, default): - "$(location gen-bootanimation.sh)" + - " $(out)" + - " $(genDir)" + - " $(location bootanimation.tar)" + - " $(location desc.txt)" + - " $(location mogrify)" + - " $(location soong_zip)" + - " 600" + - " 600" + - " false", - }), -} - -prebuilt_media { - name: "bootanimation.zip", - src: ":gen-bootanimation.zip", - product_specific: true, -} - -install_symlink { - name: "bootanimation-dark.zip", - product_specific: true, - installed_location: "media/bootanimation-dark.zip", - symlink_target: "bootanimation.zip", -} diff --git a/bootanimation/Android.mk b/bootanimation/Android.mk new file mode 100644 index 00000000..97948f38 --- /dev/null +++ b/bootanimation/Android.mk @@ -0,0 +1,63 @@ +# +# Copyright (C) 2016 The CyanogenMod Project +# 2017-2024 The LineageOS Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +TARGET_GENERATED_BOOTANIMATION := $(TARGET_OUT_INTERMEDIATES)/BOOTANIMATION/bootanimation.zip +$(TARGET_GENERATED_BOOTANIMATION): INTERMEDIATES := $(call intermediates-dir-for,BOOTANIMATION,bootanimation) +$(TARGET_GENERATED_BOOTANIMATION): $(SOONG_ZIP) + @echo "Building bootanimation.zip" + @rm -rf $(dir $@) + @mkdir -p $(INTERMEDIATES) + $(hide) tar xfp vendor/lineage/bootanimation/bootanimation.tar -C $(INTERMEDIATES) + $(hide) if [ $(TARGET_SCREEN_HEIGHT) -lt $(TARGET_SCREEN_WIDTH) ]; then \ + IMAGEWIDTH=$(TARGET_SCREEN_HEIGHT); \ + else \ + IMAGEWIDTH=$(TARGET_SCREEN_WIDTH); \ + fi; \ + IMAGESCALEWIDTH=$$IMAGEWIDTH; \ + IMAGESCALEHEIGHT=$$(expr $$IMAGESCALEWIDTH / 3); \ + if [ "$(TARGET_BOOTANIMATION_HALF_RES)" = "true" ]; then \ + IMAGEWIDTH="$$(expr "$$IMAGEWIDTH" / 2)"; \ + fi; \ + IMAGEHEIGHT=$$(expr $$IMAGEWIDTH / 3); \ + RESOLUTION="$$IMAGEWIDTH"x"$$IMAGEHEIGHT"; \ + prebuilts/tools-lineage/${HOST_OS}-x86/bin/mogrify -resize $$RESOLUTION -colors 256 $(INTERMEDIATES)/*/*.png; \ + echo "$$IMAGESCALEWIDTH $$IMAGESCALEHEIGHT 60" > $(INTERMEDIATES)/desc.txt; \ + cat vendor/lineage/bootanimation/desc.txt >> $(INTERMEDIATES)/desc.txt + $(hide) $(SOONG_ZIP) -L 0 -o $@ -C $(INTERMEDIATES) -D $(INTERMEDIATES) + +ifeq ($(TARGET_BOOTANIMATION),) + TARGET_BOOTANIMATION := $(TARGET_GENERATED_BOOTANIMATION) +endif + +include $(CLEAR_VARS) +LOCAL_MODULE := bootanimation.zip +LOCAL_MODULE_CLASS := ETC +LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/media + +include $(BUILD_SYSTEM)/base_rules.mk + +$(LOCAL_BUILT_MODULE): $(TARGET_BOOTANIMATION) + @cp $(TARGET_BOOTANIMATION) $@ + +include $(CLEAR_VARS) + +BOOTANIMATION_SYMLINK := $(TARGET_OUT_PRODUCT)/media/bootanimation-dark.zip +$(BOOTANIMATION_SYMLINK): $(LOCAL_INSTALLED_MODULE) + @mkdir -p $(dir $@) + $(hide) ln -sf bootanimation.zip $@ + +ALL_DEFAULT_INSTALLED_MODULES += $(BOOTANIMATION_SYMLINK) diff --git a/bootanimation/gen-bootanimation.sh b/bootanimation/gen-bootanimation.sh deleted file mode 100755 index 8c2ba50e..00000000 --- a/bootanimation/gen-bootanimation.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -e -# -# Copyright (C) 2016 The CyanogenMod Project -# 2017-2024 The LineageOS Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -PARAM_OUT=$1 -PARAM_GENDIR=$2 -PARAM_BOOTANIMATION_TAR=$3 -PARAM_DESC_TXT=$4 -PARAM_MOGRIFY=$5 -PARAM_SOONG_ZIP=$6 -PARAM_TARGET_SCREEN_HEIGHT=$7 -PARAM_TARGET_SCREEN_WIDTH=$8 -PARAM_TARGET_BOOTANIMATION_HALF_RES=$9 - -INTERMEDIATES=$PARAM_GENDIR/intermediates - -mkdir -p $INTERMEDIATES - -tar xfp $PARAM_BOOTANIMATION_TAR -C $INTERMEDIATES - -if [ $PARAM_TARGET_SCREEN_HEIGHT -lt $PARAM_TARGET_SCREEN_WIDTH ]; then - IMAGEWIDTH=$PARAM_TARGET_SCREEN_HEIGHT -else - IMAGEWIDTH=$PARAM_TARGET_SCREEN_WIDTH -fi - -IMAGESCALEWIDTH=$IMAGEWIDTH -IMAGESCALEHEIGHT=$(expr $IMAGESCALEWIDTH / 3); - -if [ "$PARAM_TARGET_BOOTANIMATION_HALF_RES" = "true" ]; then - IMAGEWIDTH="$(expr "$IMAGEWIDTH" / 2)" -fi - -IMAGEHEIGHT=$(expr $IMAGEWIDTH / 3); -RESOLUTION="$IMAGEWIDTH"x"$IMAGEHEIGHT"; - -$PARAM_MOGRIFY -resize $RESOLUTION -colors 256 $INTERMEDIATES/*/*.png; - -echo "$IMAGESCALEWIDTH $IMAGESCALEHEIGHT 60" > $INTERMEDIATES/desc.txt; -cat $PARAM_DESC_TXT >> $INTERMEDIATES/desc.txt - -$PARAM_SOONG_ZIP -L 0 -o $PARAM_OUT -C $INTERMEDIATES -D $INTERMEDIATES diff --git a/config/BoardConfigSoong.mk b/config/BoardConfigSoong.mk index c24905f5..b588fe7e 100644 --- a/config/BoardConfigSoong.mk +++ b/config/BoardConfigSoong.mk @@ -21,16 +21,6 @@ EXPORT_TO_SOONG := \ $(call add_soong_config_namespace,lineageVarsPlugin) $(foreach v,$(EXPORT_TO_SOONG),$(eval $(call add_soong_config_var,lineageVarsPlugin,$(v)))) -# Bootanimation -TARGET_BOOTANIMATION_HALF_RES ?= false -$(call soong_config_set,lineage_bootanimation,height,$(TARGET_SCREEN_HEIGHT)) -$(call soong_config_set,lineage_bootanimation,width,$(TARGET_SCREEN_WIDTH)) -$(call soong_config_set,lineage_bootanimation,half_res,$(TARGET_BOOTANIMATION_HALF_RES)) - -ifneq ($(TARGET_BOOTANIMATION),) -$(call soong_config_set,lineage_bootanimation,prebuilt_file,$(TARGET_BOOTANIMATION)) -endif - # Camera ifneq ($(TARGET_CAMERA_OVERRIDE_FORMAT_FROM_RESERVED),) $(error TARGET_CAMERA_OVERRIDE_FORMAT_FROM_RESERVED is deprecated, please migrate to soong_config_set,camera,override_format_from_reserved) diff --git a/config/common.mk b/config/common.mk index 1e4a825f..a58e0dc2 100644 --- a/config/common.mk +++ b/config/common.mk @@ -131,8 +131,7 @@ endif TARGET_SCREEN_WIDTH ?= 1080 TARGET_SCREEN_HEIGHT ?= 1920 PRODUCT_PACKAGES += \ - bootanimation.zip \ - bootanimation-dark.zip + bootanimation.zip # Lineage interfaces PRODUCT_PACKAGES += \