summaryrefslogtreecommitdiffstats
path: root/devices/paths.h
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2008-01-03 14:46:06 +1100
committerJeremy Kerr <jk@ozlabs.org>2008-01-03 14:46:06 +1100
commitdbacb44c0ebb587b5cfcbbf84c770502c217473a (patch)
tree43c0c9cf3df61c79f0f545ed496302a296122e27 /devices/paths.h
parent02aeee42aebbb3a7098b6e0fc570522f9d44de96 (diff)
downloadtalos-petitboot-dbacb44c0ebb587b5cfcbbf84c770502c217473a.tar.gz
talos-petitboot-dbacb44c0ebb587b5cfcbbf84c770502c217473a.zip
Move path maniuplation functions to devices/paths.c
This allows us to include the real functions in the parser testsuite, instead of using fakes. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'devices/paths.h')
-rw-r--r--devices/paths.h27
1 files changed, 27 insertions, 0 deletions
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 */
OpenPOWER on IntegriCloud