diff --git a/jade_gui-1.0.8-1-any.pkg.tar.zst b/jade_gui-1.0.8-1-any.pkg.tar.zst new file mode 100644 index 0000000..b924e46 Binary files /dev/null and b/jade_gui-1.0.8-1-any.pkg.tar.zst differ diff --git a/jade_log.txt b/jade_log.txt index a1b8118..5a15f91 100644 --- a/jade_log.txt +++ b/jade_log.txt @@ -1,3 +1,2 @@ -Disks:widget /dev/sda -/dev/nvme0n1 +[LOG] diff --git a/lib/classes/install_prefs.dart b/lib/classes/install_prefs.dart index 029bbf4..ede4211 100644 --- a/lib/classes/install_prefs.dart +++ b/lib/classes/install_prefs.dart @@ -17,6 +17,8 @@ class InstallPrefs { final String hostname; final bool ipv6; final bool enableTimeshift; + final bool manualPartitioning; + final List partitions; InstallPrefs({ this.locale = const Location(), @@ -34,13 +36,16 @@ class InstallPrefs { this.hostname = "", this.ipv6 = false, this.enableTimeshift = false, + this.manualPartitioning = false, + this.partitions = const [], }); Map toJson() => { "partition": { "device": disk, - "mode": "auto", + "mode": manualPartitioning ? "manual" : "auto", "efi": isEfi, + "partitions": partitions, }, "bootloader": { "type": bootloader, diff --git a/lib/classes/partition.dart b/lib/classes/partition.dart index 6a52954..935dc83 100644 --- a/lib/classes/partition.dart +++ b/lib/classes/partition.dart @@ -6,6 +6,6 @@ class Partition { Partition({ this.partition = "", this.mountpoint = "none", - this.filesystem = "", + this.filesystem = "don't format", }); } diff --git a/lib/functions/install.dart b/lib/functions/install.dart index 4b0ca6d..6ca055a 100644 --- a/lib/functions/install.dart +++ b/lib/functions/install.dart @@ -11,34 +11,44 @@ test(setOutput, running, setRunning, config, writeToLog) async { await File(filename).writeAsString(config); writeToLog("Json config: $config"); var process = - await Process.start('pkexec', ['/opt/jade_gui/scripts/jadewrapper.sh']); - //await Process.start('/opt/jade_gui/scripts/jadeemu.sh', []); + //await Process.start('pkexec', ['/opt/jade_gui/scripts/jadewrapper.sh']); + await Process.start('/opt/jade_gui/scripts/jadeemu.sh', []); process.stdout.transform(utf8.decoder).forEach(setOutput); setRunning(true); } } Widget install( - Location locale, - String keymap, - String layout, - String username, - String password, - bool enableSudo, - String rootPass, - Desktop desktop, - String disk, - bool isEfi, - String bootloader, - String hostname, - bool ipv6, - bool enableTimeshift, - setOutput, - output, - running, - setRunning, - writeToLog, -) { + Location locale, + String keymap, + String layout, + String username, + String password, + bool enableSudo, + String rootPass, + Desktop desktop, + String disk, + bool isEfi, + String bootloader, + String hostname, + bool ipv6, + bool enableTimeshift, + setOutput, + output, + running, + setRunning, + writeToLog, + partitions, + manual) { + List partsParsed = []; + + for (var part in partitions) { + if (part.mountpoint != "none" && part.filesystem != "none") { + partsParsed + .add("${part.mountpoint}:${part.partition}:${part.filesystem}"); + } + } + InstallPrefs prefs = InstallPrefs( locale: locale, keymap: keymap, @@ -49,6 +59,8 @@ Widget install( rootPass: rootPass, desktop: desktop, disk: disk.replaceAll("/dev/", ""), + manualPartitioning: manual, + partitions: partsParsed, isEfi: isEfi, bootloader: bootloader, bootloaderLocation: isEfi ? "/boot/efi" : disk, diff --git a/lib/functions/partition.dart b/lib/functions/partition.dart index bba0b90..8cd4e3c 100644 --- a/lib/functions/partition.dart +++ b/lib/functions/partition.dart @@ -23,6 +23,7 @@ Widget partitioning( setPartitions, partitions, setPartitionMountPoint, + setFilesystem, ) { if (doManualPartitioning) { setRunningInfoMan(false); @@ -36,6 +37,7 @@ Widget partitioning( setPartitionMountPoint, setManual, next, + setFilesystem, ); } else { setRunningInfo(false); diff --git a/lib/functions/partitioning/manual.dart b/lib/functions/partitioning/manual.dart index 8aeb115..23a81e9 100644 --- a/lib/functions/partitioning/manual.dart +++ b/lib/functions/partitioning/manual.dart @@ -4,8 +4,7 @@ import 'package:flutter/material.dart'; import 'package:jade_gui/classes/partition.dart'; Widget partitionTemplate(partition, runningInfo, setRunningInfo, mountpoints, - setPartitionMountpoint) { - String mount = "none"; + setPartitionMountpoint, filesystems, setFilesystem) { if (partition().partition != "") { return Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, @@ -33,6 +32,7 @@ Widget partitionTemplate(partition, runningInfo, setRunningInfo, mountpoints, icon: const Icon(Icons.arrow_downward), elevation: 16, style: const TextStyle(color: Colors.deepPurple), + dropdownColor: const Color.fromARGB(255, 23, 23, 23), underline: Container( height: 2, color: Colors.deepPurpleAccent, @@ -40,14 +40,39 @@ Widget partitionTemplate(partition, runningInfo, setRunningInfo, mountpoints, onChanged: (String? newValue) { setPartitionMountpoint( partition(), newValue == "" ? "none" : newValue); - mount = newValue == "" ? "none" : newValue!; print(partition().mountpoint); }, items: mountpoints.map>((String value) { return DropdownMenuItem( value: value, - child: Text(value), + child: Text(value, + style: const TextStyle(color: Colors.white)), + ); + }).toList(), + ), + const SizedBox(width: 10), + DropdownButton( + value: partition().filesystem, + icon: const Icon(Icons.arrow_downward), + elevation: 16, + style: const TextStyle(color: Colors.deepPurple), + dropdownColor: const Color.fromARGB(255, 23, 23, 23), + underline: Container( + height: 2, + color: Colors.deepPurpleAccent, + ), + onChanged: (String? newValue) { + setFilesystem( + partition(), newValue == "" ? "none" : newValue); + print(partition().filesystem); + }, + items: + filesystems.map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value, + style: const TextStyle(color: Colors.white)), ); }).toList(), ), @@ -61,8 +86,20 @@ Widget partitionTemplate(partition, runningInfo, setRunningInfo, mountpoints, } } -Widget manualPartitioning(partitions, setState, runningPart, setRunningPart, - runningInfo, setRunningInfo, setPartitionMountpoint, setManual, next) { +/*mkfs.bfs mkfs.cramfs mkfs.ext3 mkfs.fat mkfs.msdos mkfs.xfs +mkfs.btrfs mkfs.ext2 mkfs.ext4 mkfs.minix mkfs.vfat */ + +Widget manualPartitioning( + partitions, + setState, + runningPart, + setRunningPart, + runningInfo, + setRunningInfo, + setPartitionMountpoint, + setManual, + next, + setFilesystem) { var mountpoints = [ "none", "/", @@ -74,6 +111,20 @@ Widget manualPartitioning(partitions, setState, runningPart, setRunningPart, "/usr", "/var" ]; + var filesystems = [ + "don't format", + "bfs", + "cramfs", + "ext3", + "fat", + "msdos", + "xfs", + "btrfs", + "ext2", + "ext4", + "minix", + "vfat" + ]; return Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -118,6 +169,8 @@ Widget manualPartitioning(partitions, setState, runningPart, setRunningPart, setRunningInfo, mountpoints, setPartitionMountpoint, + filesystems, + setFilesystem, ), ) .toList(), @@ -146,25 +199,23 @@ Widget manualPartitioning(partitions, setState, runningPart, setRunningPart, child: Column( children: [ const Text( - 'Currently chosen Disk: ', + 'Select partitions', style: TextStyle( fontSize: 20, fontWeight: FontWeight.bold, color: Color.fromARGB(255, 169, 0, 255), ), ), - const SizedBox(height: 10), const Text( - "selectedPartition", + 'to format', style: TextStyle( fontSize: 20, fontWeight: FontWeight.bold, color: Color.fromARGB(255, 169, 0, 255), ), ), - const SizedBox(height: 5), const Text( - 'Size: diskInfo', + 'and mount', style: TextStyle( fontSize: 20, fontWeight: FontWeight.bold, diff --git a/lib/functions/summary.dart b/lib/functions/summary.dart index a214263..6bcd01a 100644 --- a/lib/functions/summary.dart +++ b/lib/functions/summary.dart @@ -62,6 +62,7 @@ Widget summary( nextPage, running, setRunning, + partitions, ) { getDiskType(setDiskType, disk, running, setRunning); return Column( diff --git a/lib/main.dart b/lib/main.dart index 71f40de..507e242 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -644,18 +644,18 @@ class _JadeguiState extends State { partitions, (partition, value) { setState(() { - /*for (int i = 0; i < partitions.length; i++) { - if (partitions[i].partition == partition.partition) { - partitions[i].mountpoint = value; - print("moutnpoint: ${partitions[i].mountpoint}"); - print("partition: ${partitions[i].partition}"); - } - }*/ partition.mountpoint = value; print("moutnpoint: ${partition.mountpoint}"); print("partition: ${partition.partition}"); }); }, + (partition, value) { + setState(() { + partition.filesystem = value; + print("filesystem: ${partition.filesystem}"); + print("partition: ${partition.partition}"); + }); + }, ), ), ), @@ -714,6 +714,7 @@ class _JadeguiState extends State { runningSum = true; }); }, + partitions, ), ), ), @@ -758,6 +759,8 @@ class _JadeguiState extends State { }); }, writeToLog, + partitions, + manualPartitioning, ), ), ),