crypto from /system/
authorSimon Sickle <simon@simonsickle.com>
Sat, 25 Nov 2017 09:40:26 +0000 (03:40 -0600)
committerSimon Sickle <simon@simonsickle.com>
Sat, 25 Nov 2017 09:40:26 +0000 (03:40 -0600)
Signed-off-by: Simon Sickle <simon@simonsickle.com>
recovery/root/init.recovery.qcom.rc
recovery/root/sbin/qseecomd [changed mode: 0755->0644]
recovery/root/sbin/setup_decrypt [deleted file]

index 6abd1352d098d914b85271d070efa09715d16555..cecd696e7057337bfb68068d6d9405257b2e86cf 100644 (file)
@@ -32,21 +32,11 @@ on init
     chmod 0664 /dev/ion
     chown system system /dev/ion
 
-on early-fs
-    start setup-decrypt
-
 on fs
     wait /dev/block/platform/soc/1da4000.ufshc
     symlink /dev/block/platform/soc/1da4000.ufshc /dev/block/bootdevice
     install_keyring
 
-on boot
-    # save battery by switching to interactive once booted
-    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
-    write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive
-    write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor interactive
-    write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor interactive
-
 service qseecomd /sbin/qseecomd
     oneshot
     disabled
@@ -54,14 +44,10 @@ service qseecomd /sbin/qseecomd
     group root
     seclabel u:r:recovery:s0
 
-# use decryption libraries from /system if available
-service setup-decrypt /sbin/setup_decrypt
-    oneshot
-    disabled
-    user root
-    group root
-    seclabel u:r:recovery:s0
-
-on property:ro.crypto.state=encrypted
-    start qseecomd
-
+on boot
+    # save battery by switching to interactive once booted
+    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
+    write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive
+    write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor interactive
+    write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor interactive
+    start sbinqseecomd
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index 91e106f..a64b6a2
Binary files a/recovery/root/sbin/qseecomd and b/recovery/root/sbin/qseecomd differ
diff --git a/recovery/root/sbin/setup_decrypt b/recovery/root/sbin/setup_decrypt
deleted file mode 100644 (file)
index 4c0329e..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/sbin/sh
-
-log() {
-       echo "$*"
-       (echo "setup_decrypt: $*" > /dev/kmsg) 2> /dev/null
-}
-
-abort() {
-       log "Error: $*"
-       setprop ro.crypto.using_system_libs 0
-       exit 1
-}
-
-restart_crypto() {
-       crypto_state=$(getprop ro.crypto.state)
-       qsee_state=$(getprop init.svc.qseecomd)
-
-       [ "$qsee_state" = "running" ] && {
-               log "Stopping qseecomd"
-               stop qseecomd
-       }
-       [ "$crypto_state" = "encrypted" ] && {
-               log "Starting qseecomd"
-               start qseecomd
-       }
-}
-
-mountpoint -q /system || {
-       mkdir -p /system
-       log "Mounting /system read-only"
-       mount -t ext4 -o ro /dev/block/bootdevice/by-name/system /system
-}
-mountpoint -q /system || abort "Could not mount /system for crypto libs!"
-
-bin=/system/bin
-lib=/system/vendor/lib64
-hw=$lib/hw
-
-ready=true
-
-for f in \
-       "$bin/qseecomd" \
-       "$hw/keystore.msm8998.so" \
-       "$lib/libQSEEComAPI.so" \
-       "$lib/libdiag.so" \
-       "$lib/libdrmfs.so" \
-       "$lib/libdrmtime.so" \
-       "$lib/librpmb.so" \
-       "$lib/libssd.so" \
-       "$lib/libtime_genoff.so"
-do
-       [ -f "$f" ] && continue
-
-       log "Could not find crypto file: $f"
-       ready=false
-done
-
-$ready || abort "Missing one or more decryption libraries!"
-
-mkdir -p /vendor/lib64/hw/
-
-log "Copying decryption libraries from /system"
-cp -f \
-       "$bin/qseecomd" \
-       "$hw/keystore.msm8998.so" \
-       "$lib/libQSEEComAPI.so" \
-       "$lib/libdiag.so" \
-       "$lib/libdrmfs.so" \
-       "$lib/libdrmtime.so" \
-       "$lib/librpmb.so" \
-       "$lib/libssd.so" \
-       "$lib/libtime_genoff.so" \
-       /sbin/
-
-cp -f "$hw/keystore.msm8998.so" /vendor/lib64/hw/
-cp -f "$lib/libQSEEComAPI.so"   /vendor/lib64/
-
-chmod 0750 /sbin/qseecomd
-
-# we have to link qseecomd to /sbin/linker64 because /system is unmounted when it starts
-sed -i "s|/system/bin/linker|///////sbin/linker|" /sbin/qseecomd
-
-setprop ro.crypto.using_system_libs 1
-
-log "Using system decryption libraries!"
-
-restart_crypto
-
-exit 0