Allow cleanup of incomplete component registration.

If ImageLoader crashes, for example due to a seccomp filter violation,
it can leave an incomplete installation on disk that will block a valid
installation from occurring in the future. This makes sure ImageLoader
cleans up any junk left behind from a crash.

BUG=chromium:630421
TEST=emerge-${BOARD} imageloader, setup junk directory, register
component

Change-Id: Ifdc59cd599576c0c40b1bdf98062d4595cf967c0
Reviewed-on: https://chromium-review.googlesource.com/410182
Commit-Ready: Greg Kerr <kerrnel@chromium.org>
Tested-by: Greg Kerr <kerrnel@chromium.org>
Reviewed-by: Ricky Zhou <rickyz@chromium.org>
2 files changed
tree: f2d5a7207453905f247caa59677fb852691c900c
  1. public_keys/
  2. test/
  3. .presubmitignore
  4. imageloadclient-glue.xml
  5. imageloadclient.cc
  6. imageloadclient.h
  7. imageloader-glue.xml
  8. imageloader-seccomp-amd64.policy
  9. imageloader-seccomp-arm.policy
  10. imageloader-seccomp-x86.policy
  11. imageloader.conf
  12. imageloader.gyp
  13. imageloader.h
  14. imageloader_common.cc
  15. imageloader_common.h
  16. imageloader_impl.cc
  17. imageloader_impl.h
  18. imageloader_main.cc
  19. imageloader_unittest.cc
  20. imageloader_wrapper
  21. mock_verity_mounter.h
  22. org.chromium.ImageLoader.conf
  23. org.chromium.ImageLoader.service
  24. README.md
  25. run_tests.cc
  26. verity_mounter.cc
  27. verity_mounter.h
README.md

src/platform/imageloader

This aims to provide a generic utility to load (mount) and unload (unmount) verified disk images through DBus IPC.

Binaries

  • imageloader
  • imageloadclient

imageloader can be run as root and can handle mounting and unmounting of disk images. imageloadclient is a simple client (intended to be run as chronos) that can talk to imageloader and ask it to mount and unmount stuff. When imageloader is not running, DBus can invoke it via the one time run option (imageloader -o) and get the task done.