From: Simon Sickle Date: Sat, 25 Nov 2017 09:40:26 +0000 (-0600) Subject: crypto from /system/ X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2f83290a8986eaa56c21b72116d8f9520d22693a;p=GitHub%2Fmoto-9609%2Ftwrp_device_motorola_troika.git crypto from /system/ Signed-off-by: Simon Sickle --- diff --git a/recovery/root/init.recovery.qcom.rc b/recovery/root/init.recovery.qcom.rc index 6abd135..cecd696 100644 --- a/recovery/root/init.recovery.qcom.rc +++ b/recovery/root/init.recovery.qcom.rc @@ -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 diff --git a/recovery/root/sbin/qseecomd b/recovery/root/sbin/qseecomd old mode 100755 new mode 100644 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 index 4c0329e..0000000 --- a/recovery/root/sbin/setup_decrypt +++ /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