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') 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/example_config.json b/example_config.json index e8e5cf2..feb9cae 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,33 @@ "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": { + "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 +} diff --git a/src/args.rs b/src/args.rs index 0f42b06..46ffac7 100644 --- a/src/args.rs +++ b/src/args.rs @@ -45,6 +45,10 @@ pub enum Command { #[clap(name = "networking")] Networking(NetworkingArgs), + /// Set up zramd + #[clap(name = "zramd")] + Zram, + /// Configure users and passwords #[clap(name = "users")] Users { diff --git a/src/functions/base.rs b/src/functions/base.rs index da8c4fd..fc04fea 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!["zramd"]); + 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/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); 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(