Remove reliance of external files during setup.

This commit is contained in:
Phillip 2024-09-07 21:43:00 +01:00
parent 0495a69b7b
commit 617a51ccd4

View File

@ -29,7 +29,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
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
# Create the /boot/efi directory and mount the EFI partition to it
mkdir /mnt/boot/efi
mount /dev/$efipar /mnt/boot/efi
@ -49,19 +49,17 @@ esac
# Generate a fstab file
genfstab -U /mnt >> /mnt/etc/fstab
# Copy system config files into the new install
#cp files/sys-pacman.conf /mnt/etc/pacman.conf.tmp
#cp files/sys-locale.gen /mnt/etc/locale.gen
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
#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, do some setup based on earlier questions and run the next script
arch-chroot /mnt /bin/bash <<EOF
# Chroot into the new system and setup
arch-chroot /mnt /bin/bash
sed -i 's/^#en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
pacman -S --noconfirm hunspell-en_gb
@ -70,6 +68,8 @@ hwclock --systohc
echo LANG=en_GB.UTF-8 > /etc/locale.conf
echo "KEYMAP=uk" > /etc/vconsole.conf
echo archlinux > /etc/hostname
echo -e "127.0.0.1 localhost\n::1 localhost\n127.0.0.1 archlinux" >> /etc/hosts
echo -e "\n# Set terminal editor to Nano\nEDITOR=nano" >> /etc/environment
# Add "chaotic-aur" as a Pacman repository
pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
pacman-key --lsign-key 3056513887B78AEB
@ -79,7 +79,7 @@ pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorl
sed -i 's/^#Color/Color\nILoveCandy/' /etc/pacman.conf
sed -i 's/^#ParallelDownloads/ParallelDownloads/' /etc/pacman.conf
sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf
echo "[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist" >> /etc/pacman.conf
echo -e "\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist" >> /etc/pacman.conf
# Run full pacman sync to enable extra repos
pacman -Syu
# Enable NetworkManager