From 70ba42a943ee87c3befe8f36f85330a745614f86 Mon Sep 17 00:00:00 2001 From: achigoliu Date: Wed, 15 Jan 2020 21:34:57 +0800 Subject: [PATCH] s5: Add ramoops shell script to vendor Bug: 147082732 Test: Encrypt and decrypt ramoops successfully Change-Id: Ie7caf943e3e1ff3db664d6b14c06b93a7700f0ae Signed-off-by: achigoliu --- device.mk | 1 + init.ramoops.sh | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 init.ramoops.sh diff --git a/device.mk b/device.mk index 85918c6c..826dd3c4 100644 --- a/device.mk +++ b/device.mk @@ -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 diff --git a/init.ramoops.sh b/init.ramoops.sh new file mode 100644 index 00000000..526bf952 --- /dev/null +++ b/init.ramoops.sh @@ -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 +