Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ale5000-git committed Aug 4, 2023
1 parent ae2f8fb commit 58319ff
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
27 changes: 27 additions & 0 deletions zip-content/inc/common-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,29 @@ _detect_architectures()
export ARCH_X64 ARCH_X86 ARCH_ARM64 ARCH_ARM ARCH_LEGACY_ARM
}

_detect_main_architectures()
{
CPU64='false'
CPU='false'

if test "${ARCH_X64:?}" = 'true'; then
CPU64='x86_64'
elif test "${ARCH_ARM64:?}" = 'true'; then
CPU64='arm64-v8a'
fi

if test "${ARCH_X86:?}" = 'true'; then
CPU='x86'
elif test "${ARCH_ARM:?}" = 'true'; then
CPU='armeabi-v7a'
elif test "${ARCH_LEGACY_ARM:?}" = 'true'; then
CPU='armeabi'
fi

readonly CPU64 CPU
export CPU64 CPU
}

_generate_architectures_list()
{
ARCH_LIST=''
Expand All @@ -432,6 +455,7 @@ _generate_architectures_list()
if test "${ARCH_LEGACY_ARM:?}" = 'true'; then
ARCH_LIST="${ARCH_LIST?}armeabi,"
fi
ARCH_LIST="${ARCH_LIST%,}"

readonly ARCH_LIST
export ARCH_LIST
Expand All @@ -453,6 +477,8 @@ display_info()
ui_msg "Recovery API ver: ${RECOVERY_API_VER:-}"
ui_msg_empty_line
ui_msg "Android API: ${API:?}"
ui_msg "64-bit CPU arch: ${CPU64:?}"
ui_msg "32-bit CPU arch: ${CPU:?}"
ui_msg "CPU arch list: ${ARCH_LIST?}"
}

Expand Down Expand Up @@ -640,6 +666,7 @@ initialize()
export ABI_LIST

_detect_architectures
_detect_main_architectures
_generate_architectures_list

unset LAST_MOUNTPOINT
Expand Down
18 changes: 0 additions & 18 deletions zip-content/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ unset CDPATH

TMP_PATH="${2:?}"

CPU=false
CPU64=false
LEGACY_ARM=false
FAKE_SIGN=false

Expand Down Expand Up @@ -62,24 +60,8 @@ else
ui_error 'Invalid API level'
fi

if is_substring ',x86,' "${ABI_LIST}"; then
CPU='x86'
elif is_substring ',armeabi-v7a,' "${ABI_LIST}"; then
CPU='armeabi-v7a'
elif is_substring ',armeabi,' "${ABI_LIST}"; then
CPU='armeabi'
fi

if is_substring ',x86_64,' "${ABI_LIST}"; then
CPU64='x86_64'
elif is_substring ',arm64-v8a,' "${ABI_LIST}"; then
CPU64='arm64-v8a'
fi

# Display info
display_info
ui_msg "Main 64-bit CPU arch: ${CPU64:?}"
ui_msg "Main 32-bit CPU arch: ${CPU:?}"
ui_msg_empty_line
ui_msg "Verity mode: ${VERITY_MODE:-disabled}"
ui_msg "Dynamic partitions: ${DYNAMIC_PARTITIONS:?}"
Expand Down

0 comments on commit 58319ff

Please sign in to comment.