From 33298ebf1d0ced006b163d4af593d53cac0c9bf9 Mon Sep 17 00:00:00 2001 From: axtloss Date: Sun, 21 Aug 2022 10:31:49 +0000 Subject: [PATCH 1/6] Add zramd option --- src/args.rs | 4 ++++ src/functions/base.rs | 11 +++++++++++ src/functions/desktops.rs | 4 ++-- src/main.rs | 3 +++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/args.rs b/src/args.rs index 0f42b06..7a57073 100644 --- a/src/args.rs +++ b/src/args.rs @@ -45,6 +45,10 @@ pub enum Command { #[clap(name = "networking")] Networking(NetworkingArgs), + /// Set up zram + #[clap(name = "zram")] + Zram, + /// Configure users and passwords #[clap(name = "users")] Users { diff --git a/src/functions/base.rs b/src/functions/base.rs index da8c4fd..729b303 100755 --- a/src/functions/base.rs +++ b/src/functions/base.rs @@ -166,3 +166,14 @@ pub fn install_flatpak() { "add flathub remote", ) } + +pub fn install_zram() { + install(vec!["zram"]); + exec_eval( + exec_chroot( + "systemctl", + vec![String::from("enable"), String::from("zramd")], + ), + "Enable zramd service", + ); +} diff --git a/src/functions/desktops.rs b/src/functions/desktops.rs index cdeb4ed..9d11f00 100755 --- a/src/functions/desktops.rs +++ b/src/functions/desktops.rs @@ -287,7 +287,7 @@ fn install_gnome() { enable_dm("gdm"); } -fn install_onyx() { +/*fn install_onyx() { install(vec![ "xorg", "onyx", @@ -304,7 +304,7 @@ fn install_onyx() { "Add lightdm greeter", ); enable_dm("lightdm"); -} +}*/ fn enable_dm(dm: &str) { log::debug!("Enabling {}", dm); diff --git a/src/main.rs b/src/main.rs index 3925e73..5236803 100755 --- a/src/main.rs +++ b/src/main.rs @@ -51,6 +51,9 @@ fn main() { } network::set_hostname(&args.hostname); } + Command::Zram => { + base::install_zram(); + } Command::Users { subcommand } => match subcommand { UsersSubcommand::NewUser(args) => { users::new_user( From 5e6ea97aba424ca682819bb6c6e00a2e59327352 Mon Sep 17 00:00:00 2001 From: axtloss Date: Sun, 21 Aug 2022 10:48:52 +0000 Subject: [PATCH 2/6] Fix zramd package name and add zramd to config --- src/functions/base.rs | 2 +- src/internal/config.rs | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/functions/base.rs b/src/functions/base.rs index 729b303..fc04fea 100755 --- a/src/functions/base.rs +++ b/src/functions/base.rs @@ -168,7 +168,7 @@ pub fn install_flatpak() { } pub fn install_zram() { - install(vec!["zram"]); + install(vec!["zramd"]); exec_eval( exec_chroot( "systemctl", diff --git a/src/internal/config.rs b/src/internal/config.rs index 5a2212b..ed145c5 100755 --- a/src/internal/config.rs +++ b/src/internal/config.rs @@ -16,6 +16,7 @@ struct Config { desktop: String, timeshift: bool, flatpak: bool, + zramd: bool, extra_packages: Vec, unakite: Unakite, kernel: String, @@ -135,6 +136,12 @@ pub fn read_config(configpath: PathBuf) { } println!(); println!("---------"); + log::info!("Enabling zramd : {}", config.zramd); + if config.zramd { + base::install_zram(); + } + println!(); + println!("---------"); for i in 0..config.users.len() { log::info!("Creating user : {}", config.users[i].name); log::info!("Setting use password : {}", config.users[i].password); From 38248b183f1076e1fd9008744bb4a3369a17c7d3 Mon Sep 17 00:00:00 2001 From: axtloss Date: Sun, 21 Aug 2022 10:50:24 +0000 Subject: [PATCH 3/6] Update readme --- README.md | 6 ++++++ src/args.rs | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index eb1f57d..c5cf568 100755 --- a/README.md +++ b/README.md @@ -61,6 +61,12 @@ jade networking getcryst.al jade networking getcryst.al --ipv6 ``` +### setup zramd +```sh +# install and enable zramd +jade zramd +``` + ### configure users ```sh # make a new user called nonRootHaver, without sudo, easytohack as the password and bash as the default shell diff --git a/src/args.rs b/src/args.rs index 7a57073..46ffac7 100644 --- a/src/args.rs +++ b/src/args.rs @@ -45,8 +45,8 @@ pub enum Command { #[clap(name = "networking")] Networking(NetworkingArgs), - /// Set up zram - #[clap(name = "zram")] + /// Set up zramd + #[clap(name = "zramd")] Zram, /// Configure users and passwords From abf4a9b664e3c03ffa285d211414c8abdbfbf116 Mon Sep 17 00:00:00 2001 From: axtloss Date: Tue, 23 Aug 2022 14:07:53 +0200 Subject: [PATCH 4/6] update example config to reflect newest changes Signed-off-by: axtloss --- example_config.json | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/example_config.json b/example_config.json index e8e5cf2..0ac7dd1 100755 --- a/example_config.json +++ b/example_config.json @@ -2,11 +2,15 @@ "partition": { "device": "sda", "mode": "auto", - "efi": true + "efi": true, + "partitions": [ + "/home:sdb:btrfs" // This would be disk /dev/sdb, formatted with btrfs mounted at /home + ] // this is only needed for manual partitioning, it would contain all the partitions for jade to use and the filesystem as well as mountpoint + // Note that the mountpoint has the root at the installation destination, so instead of /mnt/boot it would be /boot }, "bootloader": { - "type": "grub-efi", - "location": "/boot/efi" + "type": "grub-efi", // for legacy this would be grub-legacy + "location": "/boot/efi" // for efi this is the esp directory, for legacy boot this would be the device on which to install grub on }, "locale": { "locale": [ @@ -22,22 +26,27 @@ "users": [ { "name": "jade", - "password": "jade", - "hasroot": true + "password": "TaCVRgYCAHag6", // The password has to be encrypted with `openssl passwd -crypt ` + "hasroot": true, + "shell": "bash" // this can be either bash, csh, fish, tcsh or zsh. If a value is not recognized the default will be bash }, - { + { // Multiple users can be specified by just following this format "name": "jade2", - "password": "jade2", - "hasroot": false + "password": "TzSMi3EezsXZM", + "hasroot": false, + "shell": "fish" } - ], - "rootpass": "jaderoot", - "desktop": "onyx", - "timeshift": true, + ], + "rootpass": "3IwCDE/t39wuQ", // Same as other passwords, this has to be encrypted with `openssl passwd -crypt ` + "desktop": "onyx", // The desktop environment to install can be onyx, gnome, kde, mate, cinnamon, xfce, budgie, enlightenment, etc. for a full list check https://github.com/crystal-linux/jade/blob/main/src/internal/config.rs#L162 + "timeshift": true, // Whether to enable timeshift as well as timeshift-autosnap, note that this may only work with root on btrfs + "zramd": true, // Whether to enable zramd "extra_packages": [ "firefox", "vim", "git", "tmux" - ] -} \ No newline at end of file + ], + "unakite": false, // Whether to install the recorvery partition, note that this currently is just a secondary smaller crystal installation + "kernel": "linux" // which kernel to install, available options are linux, linux-zen, linux-lts, linux-hardened. When an unknown option is passed it will default to linux +} From 8dddaae5f4a48b5512737e8ab1bfb7d9fcb0e637 Mon Sep 17 00:00:00 2001 From: axtloss Date: Tue, 23 Aug 2022 14:10:14 +0200 Subject: [PATCH 5/6] Update PKGBUILD Signed-off-by: axtloss --- PKGBUILD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 51fcc10..d9f375c 100755 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,8 +1,8 @@ # Maintainer: Matt C pkgname=jade -pkgver=1.0.7 -pkgrel=3 +pkgver=1.0.8 +pkgrel=1 pkgdesc="Scriptable backend & TUI Installer for Crystal Linux" license=('GPL3') arch=('x86_64') From 7270543c6756d5c3cd2f5934b6a0beacb54b26d8 Mon Sep 17 00:00:00 2001 From: axtloss Date: Tue, 23 Aug 2022 14:31:47 +0200 Subject: [PATCH 6/6] Update example_config.json Signed-off-by: axtloss --- example_config.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/example_config.json b/example_config.json index 0ac7dd1..feb9cae 100755 --- a/example_config.json +++ b/example_config.json @@ -47,6 +47,12 @@ "git", "tmux" ], - "unakite": false, // Whether to install the recorvery partition, note that this currently is just a secondary smaller crystal installation + "unakite": { + "enable": false, // Whether to install the recorvery partition, note that this currently is just a secondary smaller crystal installation + "root": "/dev/sda2", // The root partition for unakite + "oldroot": "/dev/sda3", // The root partition that the main crystal installation uses + "efidir": "/boot/efi", // The esp mountpoint in unakite, note that this is only read when using it on an efi system + "bootdev": "/dev/sda1" // the partition for the boot/efi partition + }, "kernel": "linux" // which kernel to install, available options are linux, linux-zen, linux-lts, linux-hardened. When an unknown option is passed it will default to linux }