mirror of
https://github.com/PixelExperience-Devices/device_xiaomi_miatoll.git
synced 2025-05-20 21:17:16 +09:00
miatoll: rootdir: Import init.qcom.early_boot.sh
* We used to have an init extension, which breaks treble and since P it requires custom SELinux rules to allow init reading /proc/sys/kernel/boot_reason * Remove the init extension and set the property like QCOM does through init.qcom.early_boot.sh * Update the property with vendor prefix while we are at it Change-Id: I238f754a17c9a548c6c90503bfa4b21763d1b4c4 Signed-off-by: Sonal Singh <sonal.singh.19993@gmail.com>
This commit is contained in:
parent
1776cd623a
commit
55146455d0
@ -211,7 +211,8 @@ PRODUCT_COPY_FILES += \
|
|||||||
PRODUCT_COPY_FILES += \
|
PRODUCT_COPY_FILES += \
|
||||||
$(LOCAL_PATH)/rootdir/bin/init.qcom.post_boot.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qcom.post_boot.sh \
|
$(LOCAL_PATH)/rootdir/bin/init.qcom.post_boot.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qcom.post_boot.sh \
|
||||||
$(LOCAL_PATH)/rootdir/bin/init.qcom.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qcom.sh \
|
$(LOCAL_PATH)/rootdir/bin/init.qcom.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qcom.sh \
|
||||||
$(LOCAL_PATH)/rootdir/bin/init.qti.chg_policy.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qti.chg_policy.sh
|
$(LOCAL_PATH)/rootdir/bin/init.qti.chg_policy.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qti.chg_policy.sh \
|
||||||
|
$(LOCAL_PATH)/rootdir/init.qcom.early_boot.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qcom.early_boot.sh
|
||||||
|
|
||||||
# Input
|
# Input
|
||||||
PRODUCT_COPY_FILES += \
|
PRODUCT_COPY_FILES += \
|
||||||
|
@ -88,6 +88,8 @@ on early-boot
|
|||||||
chown system system /mnt/vendor/persist/data/pfm/licenses
|
chown system system /mnt/vendor/persist/data/pfm/licenses
|
||||||
chmod 0775 /mnt/vendor/persist/data/pfm/licenses
|
chmod 0775 /mnt/vendor/persist/data/pfm/licenses
|
||||||
|
|
||||||
|
exec u:r:vendor_qti_init_shell:s0 -- /vendor/bin/init.qcom.early_boot.sh
|
||||||
|
|
||||||
on boot
|
on boot
|
||||||
chown bluetooth bluetooth /sys/module/bluetooth_power/parameters/power
|
chown bluetooth bluetooth /sys/module/bluetooth_power/parameters/power
|
||||||
chown bluetooth net_bt /sys/class/rfkill/rfkill0/type
|
chown bluetooth net_bt /sys/class/rfkill/rfkill0/type
|
||||||
|
37
rootdir/init.qcom.early_boot.sh
Normal file
37
rootdir/init.qcom.early_boot.sh
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#!/vendor/bin/sh
|
||||||
|
# Copyright (c) 2012-2013,2016,2018 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
export PATH=/vendor/bin
|
||||||
|
|
||||||
|
boot_reason=`cat /proc/sys/kernel/boot_reason`
|
||||||
|
reboot_reason=`getprop ro.boot.alarmboot`
|
||||||
|
if [ "$boot_reason" = "3" ] || [ "$reboot_reason" = "true" ]; then
|
||||||
|
setprop ro.vendor.alarm_boot true
|
||||||
|
else
|
||||||
|
setprop ro.vendor.alarm_boot false
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user