Skip to content

Commit

Permalink
Split into GUI and Daemon (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmhewitt authored Feb 16, 2021
1 parent 87b1be2 commit 55b7703
Show file tree
Hide file tree
Showing 21 changed files with 1,052 additions and 532 deletions.
92 changes: 92 additions & 0 deletions common/DBusStructures.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
* Copyright 2021 elementary, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

public struct InstallerDaemon.DiskInfo {
Disk[] physical_disks;
Disk[] logical_disks;
}

public struct InstallerDaemon.Disk {
string name;
string device_path;
uint64 sectors;
uint64 sector_size;
bool rotational;
bool removable;

Partition[] partitions;
}

public struct InstallerDaemon.Partition {
string device_path;

Distinst.FileSystem filesystem;

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

public struct InstallerDaemon.InstallConfig {
string hostname;
string keyboard_layout;
string keyboard_variant;
string lang;
uint8 flags;
}

[Flags]
public enum InstallerDaemon.MountFlags {
FORMAT = 1,
LVM = 2,
LVM_ON_LUKS = 4
}

public struct InstallerDaemon.Mount {
string partition_path;
string parent_disk;
string mount_point;
uint64 sectors;
Distinst.FileSystem filesystem;
MountFlags flags;

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

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

public bool is_lvm () {
return MountFlags.LVM in flags;
}

public bool should_format () {
return MountFlags.FORMAT in flags;
}
}

public struct InstallerDaemon.LuksCredentials {
string device;
string pv;
string password;
}
3 changes: 3 additions & 0 deletions common/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
common_files = files(
'DBusStructures.vala',
)
Loading

0 comments on commit 55b7703

Please sign in to comment.