import /init.recovery.qcom_decrypt.rc
import /init.recovery.usb.rc

on init
    write /sys/class/backlight/panel0-backlight/brightness 200
    # Create location for fs_mgr to store abbreviated output from filesystem
    # checker programs.
    mkdir /dev/fscklogs 0770 root system
    start set_permissive

on fs
    wait /dev/block/platform/soc/${ro.boot.bootdevice}
    symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
    # Mount firmware
    mkdir /firmware
    mount vfat /dev/block/bootdevice/by-name/modem${ro.boot.slot_suffix} /firmware ro
    # Set fscklog permission
    chown root system /dev/fscklogs/log
    chmod 0770 /dev/fscklogs/log
    start boot-hal-1-1

on boot
    setprop sys.usb.config mtp,adb

on property:twrp.modules.loaded=true
    # Load ADSP firmware for PMIC
    wait /sys/kernel/boot_adsp/boot
    write /sys/kernel/boot_adsp/boot 1
    wait /sys/class/power_supply/battery
    start health-hal-2-1

service set_permissive /system/bin/set_permissive.sh
    user root
    group root
    disabled
    oneshot 
    seclabel u:r:recovery:s0
