From 225b50839c87cc2bab153c6264cab79795934428 Mon Sep 17 00:00:00 2001 From: fawzakin Date: Thu, 2 Sep 2021 16:36:24 +0700 Subject: [PATCH 1/2] Ask for normal user account --- easy-arch.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/easy-arch.sh b/easy-arch.sh index af6b1f7..264c7f4 100644 --- a/easy-arch.sh +++ b/easy-arch.sh @@ -154,6 +154,9 @@ genfstab -U /mnt >> /mnt/etc/fstab read -r -p "Please enter the hostname: " hostname echo "$hostname" > /mnt/etc/hostname +# Setting username. +read -r -p "Please enter name for a user account (enter empty to not create one): " username + # Setting up locales. read -r -p "Please insert the locale you use (format: xx_XX): " locale echo "$locale.UTF-8 UTF-8" > /mnt/etc/locale.gen @@ -213,11 +216,19 @@ arch-chroot /mnt /bin/bash -e </dev/null + # Adding user with sudo privilege + if [ -n "$username" ]; then + echo "Adding $username with root privilege." + useradd -m $username + usermod -aG wheel $username + echo "$username ALL=(ALL) ALL" >> /etc/sudoers.d/$username + fi EOF # Setting root password. echo "Setting root password." arch-chroot /mnt /bin/passwd +[ -n "$username" ] && echo "Setting user password for ${username}." && arch-chroot /mnt /bin/passwd $username # Enabling Reflector timer. echo "Enabling Reflector." From 87eae2a5b35fdf4fb80feec2abef2873cbaf098b Mon Sep 17 00:00:00 2001 From: fawzakin Date: Thu, 2 Sep 2021 17:33:24 +0700 Subject: [PATCH 2/2] Fixed sed bug --- easy-arch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easy-arch.sh b/easy-arch.sh index 264c7f4..f6f9170 100644 --- a/easy-arch.sh +++ b/easy-arch.sh @@ -180,7 +180,7 @@ sed -i -e 's,modconf block filesystems keyboard,keyboard keymap modconf block en # Setting up LUKS2 encryption and apparmor. UUID=$(blkid $Cryptroot | cut -f2 -d'"') -sed -i "s/quiet/quiet cryptdevice=UUID=$UUID:cryptroot root=$BTRFS/g" /mnt/etc/default/grub +sed -i "s,quiet,quiet cryptdevice=UUID=$UUID:cryptroot root=$BTRFS,g" /mnt/etc/default/grub # Configuring the system. arch-chroot /mnt /bin/bash -e <