From a8c610ea7a875796110e68661e3dd6b1f02ada8a Mon Sep 17 00:00:00 2001 From: Phillip Date: Sat, 7 Sep 2024 21:52:23 +0100 Subject: [PATCH] Clean up --- scripts/0-install.sh | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/scripts/0-install.sh b/scripts/0-install.sh index 37f0e48..1adcda5 100644 --- a/scripts/0-install.sh +++ b/scripts/0-install.sh @@ -22,6 +22,7 @@ esac # Get user credentials read -p "Please enter a username " username read -rsp "Please enter a password " password +echo -ne "\n" read -rsp "Please re-enter the password " passwordconfirm if [[ "$password" == "$password2" ]]; then export USERNAME = $username @@ -29,7 +30,7 @@ if [[ "$password" == "$password2" ]]; then echo "Credentials saved" fi # Run pacstrap and install base packages -pacstrap -i /mnt base base-devel linux linux-firmware linux-headers intel-ucode git openssh rsync networkmanager grub efibootmgr dosfstools os-prober nano dkms dbus-broker-units mkinitcpio iptables-nft --noconfirm --needed +pacstrap -i /mnt base base-devel linux linux-firmware rsync networkmanager grub efibootmgr dosfstools os-prober nano dkms dbus-broker-units mkinitcpio iptables-nft --noconfirm --needed # Create the /boot/efi directory and mount the EFI partition to it mkdir /mnt/boot/efi mount /dev/$efipar /mnt/boot/efi @@ -48,18 +49,8 @@ case $yesno in esac # Generate a fstab file genfstab -U /mnt >> /mnt/etc/fstab -# Copy system config files into the new install -#cp files/sys-environment /mnt/etc/environment -#cp files/sys-grub /mnt/etc/default/grub -#cp files/sys-hosts /mnt/etc/hosts -#cp files/sys-network.conf /etc/sysctl.d/90-network.conf -#cp files/sys-mkinitcpio.conf /etc/mkinitcpio.conf -# Create temporary directories to store files for later use -mkdir /mnt/buildscripts /mnt/userfiles -cp scripts/* /mnt/buildscripts -cp files/user-* /mnt/userfiles # Chroot into the new system and setup -arch-chroot /mnt /bin/bash +arch-chroot /mnt /bin/bash <> /etc/pacman.conf -# Run full pacman sync to enable extra repos pacman -Syu # Enable NetworkManager systemctl enable NetworkManager -# Install GRUB (this will need to be run again as the standard user in order to detect Windows) +# Install GRUB echo "Installing bootloader" grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB grub-mkconfig -o /boot/grub/grub.cfg -# Create the standard user and add it to all neccesary groups +# Create the standard user, add it to all neccesary groups and disable the root account useradd -mG power,storage,wheel $username echo "$username:$password" | chpasswd +passwd --lock root # Set up sudo sed -i 's/^# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers -# Disable the root account -passwd --lock root # Required to enable network changes sysctl --system # Prompt the user to reboot