Make component registration atomic, and check version rollback.

This changes makes the component registration atomic, so that when
updating a component, a crash does not leave the component in a bad
state. This is accomplished by having generational folders of a
component and a symlink that is atomically updated to point at the most
recent.

BUG=chromium:588220
TEST=emerge imageloader and run the test client with the test data
CQ-DEPEND=CL:361410,CL:361584

Change-Id: I731eab542e095e3c5b43e194374cf891bf302426
Reviewed-on: https://chromium-review.googlesource.com/361560
Commit-Ready: Greg Kerr <kerrnel@chromium.org>
Tested-by: Greg Kerr <kerrnel@chromium.org>
Reviewed-by: Ricky Zhou <rickyz@chromium.org>
1 file changed
tree: 36debb296f0cf29bdbf5e5618e52e4ed0f0d1c49
  1. public_keys/
  2. test/
  3. .presubmitignore
  4. imageloadclient-glue.xml
  5. imageloadclient.cc
  6. imageloadclient.h
  7. imageloader-glue.xml
  8. imageloader.cc
  9. imageloader.gyp
  10. imageloader.h
  11. imageloader_common.cc
  12. imageloader_common.h
  13. imageloader_main.cc
  14. imageloader_unittest.cc
  15. org.chromium.ImageLoader.conf
  16. org.chromium.ImageLoader.service
  17. README.md
  18. run_tests.cc
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.