]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/install+setup/install/hw.h
Allow to select the target disk and allow selecting multiple of them.
[ipfire-2.x.git] / src / install+setup / install / hw.h
index 3ef0d18bfed8e3213c958ba7cd1ec8bca36dafe8..d5549a4c7a1f1957815ed590a73c9da6a9519a19 100644 (file)
 #define SOURCE_MOUNT_PATH "/cdrom"
 #define SOURCE_TEST_FILE  SOURCE_MOUNT_PATH "/" VERSION ".media"
 
+#define HW_MAX_DISKS                 32
+#define STRING_SIZE                1024
+#define DEV_SIZE                    128
+
+#define HW_PART_TYPE_NORMAL           0
+#define HW_PART_TYPE_RAID1            1
+
 struct hw {
        struct udev *udev;
 };
 
+struct hw_disk {
+       char path[DEV_SIZE];
+       unsigned long long size;
+
+       char description[STRING_SIZE];
+       char vendor[STRING_SIZE];
+       char model[STRING_SIZE];
+
+       // Reference counter
+       int ref;
+};
+
+struct hw_destination {
+       char path[DEV_SIZE];
+       unsigned long long size;
+
+       int is_raid;
+
+       const struct hw_disk* disk1;
+       const struct hw_disk* disk2;
+
+       char part_boot[DEV_SIZE];
+       char part_swap[DEV_SIZE];
+       char part_root[DEV_SIZE];
+       char part_data[DEV_SIZE];
+};
+
 struct hw* hw_init();
 void hw_free(struct hw* hw);
 
@@ -38,4 +72,9 @@ int hw_umount(const char* target);
 
 char* hw_find_source_medium(struct hw* hw);
 
+struct hw_disk** hw_find_disks(struct hw* hw);
+void hw_free_disks(struct hw_disk** disks);
+unsigned int hw_count_disks(struct hw_disk** disks);
+struct hw_disk** hw_select_disks(struct hw_disk** disks, int* selection);
+
 #endif /* HEADER_HW_H */