]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/installer/hw.h
Merge branch 'ipsec' into next
[ipfire-2.x.git] / src / installer / hw.h
index e4bb18b920c58ab7a8541aa0e5a043650ff5a99c..9fe69271e6c33e1a0440f24bdfa31db8411bb819 100644 (file)
 #include <libudev.h>
 
 #define DESTINATION_MOUNT_PATH        "/harddisk"
-#define SOURCE_MOUNT_PATH "/cdrom"
-#define SOURCE_TEST_FILE  SOURCE_MOUNT_PATH "/" VERSION ".media"
+#define SOURCE_MOUNT_PATH             "/cdrom"
+#define SOURCE_TEST_FILE              SOURCE_MOUNT_PATH "/" DISTRO_SNAME "-" DISTRO_VERSION ".media"
 
 #define HW_MAX_DISKS                 32
 #define STRING_SIZE                1024
 #define DEV_SIZE                    128
 
 #define HW_PATH_BOOT                  "/boot"
+#define HW_PATH_BOOT_EFI              "/boot/efi"
 #define HW_PATH_DATA                  "/var"
 
 #define HW_PART_TYPE_NORMAL           0
@@ -45,6 +46,7 @@
 #define HW_FS_EXT4                    2
 #define HW_FS_EXT4_WO_JOURNAL         3
 #define HW_FS_XFS                     4
+#define HW_FS_FAT32                   5
 
 #define HW_FS_DEFAULT                 HW_FS_EXT4
 
 
 struct hw {
        struct udev *udev;
+       char arch[STRING_SIZE];
+
+       // Enabled if we should install in EFI mode
+       int efi;
 };
 
 struct hw_disk {
@@ -82,19 +88,20 @@ struct hw_destination {
        int part_table;
        char part_bootldr[DEV_SIZE];
        char part_boot[DEV_SIZE];
+       char part_boot_efi[DEV_SIZE];
        char part_swap[DEV_SIZE];
        char part_root[DEV_SIZE];
-       char part_data[DEV_SIZE];
        int part_boot_idx;
+       int part_boot_efi_idx;
 
        int filesystem;
 
        unsigned long long size;
        unsigned long long size_bootldr;
        unsigned long long size_boot;
+       unsigned long long size_boot_efi;
        unsigned long long size_swap;
        unsigned long long size_root;
-       unsigned long long size_data;
 };
 
 struct hw* hw_init();
@@ -107,10 +114,12 @@ char* hw_find_source_medium(struct hw* hw);
 
 struct hw_disk** hw_find_disks(struct hw* hw, const char* sourcedrive);
 void hw_free_disks(struct hw_disk** disks);
-unsigned int hw_count_disks(struct hw_disk** disks);
+unsigned int hw_count_disks(const struct hw_disk** disks);
 struct hw_disk** hw_select_disks(struct hw_disk** disks, int* selection);
+struct hw_disk** hw_select_first_disk(const struct hw_disk** disks);
 
-struct hw_destination* hw_make_destination(int part_type, struct hw_disk** disks);
+struct hw_destination* hw_make_destination(struct hw* hw, int part_type, struct hw_disk** disks,
+       int disable_swap);
 
 unsigned long long hw_memory();
 
@@ -124,9 +133,14 @@ int hw_destroy_raid_superblocks(const struct hw_destination* dest, const char* o
 int hw_setup_raid(struct hw_destination* dest, const char* output);
 int hw_stop_all_raid_arrays(const char* output);
 
-int hw_install_bootloader(struct hw_destination* dest, const char* output);
+int hw_install_bootloader(struct hw* hw, struct hw_destination* dest, const char* output);
 int hw_write_fstab(struct hw_destination* dest);
 
+char* hw_find_backup_file(const char* output, const char* search_path);
+int hw_restore_backup(const char* output, const char* backup_path, const char* destination);
+
+int hw_start_networking(const char* output);
+
 void hw_sync();
 
 #endif /* HEADER_HW_H */