|
|
@ -1,18 +1,16 @@ |
|
|
|
#!/bin/bash |
|
|
|
#!/bin/bash |
|
|
|
# |
|
|
|
# |
|
|
|
# Copyright (C) 2018-2020 The LineageOS Project |
|
|
|
# Copyright (C) 2016 The CyanogenMod Project |
|
|
|
|
|
|
|
# Copyright (C) 2017-2020 The LineageOS Project |
|
|
|
# |
|
|
|
# |
|
|
|
# SPDX-License-Identifier: Apache-2.0 |
|
|
|
# SPDX-License-Identifier: Apache-2.0 |
|
|
|
# |
|
|
|
# |
|
|
|
|
|
|
|
|
|
|
|
set -e |
|
|
|
set -e |
|
|
|
|
|
|
|
|
|
|
|
DEVICE_COMMON=sm7125-common |
|
|
|
# Load extract_utils and do some sanity checks |
|
|
|
VENDOR=samsung |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Load extractutils and do some sanity checks |
|
|
|
|
|
|
|
MY_DIR="${BASH_SOURCE%/*}" |
|
|
|
MY_DIR="${BASH_SOURCE%/*}" |
|
|
|
if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi |
|
|
|
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi |
|
|
|
|
|
|
|
|
|
|
|
ANDROID_ROOT="${MY_DIR}/../../.." |
|
|
|
ANDROID_ROOT="${MY_DIR}/../../.." |
|
|
|
|
|
|
|
|
|
|
@ -26,11 +24,19 @@ source "${HELPER}" |
|
|
|
# Default to sanitizing the vendor folder before extraction |
|
|
|
# Default to sanitizing the vendor folder before extraction |
|
|
|
CLEAN_VENDOR=true |
|
|
|
CLEAN_VENDOR=true |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ONLY_COMMON= |
|
|
|
|
|
|
|
ONLY_TARGET= |
|
|
|
KANG= |
|
|
|
KANG= |
|
|
|
SECTION= |
|
|
|
SECTION= |
|
|
|
|
|
|
|
|
|
|
|
while [ "${#}" -gt 0 ]; do |
|
|
|
while [ "${#}" -gt 0 ]; do |
|
|
|
case "${1}" in |
|
|
|
case "${1}" in |
|
|
|
|
|
|
|
--only-common ) |
|
|
|
|
|
|
|
ONLY_COMMON=true |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
--only-target ) |
|
|
|
|
|
|
|
ONLY_TARGET=true |
|
|
|
|
|
|
|
;; |
|
|
|
-n | --no-cleanup ) |
|
|
|
-n | --no-cleanup ) |
|
|
|
CLEAN_VENDOR=false |
|
|
|
CLEAN_VENDOR=false |
|
|
|
;; |
|
|
|
;; |
|
|
@ -52,14 +58,6 @@ if [ -z "${SRC}" ]; then |
|
|
|
SRC="adb" |
|
|
|
SRC="adb" |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# Initialize the helper |
|
|
|
|
|
|
|
setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true "${CLEAN_VENDOR}" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Fix proprietary blobs |
|
|
|
|
|
|
|
BLOB_ROOT="$ANDROID_ROOT"/vendor/"$VENDOR"/"$DEVICE_COMMON"/proprietary |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function blob_fixup() { |
|
|
|
function blob_fixup() { |
|
|
|
case "${1}" in |
|
|
|
case "${1}" in |
|
|
|
vendor/lib64/libsec-ril.so) |
|
|
|
vendor/lib64/libsec-ril.so) |
|
|
@ -75,4 +73,19 @@ function blob_fixup() { |
|
|
|
esac |
|
|
|
esac |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ -z "${ONLY_TARGET}" ]; then |
|
|
|
|
|
|
|
# Initialize the helper for common device |
|
|
|
|
|
|
|
setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true "${CLEAN_VENDOR}" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ -z "${ONLY_COMMON}" ] && [ -s "${MY_DIR}/../${DEVICE}/proprietary-files.txt" ]; then |
|
|
|
|
|
|
|
# Reinitialize the helper for device |
|
|
|
|
|
|
|
source "${MY_DIR}/../${DEVICE}/extract-files.sh" |
|
|
|
|
|
|
|
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extract "${MY_DIR}/../${DEVICE}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
"${MY_DIR}/setup-makefiles.sh" |
|
|
|
"${MY_DIR}/setup-makefiles.sh" |
|
|
|