]> git.ozlabs.org Git - petitboot/blobdiff - devices/paths.h
Move path maniuplation functions to devices/paths.c
[petitboot] / devices / paths.h
diff --git a/devices/paths.h b/devices/paths.h
new file mode 100644 (file)
index 0000000..eca6689
--- /dev/null
@@ -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 */