Skip to content

Commit

Permalink
s5: Add ramoops shell script to vendor
Browse files Browse the repository at this point in the history
Bug: 147082732
Test: Encrypt and decrypt ramoops successfully
Change-Id: Ie7caf943e3e1ff3db664d6b14c06b93a7700f0ae
Signed-off-by: achigoliu <[email protected]>
  • Loading branch information
achigoliu committed Jan 15, 2020
1 parent 100c702 commit 70ba42a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions device.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions init.ramoops.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 70ba42a

Please sign in to comment.