mirror of
https://github.com/PixelExperience-Devices/device_xiaomi_miatoll.git
synced 2025-05-16 11:07:31 +09:00
* 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>
38 lines
1.9 KiB
Bash
38 lines
1.9 KiB
Bash
#!/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
|