Snap for 11822896 from 5ca6b7496d
to 24Q3-release
Change-Id: I87cf77594c3ef7d4e0ae1dfefb02dc23d6bcba5d
This commit is contained in:
commit
9dc2d05dc4
11 changed files with 17 additions and 264 deletions
|
@ -17,6 +17,8 @@
|
|||
# EdgeTPU runtime libraries
|
||||
/vendor/lib64/com\.google\.edgetpu_app_service-V[1-4]-ndk\.so u:object_r:same_process_hal_file:s0
|
||||
/vendor/lib64/com\.google\.edgetpu_vendor_service-V[1-2]-ndk\.so u:object_r:same_process_hal_file:s0
|
||||
# EdgeTPU Tachyon libraries
|
||||
/vendor/lib64/libedgetpu_tachyon\.google\.so u:object_r:same_process_hal_file:s0
|
||||
|
||||
# EdgeTPU data files
|
||||
/data/vendor/hal_neuralnetworks_darwinn(/.*)? u:object_r:hal_neuralnetworks_darwinn_data_file:s0
|
||||
|
@ -27,3 +29,6 @@
|
|||
|
||||
# Tachyon service
|
||||
/vendor/bin/hw/com\.google\.edgetpu.tachyon-service u:object_r:edgetpu_tachyon_server_exec:s0
|
||||
|
||||
# libfmq.so is dynamically loaded by the Tachyon client-side library libedgetpu_tachyon.google.so
|
||||
/vendor/lib64/libfmq\.so u:object_r:same_process_hal_file:s0
|
||||
|
|
|
@ -7,3 +7,6 @@ allow priv_app edgetpu_nnapi_service:service_manager find;
|
|||
# Allows privileged applications to access the EdgeTPU device, except open,
|
||||
# which is guarded by the EdgeTPU service.
|
||||
allow priv_app edgetpu_device:chr_file { getattr read write ioctl map };
|
||||
|
||||
# Allows EdgeTPU Tachyon service to call the app.
|
||||
binder_call(edgetpu_tachyon_server, priv_app);
|
||||
|
|
|
@ -5,3 +5,5 @@ allow untrusted_app_all edgetpu_app_service:service_manager find;
|
|||
# by the EdgeTPU service.
|
||||
allow untrusted_app_all edgetpu_device:chr_file { getattr read write ioctl map };
|
||||
|
||||
# Allows EdgeTPU Tachyon service to call the app.
|
||||
binder_call(edgetpu_tachyon_server, untrusted_app_all);
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
|
||||
soong_namespace {
|
||||
}
|
||||
|
||||
package {
|
||||
default_applicable_licenses: ["Android-Apache-2.0"],
|
||||
}
|
||||
|
||||
sh_binary {
|
||||
name: "insmod.sh",
|
||||
src: "insmod.sh",
|
||||
init_rc: ["init.module.rc"],
|
||||
vendor: true,
|
||||
}
|
|
@ -1,119 +0,0 @@
|
|||
#!/vendor/bin/sh
|
||||
|
||||
#############################################################
|
||||
### init.insmod.cfg format: ###
|
||||
### ----------------------------------------------------- ###
|
||||
### [insmod|setprop|enable/moprobe|wait] [path|prop name] ###
|
||||
### ... ###
|
||||
#############################################################
|
||||
|
||||
modules_dir=
|
||||
system_modules_dir=
|
||||
vendor_modules_dir=
|
||||
|
||||
|
||||
pagesize=$(getconf PAGESIZE)
|
||||
# bootoption=$(getprop ro.product.build.16k_page.enabled)
|
||||
# We do not need to check ro.product.build.16k_page.enabled , because this
|
||||
# version of insmod.sh will only be used if PRODUCT_16K_DEVELOPER_OPTION
|
||||
# is set to true
|
||||
|
||||
if [ "$pagesize" != "4096" ] ; then
|
||||
echo "Device has page size $pagesize , skip loading modules from vendor_dlkm/system_dlkm because all modules are stored on vendor_boot"
|
||||
setprop vendor.common.modules.ready 1
|
||||
setprop vendor.device.modules.ready 1
|
||||
setprop vendor.all.modules.ready 1
|
||||
setprop vendor.all.devices.ready 1
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
||||
for dir in system vendor; do
|
||||
for f in /${dir}/lib/modules/*/modules.dep /${dir}/lib/modules/modules.dep; do
|
||||
if [[ -f "$f" ]]; then
|
||||
if [[ "${dir}" == "system" ]]; then
|
||||
system_modules_dir="$(dirname "$f")"
|
||||
else
|
||||
vendor_modules_dir="$(dirname "$f")"
|
||||
modules_dir=${vendor_modules_dir}
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
if [[ -z "${system_modules_dir}" ]]; then
|
||||
echo "Unable to locate system kernel modules directory" 2>&1
|
||||
fi
|
||||
|
||||
if [[ -z "${vendor_modules_dir}" ]]; then
|
||||
echo "Unable to locate vendor kernel modules directory" 2>&1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# imitates wait_for_file() in init
|
||||
wait_for_file()
|
||||
{
|
||||
filename="${1}"
|
||||
timeout="${2:-5}"
|
||||
|
||||
expiry=$(($(date "+%s")+timeout))
|
||||
while [[ ! -e "${filename}" ]] && [[ "$(date "+%s")" -le "${expiry}" ]]
|
||||
do
|
||||
sleep 0.01
|
||||
done
|
||||
}
|
||||
|
||||
if [ $# -eq 1 ]; then
|
||||
cfg_file=$1
|
||||
else
|
||||
# Set property even if there is no insmod config
|
||||
# to unblock early-boot trigger
|
||||
setprop vendor.common.modules.ready 1
|
||||
setprop vendor.device.modules.ready 1
|
||||
setprop vendor.all.modules.ready 1
|
||||
setprop vendor.all.devices.ready 1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f $cfg_file ]; then
|
||||
while IFS="|" read -r action arg
|
||||
do
|
||||
case $action in
|
||||
"insmod") insmod $arg ;;
|
||||
"setprop") setprop $arg 1 ;;
|
||||
"enable") echo 1 > $arg ;;
|
||||
"condinsmod")
|
||||
prop=$(echo $arg | cut -d '|' -f 1)
|
||||
module1=$(echo $arg | cut -d '|' -f 2)
|
||||
module2=$(echo $arg | cut -d '|' -f 3)
|
||||
value=$(getprop $prop)
|
||||
if [[ ${value} == "true" ]]; then
|
||||
insmod ${vendor_modules_dir}/${module1}
|
||||
else
|
||||
insmod ${vendor_modules_dir}/${module2}
|
||||
fi
|
||||
;;
|
||||
"modprobe")
|
||||
case ${arg} in
|
||||
"system -b *" | "system -b")
|
||||
modules_dir=${system_modules_dir}
|
||||
arg="-b --all=${system_modules_dir}/modules.load" ;;
|
||||
"system *" | "system")
|
||||
modules_dir=${system_modules_dir}
|
||||
arg="--all=${system_modules_dir}/modules.load" ;;
|
||||
"-b *" | "-b" | "vendor -b *" | "vendor -b")
|
||||
modules_dir=${vendor_modules_dir}
|
||||
arg="-b --all=${vendor_modules_dir}/modules.load" ;;
|
||||
"*" | "" | "vendor *" | "vendor")
|
||||
modules_dir=${vendor_modules_dir}
|
||||
arg="--all=${vendor_modules_dir}/modules.load" ;;
|
||||
esac
|
||||
if [[ -d "${modules_dir}" ]]; then
|
||||
modprobe -a -d "${modules_dir}" $arg
|
||||
fi
|
||||
;;
|
||||
"wait") wait_for_file $arg ;;
|
||||
esac
|
||||
done < $cfg_file
|
||||
fi
|
|
@ -1,13 +0,0 @@
|
|||
|
||||
soong_namespace {
|
||||
}
|
||||
package {
|
||||
default_applicable_licenses: ["Android-Apache-2.0"],
|
||||
}
|
||||
|
||||
sh_binary {
|
||||
name: "insmod.sh",
|
||||
src: "insmod.sh",
|
||||
init_rc: ["init.module.rc"],
|
||||
vendor: true,
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
on init
|
||||
# Loading common kernel modules in background
|
||||
start insmod_sh
|
||||
|
||||
service insmod_sh /vendor/bin/insmod.sh /vendor/etc/init.common.cfg
|
||||
class main
|
||||
user root
|
||||
group root system
|
||||
disabled
|
||||
oneshot
|
|
@ -1,102 +0,0 @@
|
|||
#!/vendor/bin/sh
|
||||
|
||||
#############################################################
|
||||
### init.insmod.cfg format: ###
|
||||
### ----------------------------------------------------- ###
|
||||
### [insmod|setprop|enable/moprobe|wait] [path|prop name] ###
|
||||
### ... ###
|
||||
#############################################################
|
||||
|
||||
modules_dir=
|
||||
system_modules_dir=
|
||||
vendor_modules_dir=
|
||||
|
||||
for dir in system vendor; do
|
||||
for f in /${dir}/lib/modules/*/modules.dep /${dir}/lib/modules/modules.dep; do
|
||||
if [[ -f "$f" ]]; then
|
||||
if [[ "${dir}" == "system" ]]; then
|
||||
system_modules_dir="$(dirname "$f")"
|
||||
else
|
||||
vendor_modules_dir="$(dirname "$f")"
|
||||
modules_dir=${vendor_modules_dir}
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
if [[ -z "${system_modules_dir}" ]]; then
|
||||
echo "Unable to locate system kernel modules directory" 2>&1
|
||||
fi
|
||||
|
||||
if [[ -z "${vendor_modules_dir}" ]]; then
|
||||
echo "Unable to locate vendor kernel modules directory" 2>&1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# imitates wait_for_file() in init
|
||||
wait_for_file()
|
||||
{
|
||||
filename="${1}"
|
||||
timeout="${2:-5}"
|
||||
|
||||
expiry=$(($(date "+%s")+timeout))
|
||||
while [[ ! -e "${filename}" ]] && [[ "$(date "+%s")" -le "${expiry}" ]]
|
||||
do
|
||||
sleep 0.01
|
||||
done
|
||||
}
|
||||
|
||||
if [ $# -eq 1 ]; then
|
||||
cfg_file=$1
|
||||
else
|
||||
# Set property even if there is no insmod config
|
||||
# to unblock early-boot trigger
|
||||
setprop vendor.common.modules.ready
|
||||
setprop vendor.device.modules.ready
|
||||
setprop vendor.all.modules.ready
|
||||
setprop vendor.all.devices.ready
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f $cfg_file ]; then
|
||||
while IFS="|" read -r action arg
|
||||
do
|
||||
case $action in
|
||||
"insmod") insmod $arg ;;
|
||||
"setprop") setprop $arg 1 ;;
|
||||
"enable") echo 1 > $arg ;;
|
||||
"condinsmod")
|
||||
prop=$(echo $arg | cut -d '|' -f 1)
|
||||
module1=$(echo $arg | cut -d '|' -f 2)
|
||||
module2=$(echo $arg | cut -d '|' -f 3)
|
||||
value=$(getprop $prop)
|
||||
if [[ ${value} == "true" ]]; then
|
||||
insmod ${vendor_modules_dir}/${module1}
|
||||
else
|
||||
insmod ${vendor_modules_dir}/${module2}
|
||||
fi
|
||||
;;
|
||||
"modprobe")
|
||||
case ${arg} in
|
||||
"system -b *" | "system -b")
|
||||
modules_dir=${system_modules_dir}
|
||||
arg="-b --all=${system_modules_dir}/modules.load" ;;
|
||||
"system *" | "system")
|
||||
modules_dir=${system_modules_dir}
|
||||
arg="--all=${system_modules_dir}/modules.load" ;;
|
||||
"-b *" | "-b" | "vendor -b *" | "vendor -b")
|
||||
modules_dir=${vendor_modules_dir}
|
||||
arg="-b --all=${vendor_modules_dir}/modules.load" ;;
|
||||
"*" | "" | "vendor *" | "vendor")
|
||||
modules_dir=${vendor_modules_dir}
|
||||
arg="--all=${vendor_modules_dir}/modules.load" ;;
|
||||
esac
|
||||
if [[ -d "${modules_dir}" ]]; then
|
||||
modprobe -a -d "${modules_dir}" $arg
|
||||
fi
|
||||
;;
|
||||
"wait") wait_for_file $arg ;;
|
||||
esac
|
||||
done < $cfg_file
|
||||
fi
|
|
@ -2,6 +2,13 @@ package {
|
|||
default_applicable_licenses: ["Android-Apache-2.0"],
|
||||
}
|
||||
|
||||
sh_binary {
|
||||
name: "insmod.sh",
|
||||
src: "insmod.sh",
|
||||
init_rc: ["init.module.rc"],
|
||||
vendor: true,
|
||||
}
|
||||
|
||||
prebuilt_etc {
|
||||
name: "init.common.cfg",
|
||||
src: "init.common.cfg",
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
ifeq (true,$(PRODUCT_16K_DEVELOPER_OPTION))
|
||||
PRODUCT_SOONG_NAMESPACES += device/google/gs-common/insmod/16k
|
||||
else
|
||||
PRODUCT_SOONG_NAMESPACES += device/google/gs-common/insmod/4k
|
||||
endif
|
||||
|
||||
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/insmod/sepolicy
|
||||
PRODUCT_PACKAGES += \
|
||||
insmod.sh \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue