From c0eef77d115721e929d38e7c3299362218278681 Mon Sep 17 00:00:00 2001 From: amy Date: Sun, 23 Jan 2022 18:00:27 +0100 Subject: [PATCH] try new password thing and add genfstab function --- README.md | 5 +++++ src/functions/base.rs | 7 +++++++ src/functions/desktops.rs | 9 ++++++++- src/functions/users.rs | 10 +++++++--- src/main.rs | 4 ++++ 5 files changed, 31 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0c0a403..7fde452 100755 --- a/README.md +++ b/README.md @@ -39,6 +39,11 @@ jade bootloader grub-efi /boot/efi jade bootloader grub-legacy /dev/sda ``` +### generate fstab +```sh +jade genfstab +``` + ### configuring locale settings ```sh # set the keyboard layout to colemak, the timezone to Europe/Berlin and set en_US.UTF-8 as the locale diff --git a/src/functions/base.rs b/src/functions/base.rs index bd82366..e9faace 100755 --- a/src/functions/base.rs +++ b/src/functions/base.rs @@ -23,6 +23,13 @@ pub fn install_base_packages() { ]); } +pub fn genfstab() { + exec_eval( + exec_chroot("genfstab", vec![String::from("-U"), String::from("/mnt")]), + "Generate fstab", + ); +} + pub fn install_bootloader_efi(efidir: &str) { install::install(vec!["grub", "efibootmgr"]); exec_eval( diff --git a/src/functions/desktops.rs b/src/functions/desktops.rs index d684a8d..573fa14 100755 --- a/src/functions/desktops.rs +++ b/src/functions/desktops.rs @@ -5,6 +5,7 @@ pub fn choose_pkgs(desktop_setup: &str) { match desktop_setup { "onyx" => { install(vec![ + "xorg", "onyx", "lightdm", "lightdm-gtk-greeter", @@ -12,10 +13,11 @@ pub fn choose_pkgs(desktop_setup: &str) { ]); } "gnome" => { - install(vec!["gnome", "gnome-tweaks", "chrome-gnome-shell", "gdm"]); + install(vec!["xorg", "gnome", "gnome-tweaks", "chrome-gnome-shell", "gdm",]); } "kde" => { install(vec![ + "xorg", "kde", "plasma", "plasma-wayland-session", @@ -25,6 +27,7 @@ pub fn choose_pkgs(desktop_setup: &str) { } "budgie" => { install(vec![ + "xorg", "budgie-desktop", "gnome", "lightdm", @@ -34,6 +37,7 @@ pub fn choose_pkgs(desktop_setup: &str) { } "cinnamon" => { install(vec![ + "xorg", "cinnamon", "lightdm", "lightdm-gtk-greeter", @@ -44,6 +48,7 @@ pub fn choose_pkgs(desktop_setup: &str) { } "mate" => { install(vec![ + "xorg", "mate", "lightdm", "lightdm-gtk-greeter", @@ -53,6 +58,7 @@ pub fn choose_pkgs(desktop_setup: &str) { } "xfce" => { install(vec![ + "xorg", "xfce4", "lightdm", "lightdm-gtk-greeter", @@ -62,6 +68,7 @@ pub fn choose_pkgs(desktop_setup: &str) { } "enlightenment" => { install(vec![ + "xorg", "enlightenment", "lightdm", "lightdm-gtk-greeter", diff --git a/src/functions/users.rs b/src/functions/users.rs index 61fee2a..cc119ec 100755 --- a/src/functions/users.rs +++ b/src/functions/users.rs @@ -30,11 +30,13 @@ pub fn new_user(username: &str, hasroot: bool, password: &str) { } exec_eval( exec_chroot( - "usermod", + "bash", vec![ + String::from("-c"), + String::from("usermod"), String::from("--password"), String::from("$(echo"), - format!("${}", password), + format!("${{{}}}", password), String::from("|"), String::from("openssl"), String::from("passwd"), @@ -51,8 +53,10 @@ pub fn root_pass(root_pass: &str) { println!("Setting root password to '{}'", root_pass); exec_eval( exec_chroot( - "usermod", + "bash", vec![ + String::from("-c"), + String::from("usermod"), String::from("--password"), String::from("$(echo"), format!("${{{}}}", root_pass), diff --git a/src/main.rs b/src/main.rs index 6930ebf..f358e3c 100755 --- a/src/main.rs +++ b/src/main.rs @@ -34,6 +34,10 @@ fn main() { SubCommand::with_name("install-base") .about("Install base packages") ) + .subcommand( + SubCommand::with_name("genfstab") + .about("Generate fstab") + ) .subcommand( SubCommand::with_name("bootloader") .about("Install bootloader")