Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare support for other backends #737

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
111 changes: 102 additions & 9 deletions common/DBusStructures.vala
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,106 @@ public struct InstallerDaemon.Disk {
Partition[] partitions;
}

public enum InstallerDaemon.FileSystem {
NONE,
BTRFS,
EXT2,
EXT3,
EXT4,
F2FS,
FAT16,
FAT32,
NTFS,
SWAP,
XFS,
LVM,
LUKS;

public unowned string to_string () {
switch (this) {
case BTRFS:
return "btrfs";
case EXT2:
return "ext2";
case EXT3:
return "ext3";
case EXT4:
return "ext4";
case F2FS:
return "f2fs";
case FAT16:
return "fat16";
case FAT32:
return "fat32";
case NTFS:
return "ntfs";
case SWAP:
return "swap";
case XFS:
return "xfs";
case LVM:
return "lvm";
case LUKS:
return "luks";
case NONE:
default:
return "none";
}
}
}

public struct InstallerDaemon.PartitionUsage {
/**
* None = 0; Some(usage) = 1;
*/
public uint8 tag;
/**
* The size, in sectors, that a partition is used.
*/
public uint64 value;
}

public enum InstallerDaemon.PartitionTable {
NONE,
GPT,
MSDOS;
}

public enum InstallerDaemon.Step {
BACKUP,
INIT,
PARTITION,
EXTRACT,
CONFIGURE,
BOOTLOADER;
}

public struct InstallerDaemon.Status {
Step step;
int percent;
}

public enum InstallerDaemon.LogLevel {
TRACE,
DEBUG,
INFO,
WARN,
ERROR;
}

public struct InstallerDaemon.Error {
Step step;
int err;
}

public struct InstallerDaemon.Partition {
string device_path;

Distinst.FileSystem filesystem;
FileSystem filesystem;

uint64 start_sector;
uint64 end_sector;
Distinst.PartitionUsage sectors_used;
PartitionUsage sectors_used;
string? current_lvm_volume_group;
}

Expand All @@ -47,7 +139,8 @@ public struct InstallerDaemon.InstallConfig {
string keyboard_layout;
string keyboard_variant;
string lang;
uint8 flags;
bool modify_boot_order;
bool install_drivers;
}

[Flags]
Expand All @@ -62,18 +155,18 @@ public struct InstallerDaemon.Mount {
string parent_disk;
string mount_point;
uint64 sectors;
Distinst.FileSystem filesystem;
FileSystem filesystem;
MountFlags flags;

public bool is_valid_boot_mount () {
return filesystem == Distinst.FileSystem.FAT16
|| filesystem == Distinst.FileSystem.FAT32;
return filesystem == FileSystem.FAT16
|| filesystem == FileSystem.FAT32;
}

public bool is_valid_root_mount () {
return filesystem != Distinst.FileSystem.FAT16
&& filesystem != Distinst.FileSystem.FAT32
&& filesystem != Distinst.FileSystem.NTFS;
return filesystem != FileSystem.FAT16
&& filesystem != FileSystem.FAT32
&& filesystem != FileSystem.NTFS;
}

public bool is_lvm () {
Expand Down