Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7d5a7b0 authored by Abdelrahman Daim's avatar Abdelrahman Daim Committed by Jiyong Park
Browse files

[swap] Always call swapoff + reset from KillZramBackingDevice()



Summary: This diff makes changes to KillZramBackingDevice() in
reboot.cpp in the core init code. The changes involve adding
a call to swapoff() and reset() functions to properly shutdown
the zram swap device _before_ proceeding with the rest of
the code, which is only needed if we're using a loopback
device to back the zram swap partition. This ensures that swapoff will be called for users who are using zram as their swap device, but which have not configured a backing device for zram. This can cause us to reboot into flashboot
on those legacy devices.

Test: This now doesn't cause us to reboot into fastboot even after 20 iterations on devices:
```
i=1
while [ true ]; do
sleep 10
adb wait-for-device
adb root
sleep 10
adb shell getprop | grep prev_shutdown
status=$(adb shell "getprop ro.boottime.prev_shutdown.umount_status")
echo "status = $status"
if [ $status != "0" ]; then
adb shell cat /sys/fs/pstore/console-ramoops-0
sleep 100000
fi
adb shell "echo 7 7 7 7 > /proc/sys/kernel/printk"
echo "reboot $i"
i=$((i+1))
adb reboot
done
```

Change-Id: I27495b1007a44e19b8f223478a0430e5c8eb104c
Signed-off-by: default avatarAbdelrahman Daim <adaim@meta.com>
(cherry picked from commit d7941831d394028f3fd29bb21aad4665a723743f)
parent e42dc806
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment