s5: Add ramoops shell script to vendor

Bug: 147082732
Test: Encrypt and decrypt ramoops successfully
Change-Id: Ie7caf943e3e1ff3db664d6b14c06b93a7700f0ae
Signed-off-by: achigoliu <achigoliu@google.com>
This commit is contained in:
achigoliu
2020-01-15 21:34:57 +08:00
parent 100c70283b
commit 70ba42a943
2 changed files with 19 additions and 0 deletions

View File

@@ -114,6 +114,7 @@ PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/sensors.hals.conf:$(TARGET_COPY_OUT_VENDOR)/etc/sensors/hals.conf \
$(LOCAL_PATH)/thermal-engine-$(PRODUCT_HARDWARE).conf:$(TARGET_COPY_OUT_VENDOR)/etc/thermal-engine-$(PRODUCT_HARDWARE).conf \
$(LOCAL_PATH)/ueventd.rc:$(TARGET_COPY_OUT_VENDOR)/ueventd.rc \
$(LOCAL_PATH)/init.ramoops.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.ramoops.sh \
MSM_VIDC_TARGET_LIST := sm6150 # Get the color format from kernel headers
MASTER_SIDE_CP_TARGET_LIST := sm6150 # ION specific settings

18
init.ramoops.sh Normal file
View File

@@ -0,0 +1,18 @@
#!/vendor/bin/sh
# Decrypt the keys and write them to the kernel
ramoops -D
if [ $? -eq 0 ]; then
# Pivot (and decrypt)
echo 1 > /sys/devices/virtual/ramoops/pstore/use_alt
else
setprop vendor.ramoops.decryption.error $?
fi
# Trigger remount of pstore regardless of decryption state
setprop vendor.ramoops.decrypted true
# Generate keys (if none exist), and load the keys to carveout
ramoops -g -l -c