X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=devices%2Fpaths.h;fp=devices%2Fpaths.h;h=eca66894873c28f560466700fe615fe204d38b64;hb=dbacb44c0ebb587b5cfcbbf84c770502c217473a;hp=0000000000000000000000000000000000000000;hpb=02aeee42aebbb3a7098b6e0fc570522f9d44de96;p=petitboot diff --git a/devices/paths.h b/devices/paths.h new file mode 100644 index 0000000..eca6689 --- /dev/null +++ b/devices/paths.h @@ -0,0 +1,27 @@ +#ifndef PATHS_H +#define PATHS_H + +/** + * Get the mountpoint for a device + */ +const char *mountpoint_for_device(const char *dev_path); + +/** + * Resolve a path given in a config file, to a path in the local filesystem. + * Paths may be of the form: + * device:path (eg /dev/sda:/boot/vmlinux) + * + * or just a path: + * /boot/vmlinux + * - in this case, the current mountpoint is used. + * + * Returns a newly-allocated string containing a full path to the file in path + */ +char *resolve_path(const char *path, const char *current_mountpoint); + +/** + * Set the base directory for newly-created mountpoints + */ +void set_mount_base(const char *path); + +#endif /* PATHS_H */