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
- # this is not good way for Hydrogen payload reserve
- write /dev/block/bootdevice/by-name/reserve 0
- symlink /dev/block/bootdevice/by-name/reserve /dev/block/bootdevice/by-name/reserve_a
- symlink /dev/block/bootdevice/by-name/reserve /dev/block/bootdevice/by-name/reserve_b
-
chmod 0660 /dev/qseecom
chown system drmrpc /dev/qseecom
chmod 0664 /dev/ion
disabled
seclabel u:r:recovery:s0
+service patchreserve /sbin/patchreserve.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
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 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