diff options
Diffstat (limited to 'roots.h')
-rw-r--r-- | roots.h | 30 |
1 files changed, 19 insertions, 11 deletions
@@ -18,10 +18,7 @@ #define RECOVERY_ROOTS_H_ #include "common.h" - -#ifdef __cplusplus -extern "C" { -#endif +#include <fs_mgr.h> // Load and parse volume data from /etc/recovery.fstab. void load_volume_table(); @@ -31,23 +28,34 @@ Volume* volume_for_path(const char* path); // Make sure that the volume 'path' is on is mounted. Returns 0 on // success (volume is mounted). -int ensure_path_mounted(const char* path); +int ensure_volume_mounted(Volume* v, bool force_rw=false); +int ensure_path_mounted(const char* path, bool force_rw=false); +// Above, plus override SELinux default context +int remount_no_selinux(const char* path); -// Make sure that the volume 'path' is on is mounted. Returns 0 on +// Similar to ensure_path_mounted, but allows one to specify the mount_point. +int ensure_path_mounted_at(const char* path, const char* mount_point, bool force_rw=false); + +// Make sure that the volume 'path' is on is unmounted. Returns 0 on // success (volume is unmounted); -int ensure_path_unmounted(const char* path); +int ensure_volume_unmounted(Volume *v, bool detach=false); +int ensure_path_unmounted(const char* path, bool detach=false); // Reformat the given volume (must be the mount point only, eg // "/cache"), no paths permitted. Attempts to unmount the volume if // it is mounted. -int format_volume(const char* volume); +int format_volume(const char* volume, bool force = false); // Ensure that all and only the volumes that packages expect to find // mounted (/tmp and /cache) are mounted. Returns 0 on success. int setup_install_mounts(); -#ifdef __cplusplus -} -#endif +int get_num_volumes(); + +bool volume_is_mountable(Volume *v); +bool volume_is_readonly(Volume *v); +bool volume_is_verity(Volume *v); + +#define MAX_NUM_MANAGED_VOLUMES 10 #endif // RECOVERY_ROOTS_H_ |