android-custom/common/addon_head

28 lines
929 B
Bash

#!/sbin/sh
#
# ADDOND_VERSION=3
#
# we partially use the script at install, if so, $SYSTEM, $PRODUCT, $SYSTEM_EXT are defined
if [ -z $SYSTEM ]; then
. /tmp/backuptool.functions
# build missing $PRODUCT and $SYSTEM_EXT from $S. Keep them inside system, real path is computed after using the get_output_path function
# see https://github.com/LineageOS/android_vendor_lineage/commit/c63fa8441bb5ad1fc4fb68155a5e5166aa25cac0#diff-9cf467ef8562a8e65ef885b33fe3f29cee408bb251fb05aed28661f08bfe0c64
SYS=$S
PRODUCT="$S/product"
SYSTEM_EXT="$S/system_ext"
else
# install in recovery, script assume $S and $SYS defined
S=$SYSTEM
SYS=$SYSTEM
# PRODUCT AND SYSTEM_EXT defined from recovery
get_output_path() {
# In recovery we mounted all partitions in the right place, so we can rely on symlinks
echo "$1"
}
fi
# path is needed when running from recovery (at install)
export PATH="${PATH}:$S/bin:$S/xbin"