first commit

This commit is contained in:
benbensy
2024-11-21 12:25:38 +08:00
commit 74673afa9f
60 changed files with 519 additions and 0 deletions
@@ -0,0 +1,9 @@
# Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause-Clear
service vendor.boot-qti /system/bin/hw/android.hardware.boot-service.qti.recovery
class early_hal
user root
group root
seclabel u:r:hal_bootctl_default:s0
interface aidl android.hardware.boot.IBootControl/default
@@ -0,0 +1,6 @@
service vendor.fastboot-default /system/bin/hw/android.hardware.fastboot-service.example_recovery
class hal
seclabel u:r:hal_fastboot_default:s0
user system
group system
interface aidl android.hardware.fastboot.IFastboot/default
@@ -0,0 +1,7 @@
service vendor.health-recovery /system/bin/hw/android.hardware.health-service.qti_recovery
class hal
seclabel u:r:hal_health_default:s0
user system
group system
capabilities WAKE_ALARM BLOCK_SUSPEND
file /dev/kmsg w
+57
View File
@@ -0,0 +1,57 @@
# MIUI ADD: Recovery_StabilityEnhance
# Copyright (c) 2017-2018,2020 The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
on early-init
insmod /vendor/lib/modules/q6_pdr_dlkm.ko
insmod /vendor/lib/modules/q6_notifier_dlkm.ko
insmod /vendor/lib/modules/snd_event_dlkm.ko
insmod /vendor/lib/modules/gpr_dlkm.ko
insmod /vendor/lib/modules/spf_core_dlkm.ko
insmod /vendor/lib/modules/adsp_loader_dlkm.ko
on init
write /sys/class/backlight/panel0-backlight/brightness 200
setprop sys.usb.configfs 1
on property:ro.boot.usbcontroller=*
setprop sys.usb.controller ${ro.boot.usbcontroller}
wait /sys/bus/platform/devices/${ro.boot.usb.dwc3_msm:-a600000.ssusb}/mode
write /sys/bus/platform/devices/${ro.boot.usb.dwc3_msm:-a600000.ssusb}/mode peripheral
wait /sys/class/udc/${ro.boot.usbcontroller} 1
on fs
wait /dev/block/platform/soc/${ro.boot.bootdevice}
symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
write /proc/sys/kernel/firmware_config/force_sysfs_fallback 1
mkdir /vendor/firmware_mnt
mkdir /vendor/firmware
mount_all /vendor/etc/charger_fstab.qti --early
mount none /vendor/firmware_mnt/image /vendor/firmware bind rec
wait /sys/kernel/boot_adsp/ssr
write /sys/kernel/boot_adsp/ssr 1
wait /sys/class/power_supply/battery
# END Recovery_StabilityEnhance
+39
View File
@@ -0,0 +1,39 @@
service logd /system/bin/logd
socket logd stream 0666 logd logd
socket logdr seqpacket 0666 logd logd
socket logdw dgram+passcred 0222 logd logd
file /proc/kmsg r
file /dev/kmsg w
user logd
group logd system package_info readproc
capabilities SYSLOG AUDIT_CONTROL
priority 10
task_profiles ServiceCapacityLow
onrestart setprop logd.ready false
service logd-reinit /system/bin/logd --reinit
oneshot
disabled
user logd
group logd
task_profiles ServiceCapacityLow
# Limit SELinux denial generation, defaulting to 5/second
service logd-auditctl /system/bin/auditctl -r ${persist.logd.audit.rate:-5}
oneshot
disabled
user logd
group logd
capabilities AUDIT_CONTROL
on fs
write /dev/event-log-tags "# content owned by logd
"
chown logd logd /dev/event-log-tags
chmod 0644 /dev/event-log-tags
on property:sys.boot_completed=1
start logd-auditctl
on property:persist.logd.audit.rate=*
start logd-auditctl
+27
View File
@@ -0,0 +1,27 @@
on property:vold.miui=factoryreset
# debugfs
mount debugfs debugfs /sys/kernel/debug
chmod 0755 /sys/kernel/debug
# Create location for fs_mgr to store abbreviated output from filesystem
# checker programs.
mkdir /dev/fscklogs 0770 root system
wait /dev/block/bootdevice
mount_all miui.factoryreset.fstab
# We chown/chmod /data again so because mount is run as root + defaults
chown system system /data
chmod 0771 /data
# We restorecon /data in case the userdata partition has been reset.
restorecon /data
# for logcat
start logd
start factoryreset
service factoryreset /system/bin/recovery --wipe_data_skip_preinstall
class late_start
seclabel u:r:recovery:s0
+3
View File
@@ -0,0 +1,3 @@
on post-fs-data
mkdir /data/misc/recovery 0770 system log
exec_background - system log -- /system/bin/recovery-persist
+2
View File
@@ -0,0 +1,2 @@
on post-fs
exec_background - system log -- /system/bin/recovery-refresh
+6
View File
@@ -0,0 +1,6 @@
service servicemanager /system/bin/servicemanager
disabled
group system readproc
user root
onrestart setprop servicemanager.ready false
seclabel u:r:servicemanager:s0