mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 03:07:43 +02:00
installer: Pass choosen filesystem to hw_make_destination
This is required to proper choose if a seperate boot partition should be created or must not created (BTRFS) Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> Reviewed-by: Michael Tremer <michael.tremer@ipfire.org> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
committed by
Arne Fitzenreiter
parent
15be1e1b9f
commit
ad73749dab
@@ -631,9 +631,13 @@ static int hw_calculate_partition_table(struct hw* hw, struct hw_destination* de
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct hw_destination* hw_make_destination(struct hw* hw, int part_type, struct hw_disk** disks, int disable_swap) {
|
||||
struct hw_destination* hw_make_destination(struct hw* hw, int part_type, struct hw_disk** disks,
|
||||
int disable_swap, int filesystem) {
|
||||
struct hw_destination* dest = malloc(sizeof(*dest));
|
||||
|
||||
// Assign filesystem
|
||||
dest->filesystem = filesystem;
|
||||
|
||||
if (part_type == HW_PART_TYPE_NORMAL) {
|
||||
dest->disk1 = *disks;
|
||||
dest->disk2 = NULL;
|
||||
@@ -655,9 +659,6 @@ struct hw_destination* hw_make_destination(struct hw* hw, int part_type, struct
|
||||
if (r)
|
||||
return NULL;
|
||||
|
||||
// Set default filesystem
|
||||
dest->filesystem = HW_FS_DEFAULT;
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ 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(struct hw* hw, int part_type, struct hw_disk** disks,
|
||||
int disable_swap);
|
||||
int disable_swap, int filesystem);
|
||||
|
||||
unsigned long long hw_memory();
|
||||
|
||||
|
||||
@@ -685,34 +685,9 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
hw_free_disks(disks);
|
||||
|
||||
struct hw_destination* destination = hw_make_destination(hw, part_type,
|
||||
selected_disks, config.disable_swap);
|
||||
|
||||
if (!destination) {
|
||||
errorbox(_("Your harddisk is too small."));
|
||||
goto EXIT;
|
||||
}
|
||||
|
||||
fprintf(flog, "Destination drive: %s\n", destination->path);
|
||||
fprintf(flog, " bootldr: %s (%lluMB)\n", destination->part_bootldr, BYTES2MB(destination->size_bootldr));
|
||||
fprintf(flog, " boot : %s (%lluMB)\n", destination->part_boot, BYTES2MB(destination->size_boot));
|
||||
fprintf(flog, " ESP : %s (%lluMB)\n", destination->part_boot_efi, BYTES2MB(destination->size_boot_efi));
|
||||
fprintf(flog, " swap : %s (%lluMB)\n", destination->part_swap, BYTES2MB(destination->size_swap));
|
||||
fprintf(flog, " root : %s (%lluMB)\n", destination->part_root, BYTES2MB(destination->size_root));
|
||||
fprintf(flog, "Memory : %lluMB\n", BYTES2MB(hw_memory()));
|
||||
|
||||
// Warn the user if there is not enough space to create a swap partition
|
||||
if (!config.unattended) {
|
||||
if (!config.disable_swap && !*destination->part_swap) {
|
||||
rc = newtWinChoice(title, _("OK"), _("Cancel"),
|
||||
_("Your harddisk is very small, but you can continue without a swap partition."));
|
||||
|
||||
if (rc != 1)
|
||||
goto EXIT;
|
||||
}
|
||||
}
|
||||
|
||||
// Filesystem selection
|
||||
int filesystem = HW_FS_DEFAULT;
|
||||
|
||||
if (!config.unattended) {
|
||||
struct filesystems {
|
||||
int fstype;
|
||||
@@ -741,7 +716,34 @@ int main(int argc, char *argv[]) {
|
||||
if (rc == 2)
|
||||
goto EXIT;
|
||||
|
||||
destination->filesystem = filesystems[fs_choice].fstype;
|
||||
filesystem = filesystems[fs_choice].fstype;
|
||||
}
|
||||
|
||||
struct hw_destination* destination = hw_make_destination(hw, part_type,
|
||||
selected_disks, config.disable_swap, filesystem);
|
||||
|
||||
if (!destination) {
|
||||
errorbox(_("Your harddisk is too small."));
|
||||
goto EXIT;
|
||||
}
|
||||
|
||||
fprintf(flog, "Destination drive: %s\n", destination->path);
|
||||
fprintf(flog, " bootldr: %s (%lluMB)\n", destination->part_bootldr, BYTES2MB(destination->size_bootldr));
|
||||
fprintf(flog, " boot : %s (%lluMB)\n", destination->part_boot, BYTES2MB(destination->size_boot));
|
||||
fprintf(flog, " ESP : %s (%lluMB)\n", destination->part_boot_efi, BYTES2MB(destination->size_boot_efi));
|
||||
fprintf(flog, " swap : %s (%lluMB)\n", destination->part_swap, BYTES2MB(destination->size_swap));
|
||||
fprintf(flog, " root : %s (%lluMB)\n", destination->part_root, BYTES2MB(destination->size_root));
|
||||
fprintf(flog, "Memory : %lluMB\n", BYTES2MB(hw_memory()));
|
||||
|
||||
// Warn the user if there is not enough space to create a swap partition
|
||||
if (!config.unattended) {
|
||||
if (!config.disable_swap && !*destination->part_swap) {
|
||||
rc = newtWinChoice(title, _("OK"), _("Cancel"),
|
||||
_("Your harddisk is very small, but you can continue without a swap partition."));
|
||||
|
||||
if (rc != 1)
|
||||
goto EXIT;
|
||||
}
|
||||
}
|
||||
|
||||
// Setting up RAID if needed.
|
||||
|
||||
Reference in New Issue
Block a user