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

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

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

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

Loading…
Cancel
Save