Check if mount point already exists

Typically, we create the mount point directory when we mount the
filesystem, and then we remove the directory when we unmount. Currently,
we aren't accounting for the case where the directory already exists,
e.g. if the BMC reboots while the filesystem is mounted.

This commit adds a check to see if the directory is already present. If
so, it won't try to create the directory again.

Tested:
1. Formatted an eMMC using the FormatLuks method, which also creates the
   mount point and mounts the filesystem.
2. Rebooted the BMC
3. Ran the Unlock method to unlock the LUKS device and mount the
   filesystem.

Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: I3e279c653b21f570b97e4d530a19e5ae30bf8719
3 files changed
tree: 945a6e1daa221faae3d5bb308109642c3d993509
  1. include/
  2. src/
  3. .clang-format
  4. .gitignore
  5. LICENSE
  6. MAINTAINERS
  7. meson.build
  8. meson_options.txt
  9. OWNERS
  10. phosphor-logging.wrap
  11. README.md
README.md

eStoraged

This daemon serves as an abstraction for an encrypted storage device, encapsulating the security functionality and providing a D-Bus interface to manage the encrypted filesystem on the device. Using the D-Bus interface, other software components can interact with eStoraged to do things like create a new encrypted filesystem, wipe its contents, lock/unlock the device, or change the password.