# this is for OnePlus 7 Pro 5g stock rom flashing
symlink /dev/block/bootdevice/by-name/mdm_oem_stanvbk /dev/block/bootdevice/by-name/mdm_oem_stanvbk_a
symlink /dev/block/bootdevice/by-name/mdm_oem_stanvbk /dev/block/bootdevice/by-name/mdm_oem_stanvbk_b
-
chmod 0660 /dev/qseecom
chown system drmrpc /dev/qseecom
chmod 0664 /dev/ion
oneshot
seclabel u:r:recovery:s0
+service patchreserve-service /sbin/patchreserve-service.sh
+ user root
+ group root
+ disabled
+ oneshot
+ seclabel u:r:recovery:s0
+
# This helps fix ld.config.txt errors from the linker on Android 8.1+
service ldconfigtxt /sbin/touch /sbin/ld.config.txt
oneshot
setprop sys.usb.config adb
write /proc/touchpanel/gesture_enable 1
write /sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-02/c440000.qcom,spmi:qcom,pmi8998@2:qcom,qpnp-smb2/power_supply/usb/otg_switch 1
+ chmod 0777 /sbin/patchreserve.sh
+ chmod 0777 /sbin/patchreserve-service.sh
+ start patchreserve-service
on init
start logd
start gatekeeper-1-0
start servicemanager
restart time_daemon
- start patchreserve
on property:sys.usb.config=mtp,adb
restart time_daemon
-
-on property:twrp.mount_to_decrypt=1
- start patchreserve
--- /dev/null
+#!/sbin/sh
+# This script is needed to permananetly keep reserve_a and reserve_b fake partitions and /data/reserve/reserve.img.
+
+n=1
+
+while [ $n -le 2 ]
+do
+# Check if already exist the /data/reserve directory symlink and create it
+if [ -d /data/reserve ];
+then
+ echo "/data/reserve already exist"
+else
+ mkdir /data/reserve
+ echo "/data/reserve created"
+fi
+
+# Check if already exist the /data/reserve/reserve.img symlink and create it
+if [ -f /data/reserve/reserve.img ];
+then
+ echo "/data/reserve/reserve.img already exist"
+else
+ touch /data/reserve/reserve.img
+ echo "/data/reserve/reserve.img created"
+fi
+
+# Check if already exist the /dev/block/bootdevice/by-name/reserve_a symlink and create it
+if [ -L /dev/block/bootdevice/by-name/reserve_a ];
+then
+ echo "/dev/block/bootdevice/by-name/reserve_a already exist"
+else
+ ln -s /data/reserve/reserve.img /dev/block/bootdevice/by-name/reserve_a
+ echo "/dev/block/bootdevice/by-name/reserve_a created"
+fi
+
+# Check if already exist the /dev/block/bootdevice/by-name/reserve_b symlink and create it
+if [ -L /dev/block/bootdevice/by-name/reserve_b ];
+then
+ echo "/dev/block/bootdevice/by-name/reserve_b already exist"
+else
+ ln -s /data/reserve/reserve.img /dev/block/bootdevice/by-name/reserve_b
+ echo "/dev/block/bootdevice/by-name/reserve_b created"
+fi
+
+# Check if already exist the /dev/block/by-name/reserve_a symlink and create it
+if [ -L /dev/block/by-name/reserve_a ];
+then
+ echo "/dev/block/by-name/reserve_a already exist"
+else
+ ln -s /data/reserve/reserve.img /dev/block/by-name/reserve_a
+ echo "/dev/block/by-name/reserve_a created"
+fi
+
+# Check if already exist the /dev/block/by-name/reserve_b symlink and create it
+if [ -L /dev/block/by-name/reserve_b ];
+then
+ echo "/dev/block/by-name/reserve_b already exist"
+else
+ ln -s /data/reserve/reserve.img /dev/block/by-name/reserve_b
+ echo "/dev/block/by-name/reserve_b created"
+fi
+
+done
+
+exit 0
+++ /dev/null
-#!/sbin/sh
-# This script is needed for Hydrogen OS to place reserve.img in the right place.
-
-
-# Check if already exist the /data/reserve directory symlink and create it
-if [ -d /data/reserve ];
-then
- echo "/data/reserve already exist"
-else
- mkdir /data/reserve
- echo "/data/reserve created"
-fi
-
-# Check if already exist the /data/reserve/reserve.img symlink and create it
-if [ -f /data/reserve/reserve.img ];
-then
- echo "/data/reserve/reserve.img already exist"
-else
- touch /data/reserve/reserve.img
- echo "/data/reserve/reserve.img created"
-fi
-
-# Check if already exist the /dev/block/bootdevice/by-name/reserve_a symlink and delete it
-if [ -L /dev/block/bootdevice/by-name/reserve_a ];
-then
- rm -f /dev/block/bootdevice/by-name/reserve_a
- echo "symlink_a exist and removed"
-else
- echo "symlink_a doesn't exist"
-fi
-
-# Check if already exist the /dev/block/bootdevice/by-name/reserve_b symlink and delete it
-if [ -L /dev/block/bootdevice/by-name/reserve_b ];
-then
- rm -f /dev/block/bootdevice/by-name/reserve_b
- echo "symlink_b exist and removed"
-else
- echo "symlink_b doesn't exist"
-fi
-
-# Creating symlinks /dev/block/bootdevice/by-name/reserve_a and /dev/block/bootdevice/by-name/reserve_b
-ln -s /data/reserve/reserve.img /dev/block/bootdevice/by-name/reserve_a
-ln -s /data/reserve/reserve.img /dev/block/bootdevice/by-name/reserve_b
-
-echo "Patch Reserve script complete."
-exit 0