unakite implemented, can be set up from gui now

pull/2/head
axtlos 3 years ago
parent 03330b00b8
commit e2c7f224e0

@ -1,2 +1,3 @@
Disks:widget
Disks:widget /dev/sda
/dev/nvme0n1

@ -20,6 +20,11 @@ class InstallPrefs {
final bool enableFlatpak;
final bool manualPartitioning;
final List<String> partitions;
final bool enableUnakite;
final String unakiteRoot;
final String crystalRoot;
final String unakiteEfiDir;
final String unakiteBootDev;
InstallPrefs({
this.locale = const Location(),
@ -40,6 +45,11 @@ class InstallPrefs {
this.enableFlatpak = false,
this.manualPartitioning = false,
this.partitions = const [],
this.enableUnakite = true,
this.unakiteRoot = "",
this.crystalRoot = "",
this.unakiteEfiDir = "",
this.unakiteBootDev = "",
});
Map toJson() => {
@ -77,6 +87,13 @@ class InstallPrefs {
"flatpak": enableFlatpak,
"extra_packages": [
"firefox",
]
],
"unakite": {
"enable": enableUnakite,
"root": unakiteRoot,
"oldroot": crystalRoot,
"efidir": unakiteEfiDir,
"bootdev": unakiteBootDev,
}
};
}

@ -33,6 +33,11 @@ Widget install(
bool ipv6,
bool enableTimeshift,
bool enableFlatpak,
bool enableUnakite,
String unakiteRoot,
String unakiteBootDev,
String unakiteEfiDir,
String crystalRoot,
setOutput,
output,
running,
@ -44,10 +49,14 @@ Widget install(
for (var part in partitions) {
if (part.mountpoint != "none" && part.filesystem != "none") {
if (part.mountpoint == "unakite") {
partsParsed.add("none:${part.partition}:btrfs");
} else {
partsParsed
.add("/mnt${part.mountpoint}:${part.partition}:${part.filesystem}");
}
}
}
InstallPrefs prefs = InstallPrefs(
locale: locale,
@ -68,6 +77,11 @@ Widget install(
ipv6: ipv6,
enableTimeshift: enableTimeshift,
enableFlatpak: enableFlatpak,
enableUnakite: enableUnakite,
unakiteRoot: unakiteRoot,
unakiteBootDev: unakiteBootDev,
unakiteEfiDir: unakiteEfiDir,
crystalRoot: crystalRoot,
);
String jsonPrefs = jsonEncode(prefs.toJson());
//writeConfig(jsonPrefs);

@ -122,7 +122,8 @@ Widget manualPartitioning(
"/opt",
"/tmp",
"/usr",
"/var"
"/var",
"unakite"
];
var filesystems = <String>[
"don't format",

@ -123,6 +123,7 @@ class _JadeguiState extends State<Jadegui> {
bool enableFlatpak = true;
bool connected = false;
bool manualPartitioning = false;
bool enableUnakite = true;
bool running = false;
bool runningInfo = false;
bool runningPart = false;
@ -142,6 +143,10 @@ class _JadeguiState extends State<Jadegui> {
String _diskType = "";
String hostname = "";
String output = "";
String unakiteRoot = "";
String crystalRoot = "";
String unakiteEfiDir = "";
String unakiteBootDev = "";
Desktop currDesktop = desktops[0];
Keymap chosenLayout = Keymap();
List<Partition> partitions = [];
@ -671,14 +676,26 @@ class _JadeguiState extends State<Jadegui> {
(partition, value) {
setState(() {
partition.mountpoint = value;
if (value == "/boot/efi") {
partition.format = "vfat";
if (value == "/boot/efi" && isEfi) {
partition.filesystem = "vfat";
unakiteEfiDir = value;
unakiteBootDev = partition.partition;
} else if (value == "/boot") {
unakiteEfiDir = value;
unakiteBootDev = partition.partition;
} else if (value == "/") {
crystalRoot = partition.partition;
} else if (value == "unakite") {
unakiteRoot = partition.partition;
partition.filesystem = "btrfs";
}
});
},
(partition, value) {
setState(() {
if (partition.mountpoint != "unakite") {
partition.filesystem = value;
}
});
},
isEfi),
@ -757,6 +774,11 @@ class _JadeguiState extends State<Jadegui> {
ipv6,
enableTimeshift,
enableFlatpak,
enableUnakite,
unakiteRoot,
unakiteBootDev,
unakiteEfiDir,
crystalRoot,
(value) {
setState(() {
if (value.compareTo(output) == 1) {

Loading…
Cancel
Save