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

Skip to content
Commit 258f0237 authored by Yi-Yo Chiang's avatar Yi-Yo Chiang
Browse files

set-verity-state: Harden logic of overlayfs setup/teardown

Refactor set_avb_verity_state() to return tri-state result:
  {.success=false}
    Failed to set verity state.
  {.success=true, .want_reboot=false}
    Success but verity already is requested state, so no need to reboot.
  {.success=true, .want_reboot=true}
    Successfully changed verity state, need reboot to take effect.

Setup overlayfs only if verity is going to be or already disabled.
Teardown overlayfs regardless of enable-verity success of not.
This ensures more robust behavior of setup / teardown overlayfs.

Adjust the log messages for consistent wording.
No point logging the errno of fs_mgr_overlayfs_[setup|teardown]
because the error must already be logged by callee.

Bug: 241688845
Test: adb [disable|enable]-verity
Change-Id: I3a77fe567757ca6173e8c3142e77fef483d9b849
parent e761510d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment