husky: Regenerate vendor tree

Signed-off-by: HeroBuxx <me@herobuxx.me>
This commit is contained in:
HeroBuxx
2026-07-09 06:42:25 +00:00
commit aad3a7909f
2855 changed files with 217855 additions and 0 deletions
Vendored Executable
BIN
View File
Binary file not shown.
Vendored Executable
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Vendored Executable
BIN
View File
Binary file not shown.
+39
View File
@@ -0,0 +1,39 @@
#!/vendor/bin/sh
CHECKPOINT_DIR=/data/vendor/copied
export BIN_DIR=/vendor/bin
$BIN_DIR/mkdir -p $CHECKPOINT_DIR
function copy_files_to_data()
{
block_device=$1
partition_name=$(basename $1)
mount_point=$2
tmpdir=$CHECKPOINT_DIR/$partition_name.img
build_checkpoint=$CHECKPOINT_DIR/$partition_name
if [ ! -e $build_checkpoint ]; then
$BIN_DIR/rm -rf $tmpdir
$BIN_DIR/mkdir -p $tmpdir
$BIN_DIR/dump.f2fs -rfPLo $tmpdir $block_device
if [ $? -ne 0 ]; then
echo "Failed to $BIN_DIR/dump.f2fs -rfPLo $tmpdir $block_device"
return
fi
$BIN_DIR/mv $tmpdir $build_checkpoint
if [ $? -ne 0 ]; then
echo "mv $tmpdir $build_checkpoint"
return
fi
$BIN_DIR/fsync `dirname $build_checkpoint`
fi
echo "Successfully copied $mount_point to $build_checkpoint"
}
copy_files_to_data "/dev/block/by-name/efs" "/mnt/vendor/efs"
copy_files_to_data "/dev/block/by-name/efs_backup" "/mnt/vendor/efs_backup"
copy_files_to_data "/dev/block/by-name/modem_userdata" "/mnt/vendor/modem_userdata"
copy_files_to_data "/dev/block/by-name/persist" "/mnt/vendor/persist"
$BIN_DIR/fsync /data/vendor/copied
Vendored Executable
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+7
View File
@@ -0,0 +1,7 @@
#!/vendor/bin/sh
echo "Citadel VERSION\n"
vendor/bin/hw/citadel_updater -lv
echo "Citadel STATS\n"
vendor/bin/hw/citadel_updater --stats
echo "GSC DEBUG DUMP\n"
vendor/bin/hw/citadel_updater -D
BIN
View File
Binary file not shown.
+11
View File
@@ -0,0 +1,11 @@
#!/vendor/bin/sh
echo "--- pcie0 dump ---"
cat /dev/logbuffer_pcie0
echo "--- pcie1 dump ---"
cat /dev/logbuffer_pcie1
echo "--- pcie link statistics ---"
for f in /sys/devices/platform/*.pcie/link_stats/*
do
echo "$f: `cat $f`"
done
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+48
View File
@@ -0,0 +1,48 @@
#!/vendor/bin/sh
echo 'Temperatures'
for f in /sys/class/thermal/thermal* ; do
echo `cat $f/type`: `cat $f/temp`
done
echo 'Cooling Device Current State'
for f in /sys/class/thermal/cooling* ; do
echo `cat $f/type`: `cat $f/cur_state`
done
echo 'Cooling Device User Vote State'
for f in /sys/class/thermal/cooling* ; do
if ! [ -r $f/user_vote ]; then continue; fi;
echo `cat $f/type`: `cat $f/user_vote`
done
echo 'Cooling Device Time in State'
for f in /sys/class/thermal/cooling* ; do
echo `cat $f/type`: `cat $f/stats/time_in_state_ms`
done
echo 'Cooling Device Trans Table'
for f in /sys/class/thermal/cooling* ; do
echo `cat $f/type`: `cat $f/stats/trans_table`
done
echo 'Cooling Device State2Power Table'
for f in /sys/class/thermal/cooling* ; do
if ! [ -r $f/state2power_table ]; then continue; fi;
echo `cat $f/type`: `cat $f/state2power_table`
done
echo 'TMU state:'
cat /sys/module/gs_thermal/parameters/tmu_reg_dump_state
echo 'TMU intpend:'
cat /sys/module/gs_thermal/parameters/tmu_reg_dump_intpend
echo 'TMU current temperature:'
cat /sys/module/gs_thermal/parameters/tmu_reg_dump_current_temp
echo 'TMU_TOP rise thresholds:'
cat /sys/module/gs_thermal/parameters/tmu_top_reg_dump_rise_thres
echo 'TMU_TOP fall thresholds:'
cat /sys/module/gs_thermal/parameters/tmu_top_reg_dump_fall_thres
echo 'TMU_SUB rise thresholds:'
cat /sys/module/gs_thermal/parameters/tmu_sub_reg_dump_rise_thres
echo 'TMU_SUB fall thresholds:'
cat /sys/module/gs_thermal/parameters/tmu_sub_reg_dump_fall_thres
+30
View File
@@ -0,0 +1,30 @@
#!/vendor/bin/sh
DIR=/data/vendor/dump_touch
LOCKFILE="$DIR"/dumping
LOGFILE="$DIR"/dump.log
if [ ! -f $LOCKFILE ] || [ ! -f $LOGFILE ] || [ "$(cat $LOCKFILE)" = 0 ]
then
echo "-----------------------------------------------------"
echo "Info : Touch debug data not found! Backfilling..."
echo "-----------------------------------------------------"
/vendor/bin/predump_touch.sh > /dev/null 2>&1
fi
state=$(cat $LOCKFILE)
if [ "$state" != 2 ]
then
echo "Unexpected state! Expected 2 but found ${state}"
fi
if [ -f $LOGFILE ]
then
cat $LOGFILE
echo "" > $LOGFILE
fi
if [ -f $LOCKFILE ]
then
echo 0 > $LOCKFILE
fi
+3
View File
@@ -0,0 +1,3 @@
#!/vendor/bin/sh
echo "--- Trusty TEE0 Logs ---"
cat /dev/trusty-log0
BIN
View File
Binary file not shown.
+3
View File
@@ -0,0 +1,3 @@
#!/vendor/bin/sh
echo "--- wlan WIP ---"
+69
View File
@@ -0,0 +1,69 @@
#!/vendor/bin/sh
path="/sys/devices/virtual/goog_touch_interface/gti.0"
procfs_path="/proc/goog_touch_interface/gti.0"
if [[ -d "$procfs_path" ]]; then
heatmap_path=$procfs_path
else
heatmap_path=$path
fi
if [[ -f "${procfs_path}/dump" ]]; then
echo "------ Dump ------"
cat ${procfs_path}/dump
fi
echo "------ Force Touch Active ------"
result=$( cat "$path/force_active" 2>&1 )
if [ $? -eq 0 ]; then
state=$( echo "$result" |cut -d " " -f 2 )
if [ "$state" = "locked" ]; then
echo "The force_active is already locked!"
else
echo 1 > $path/force_active
if [ $? -ne 0 ]; then
echo "Failed to active touch device"
exit 1
fi
fi
else
if [[ $result == *Operation\ not\ supported* ]]; then
echo "force_active is not support, skip it"
else
echo "Failed to read the state of force_force"
exit 1
fi
fi
echo "------ Touch Firmware Version ------"
cat $path/fw_ver
echo "------ Panel ID ------"
cat $path/panel_id
echo "------ Offload ID ------"
cat $path/offload_id
echo "------ Get Mutual Sensing Data - Baseline ------"
cat $heatmap_path/ms_base
echo "------ Get Mutual Sensing Data - Delta ------"
cat $heatmap_path/ms_diff
echo "------ Get Mutual Sensing Data - Raw ------"
cat $heatmap_path/ms_raw
echo "------ Get Self Sensing Data - Baseline ------"
cat $heatmap_path/ss_base
echo "------ Get Self Sensing Data - Delta ------"
cat $heatmap_path/ss_diff
echo "------ Get Self Sensing Data - Raw ------"
cat $heatmap_path/ss_raw
echo "------ Self Test ------"
cat $path/self_test
echo "------ Disable Force Touch Active ------"
echo 0 > $path/force_active
+67
View File
@@ -0,0 +1,67 @@
#!/vendor/bin/sh
spi=`getprop ro.vendor.touch.dump.sys`
proc=`getprop ro.vendor.touch.dump.proc`
echo "------ Force Set AP as Bus Owner with Bugreport Flag ------"
echo A0 01 01 > $proc
echo "------ STM touch firmware version ------"
cat $spi/appid
echo "------ STM touch status ------"
cat $spi/status
echo "------ Mutual Raw ------"
echo 13 00 01 > $spi/stm_fts_cmd && cat $spi/stm_fts_cmd
echo "------ Mutual Strength ------"
echo 17 01 > $spi/stm_fts_cmd && cat $spi/stm_fts_cmd
echo "------ Self Raw ------"
echo 15 00 01 > $spi/stm_fts_cmd && cat $spi/stm_fts_cmd
echo "------ Mutual Raw Data ------"
echo 23 00 > $proc && cat $proc
echo "------ Mutual Baseline Data ------"
echo 23 03 > $proc && cat $proc
echo "------ Mutual Strength Data ------"
echo 23 02 > $proc && cat $proc
echo "------ Self Raw Data ------"
echo 24 00 > $proc && cat $proc
echo "------ Self Baseline Data ------"
echo 24 03 > $proc && cat $proc
echo "------ Self Strength Data ------"
echo 24 02 > $proc && cat $proc
echo "------ Mutual Compensation ------"
echo 32 10 > $proc && cat $proc
echo "------ Mutual Low Power Compensation ------"
echo 32 11 > $proc && cat $proc
echo "------ Self Compensation ------"
echo 33 12 > $proc && cat $proc
echo "------ Golden Mutual Raw Data ------"
echo 34 > $proc && cat $proc
echo "------ Packaging Plant - HW reset ------"
echo 01 FA 20 00 00 24 80 > $proc
echo "------ Packaging Plant - Hibernate Memory ------"
echo 01 FA 20 00 00 68 08 > $proc
echo "------ Packaging Plant - Read 16 bytes from Address 0x00041FD8 ------"
echo 02 FB 00 04 3F D8 00 10 01 > $proc && cat $proc
echo "------ ITO Raw ------"
echo 01 > $spi/stm_fts_cmd && cat $spi/stm_fts_cmd
echo "------ Restore Bus Owner ------"
echo A0 00 01 > $proc
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
+7
View File
@@ -0,0 +1,7 @@
#!/vendor/bin/sh
for f in /sys/devices/platform/10cb0000.hsi2c/i2c-*/*-0025; do
if [ -d $f ]; then
echo 0 > $f/contaminant_detection;
fi
done
Binary file not shown.
BIN
View File
Binary file not shown.
+261
View File
@@ -0,0 +1,261 @@
#!/vendor/bin/sh
#
# Copyright 2020 The Android Open Source 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.
# This script automates Dauntless firmware updates
#
# We use the name "dauntless" in the source for clarity, but keep "citadel" on
# the target so we don't have to change all the factory scripts.
set -u
# There are multiple pre-production images, so we have to pick the right one
FWDIR=/vendor/firmware/dauntless
# Update tool
UPDATER=/vendor/bin/hw/citadel_updater
# Log messages to both logcat and the shell
LOG_TAG=init_citadel
log_info() {
log -p i -t "${LOG_TAG}" "$1"
echo "$1" >&2
}
log_error() {
log -p e -t "${LOG_TAG}" "$1"
echo "$1" >&2
}
die() {
log_error "fatal: $1"
exit 1
}
get_running_version() {
# See what's running now
log_info "Checking RW firmware version..."
version=$(${UPDATER} -vv)
status=$?
if [[ $status -ne 0 ]] ; then
log_error "Failed to get RW firmware version"
return 1
fi
log_info "Running RW version: ${version}"
echo "$version"
}
log_ro_version() {
log_info "Checking RO firmware version..."
version=$(${UPDATER} -l | grep RO_)
status=$?
if [[ $status -ne 0 ]] ; then
log_error "Failed to get RO firmware version"
return 0
fi
log_info "${version}"
}
find_image_file() {
version="$1"
# There are several flavors of dauntless chips and they're all signed
# differently. If we have multiple images to choose from, we'll try to pick
# the image that matches the running firmware.
# The -vv option will try to identify the flavor. If it can, it will append
# a /FLAVOR string to the version string.
flavor=$(echo $version | cut -d/ -f3)
# For node-locked images we have to let the chip tell us
[[ -z "$flavor" ]] &&
flavor=$(${UPDATER} -l | grep Chip | sed -e 's/^.*(//' -e 's/).*//')
# Look for a matching image name
[[ -n "$flavor" ]] && log_info "Flavor: $flavor" &&
[[ -f "$FWDIR/$flavor.ec.bin" ]] &&
fwbin="$FWDIR/$flavor.ec.bin"
# Look for the default if no flavor known or image available
[[ -z "${fwbin:-}" ]] && [[ -f "$FWDIR/ec.bin" ]] &&
fwbin="$FWDIR/ec.bin"
# Still nothing? That's not right
if [[ -z "${fwbin:-}" ]]; then
log_info "Couldn't find a firmware image to upload"
return 1;
fi
log_info "Image file: $fwbin"
echo "$fwbin"
}
is_newer_ro() {
fwbin="$1"
file_is_newer=$(${UPDATER} --is_newer_ro "$fwbin")
status=$?
if [[ $status -ne 0 ]] ; then
log_error "Failed to compare running RO with file"
return 1
fi
log_info "Is RO in file newer: $file_is_newer"
echo "$file_is_newer";
}
is_newer_rw() {
fwbin="$1"
file_is_newer=$(${UPDATER} --is_newer_rw "$fwbin")
status=$?
if [[ $status -ne 0 ]] ; then
log_error "Failed to compare running RW with file"
return 1
fi
log_info "Is RW in file newer: $file_is_newer"
echo "$file_is_newer";
}
upload_fw() {
which="$1"
fwbin="$2"
# Try several times
log_info "Uploading firmware..."
${UPDATER} "$which" "${fwbin}" && echo "okay" && return 0
log_info "Trying again..."
${UPDATER} "$which" "${fwbin}" && echo "okay" && return 0
log_info "Maybe a forced reset will help"
${UPDATER} --force_reset || log_error "Couldn't force reset the chip"
sleep 1
log_info "Trying once more..."
${UPDATER} "$which" "${fwbin}" && echo "okay" && return 0
log_error "Nope. Couldn't upload the new firmware."
return 1;
}
# If cryptolib_RO is already provided by the current RO, or the new RW doesn't
# reequire it, then it's safe to update RW.
safe_to_update_rw() {
fwbin=$1
# Get epoch.major.minor of the current RO image
chip_ver=$(${UPDATER} -l | tr ':/' ' ' | egrep 'R[OW]_[AB].*\*')
cur_ro_vers=$(echo "$chip_ver" | awk '/RO_/ {print $3}')
# RO 0.1.6 (evt) and RO 0.0.6 (proto11) contain RO_CRYPTO
# Assume(!) that the minor number will just continue to increment
minor=$(echo "$cur_ro_vers" | cut -d. -f3)
if [[ "$minor" -ge 6 ]] ; then
log_info "RO version $cur_ro_vers contains cryptolib"
echo "yes"
return
fi
# There's no RO crypto currently installed, but do we really need it?
# Which RW image are we considering?
cur_rw_slot=$(echo "$chip_ver" | awk '/RW_/ {print $1}')
new_rw_slot=$(echo "$cur_rw_slot" | tr 'AB' 'BA')
# Obtain the new RW version string from the provided image file.
file_ver=$(${UPDATER} -f "$fwbin" | tr ':/' ' ')
new_rw_vers=$(echo "$file_ver" | awk "/$new_rw_slot/ {print \$3}")
# go/nor/50384 added -r, -l, or -w to the version string
# -r means "needs RO_CRYPTO"
if [[ "$new_rw_vers" == *-r ]] ; then
log_info "New RW firmware $new_rw_vers requires RO cryptolib"
echo "no"
return
fi
echo "yes"
}
# Let's do this
log_info "Starting $0"
# What do we know?
version=$(get_running_version) || die "No running version"
fwbin=$(find_image_file "$version") || die "No image file"
do_ro=$(is_newer_ro "$fwbin") || die "No RO comparsion"
# If there's a RO update available, try it first.
if [[ "$do_ro" = "yes" ]]; then
log_info "Trying to update RO"
log_ro_version
# Upload should succeed
upload_fw --ro "$fwbin" || die "RO upload failed"
# Enable might succeed with default (empty) password
if ${UPDATER} --enable_ro '' ; then
# RO takes effect immediately and will reboot if RW changed too, so
# give it some time to happen.
sleep 2
log_ro_version || die "Can't read version after update"
else
# The user has a PIN/pattern/password set
log_info "The primary user will have to enable the update"
fi
fi
# What do we know now?
version=$(get_running_version) || die "No running version"
fwbin=$(find_image_file "$version") || die "No image file"
do_rw=$(is_newer_rw "$fwbin") || die "No RW comparsion"
# If there's a RW update available, try it next
if [[ "$do_rw" = "yes" ]]; then
log_info "Trying to update RW"
# If the new RW requires cryptolib_RO and we don't have it, don't try
safe=$(safe_to_update_rw "$fwbin")
if [[ "$safe" != "yes" ]]; then
log_error "Cowardly refusing to update RW right now"
else
# Upload should succeed
upload_fw --rw "$fwbin" || die "RW upload failed"
# Enable might succeed with default (empty) password
if ${UPDATER} --enable_rw '' ; then
# We need to reboot manually for RW update
log_info "RW update enabled, rebooting now"
${UPDATER} --reboot || ${UPDATER} --force_reset || \
log_error "can't reboot"
get_running_version || die "Can't read version after update"
else
# The user has a PIN/pattern/password set
log_info "The primary user will have to enable the update"
fi
fi
fi
log_info "All done"
exit 0
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+10
View File
@@ -0,0 +1,10 @@
#!/vendor/bin/sh
camera_irq_nums=$(grep "lwis" /proc/interrupts | awk '{ print(substr($1, 0, length($1) - 1)) }')
for irq_num in ${camera_irq_nums[@]};
do
chown system:system /proc/irq/${irq_num}/smp_affinity
chown system:system /proc/irq/${irq_num}/smp_affinity_list
done
+18
View File
@@ -0,0 +1,18 @@
#! /vendor/bin/sh
#
# Copy /vendor/etc/database/ if needed for RIL
#
data_ecc_ver=$(cat /data/vendor/radio/database/ecc_version)
if [ -z $data_ecc_ver ]; then
data_ecc_ver=0
fi
vendor_ecc_ver=$(cat /vendor/etc/database/ecc_version)
if [ -z $vendor_ecc_ver ]; then
vendor_ecc_ver=0
fi
# Copy files from /vendor/etc/database/ to /data/vendor/radio/ when data_ecc_ver < vendor_ecc_ver
if [ $data_ecc_ver -lt $vendor_ecc_ver ]; then
mkdir -p /data/vendor/radio/database
cp -R /vendor/etc/database/* /data/vendor/radio/database/
chown -hR radio.radio /data/vendor/radio/databse/
fi
BIN
View File
Binary file not shown.
+111
View File
@@ -0,0 +1,111 @@
#!/vendor/bin/sh
###################################################################
### init.insmod.cfg format: ###
### ----------------------------------------------------------- ###
### [insmod|setprop|enable|moprobe|rmmod|wait] [path|prop name] ###
### ... ###
###################################################################
modules_dir=
system_modules_dir=
vendor_modules_dir=
# This directory ONLY contains the 16k modules loaded in 16k mode
# during the Second Boot Stage. This directory is not present in the
# <device>_16k targets.
mode_16k_modules_dir=/vendor/lib/modules/16k-mode
pagesize=$(getconf PAGE_SIZE)
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 [[ "${pagesize}" == "16384" && -d "${mode_16k_modules_dir}" ]]; then
insmod ${mode_16k_modules_dir}/$arg
elif [[ -d "${modules_dir}" ]]; then
modprobe -a -d "${modules_dir}" $arg
fi
;;
"rmmod") rmmod $arg ;;
"wait") wait_for_file $arg ;;
esac
done < $cfg_file
fi
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+31
View File
@@ -0,0 +1,31 @@
#!/vendor/bin/sh
wait_for_file() {
local filename="$1"
local timeout="${2:-5}"
expiry=$(($(date "+%s")+timeout))
while [[ ! -e "${filename}" ]] && [[ "$(date "+%s")" -le "${expiry}" ]]
do
sleep 0.5
done
[[ -e "${filename}" ]]
}
configure_auto() {
if ! wait_for_file "$1" 20
then
echo "pcie_power: failed to find file: $1" >&2
return 1
fi
echo auto > "$1"
}
for i in \
/sys/bus/pci/devices/0000:01:00.0/power/control \
/sys/bus/pci/devices/0001:01:00.0/power/control
do
configure_auto "$i" &
done
wait
+15
View File
@@ -0,0 +1,15 @@
#!/vendor/bin/sh
# This script delays experiments by the specified amount of seconds. The delay is not needed for
# the normal operation, but becomes essential for the rare case (which "should not happen") where
# an experiment causes really bad issues (e.g. crashes the kernel). In such case the delay gives
# GMSCore an opportunity to fetch fresh experiments snapshot (with the bad experiment disabled).
#
# See go/pixel-perf-experiment-whatif for more info.
delay_seconds="$1"
if [ -n "$delay_seconds" ]; then
sleep "$delay_seconds"
/vendor/bin/setprop vendor.perf.allow_experiments 1
fi
BIN
View File
Binary file not shown.
+51
View File
@@ -0,0 +1,51 @@
#!/vendor/bin/sh
DIR=/data/vendor/dump_touch
SCRIPT_DIR=/vendor/bin/dump_touch
LOCKFILE="$DIR"/dumping
LOGFILE="$DIR"/dump.log
DEBUG_START_TIME="$DIR"/start
DEBUG_END_TIME="$DIR"/end
date +%s%N > $DEBUG_START_TIME
if [ ! -f $LOCKFILE ]
then
#Init Setup
echo 0 > $LOCKFILE
echo "" > $LOGFILE
chmod 660 $LOCKFILE
chmod 660 $LOGFILE
fi
date >> $LOGFILE
state=$(cat $LOCKFILE)
if [ "$state" = 2 ]
then
echo "Warning : Pending predump data detected (state=${state})" >> $LOGFILE
elif [ "$state" != 0 ]
then
echo "Unexpected state! Expected 0 but found ${state}" >> $LOGFILE
fi
echo 1 > $LOCKFILE
for entry in "$SCRIPT_DIR"/*.sh
do
echo "----------------------------------" >> $LOGFILE
echo "$entry" >> $LOGFILE
echo "----------------------------------" >> $LOGFILE
sh "$entry" >> $LOGFILE 2>&1
echo "----------------------------------" >> $LOGFILE
done
state=$(cat $LOCKFILE)
if [ "$state" != 1 ]
then
echo "Unexpected state! Expected 1 but found ${state}" >> $LOGFILE
fi
echo 2 > $LOCKFILE
date +%s%N > $DEBUG_END_TIME
Vendored Executable
BIN
View File
Binary file not shown.
Vendored Executable
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.