Clean up
This commit is contained in:
parent
9ce0294d14
commit
81cabbcd63
@ -10,7 +10,7 @@ mkfs.ext4 /dev/$rootpar
|
|||||||
# Mount root partition
|
# Mount root partition
|
||||||
mount /dev/$rootpar /mnt
|
mount /dev/$rootpar /mnt
|
||||||
# Ask if the EFI partition should be wiped before mounting
|
# Ask if the EFI partition should be wiped before mounting
|
||||||
read -p "Do you wish to wipe the EFI partition? If you already have an existing OS installed, type 'No': " yesno
|
read -p "Do you wish to wipe the EFI partition? " yesno
|
||||||
case $yesno in
|
case $yesno in
|
||||||
[yesYesYy]* )
|
[yesYesYy]* )
|
||||||
mkfs.fat -F32 /dev/$efipar
|
mkfs.fat -F32 /dev/$efipar
|
||||||
@ -47,6 +47,7 @@ read -p "Please enter a username " username
|
|||||||
read -rsp "Please enter a password " password
|
read -rsp "Please enter a password " password
|
||||||
echo -ne "\n"
|
echo -ne "\n"
|
||||||
read -rsp "Please re-enter the password " passwordconfirm
|
read -rsp "Please re-enter the password " passwordconfirm
|
||||||
|
echo -ne "\n"
|
||||||
if [[ "$password" == "$password2" ]]; then
|
if [[ "$password" == "$password2" ]]; then
|
||||||
export USERNAME = $username
|
export USERNAME = $username
|
||||||
export PASSWORD = $password
|
export PASSWORD = $password
|
||||||
@ -64,6 +65,7 @@ fi
|
|||||||
genfstab -U /mnt >> /mnt/etc/fstab
|
genfstab -U /mnt >> /mnt/etc/fstab
|
||||||
# Chroot into the new system and setup
|
# Chroot into the new system and setup
|
||||||
arch-chroot /mnt /bin/bash <<EOF
|
arch-chroot /mnt /bin/bash <<EOF
|
||||||
|
# Set up user locale (date/time, keyboard layout)
|
||||||
sed -i 's/^#en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen
|
sed -i 's/^#en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen
|
||||||
locale-gen
|
locale-gen
|
||||||
pacman -S --noconfirm hunspell-en_gb
|
pacman -S --noconfirm hunspell-en_gb
|
||||||
@ -71,19 +73,22 @@ ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
|
|||||||
hwclock --systohc
|
hwclock --systohc
|
||||||
echo LANG=en_GB.UTF-8 > /etc/locale.conf
|
echo LANG=en_GB.UTF-8 > /etc/locale.conf
|
||||||
echo "KEYMAP=uk" > /etc/vconsole.conf
|
echo "KEYMAP=uk" > /etc/vconsole.conf
|
||||||
|
# Set host information
|
||||||
echo archlinux > /etc/hostname
|
echo archlinux > /etc/hostname
|
||||||
echo -e "\n127.0.0.1 localhost\n::1 localhost\n127.0.0.1 archlinux" >> /etc/hosts
|
echo -e "\n127.0.0.1 localhost\n::1 localhost\n127.0.0.1 archlinux" >> /etc/hosts
|
||||||
|
# Set up environment file
|
||||||
echo -e "\n# Set terminal editor to Nano\nEDITOR=nano" >> /etc/environment
|
echo -e "\n# Set terminal editor to Nano\nEDITOR=nano" >> /etc/environment
|
||||||
# Add "chaotic-aur" as a Pacman repository
|
# Add "chaotic-aur" as a Pacman repository
|
||||||
pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
|
pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
|
||||||
pacman-key --lsign-key 3056513887B78AEB
|
pacman-key --lsign-key 3056513887B78AEB
|
||||||
pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst'
|
pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst'
|
||||||
pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
|
pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
|
||||||
# Amend pacman.conf and run full sync to enable extra repos
|
# Amend pacman.conf to preference
|
||||||
sed -i 's/^#Color/Color\nILoveCandy/' /etc/pacman.conf
|
sed -i 's/^#Color/Color\nILoveCandy/' /etc/pacman.conf
|
||||||
sed -i 's/^#ParallelDownloads/ParallelDownloads/' /etc/pacman.conf
|
sed -i 's/^#ParallelDownloads/ParallelDownloads/' /etc/pacman.conf
|
||||||
sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf
|
sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf
|
||||||
echo -e "\n[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
|
||||||
|
# Do a full sync on Pacman to enable extra repos
|
||||||
pacman -Syu
|
pacman -Syu
|
||||||
# Enable NetworkManager
|
# Enable NetworkManager
|
||||||
systemctl enable NetworkManager
|
systemctl enable NetworkManager
|
||||||
@ -91,13 +96,15 @@ systemctl enable NetworkManager
|
|||||||
echo "Installing bootloader"
|
echo "Installing bootloader"
|
||||||
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
|
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
|
||||||
grub-mkconfig -o /boot/grub/grub.cfg
|
grub-mkconfig -o /boot/grub/grub.cfg
|
||||||
# Create the standard user, add it to all neccesary groups and disable the root account
|
# Create the standard user and add it to all neccesary groups
|
||||||
useradd -mG power,storage,wheel $username
|
useradd -mG power,storage,wheel $username
|
||||||
echo "$username:$password" | chpasswd
|
echo "$username:$password" | chpasswd
|
||||||
|
# Disable the option to log in as the root user
|
||||||
passwd --lock root
|
passwd --lock root
|
||||||
# Set up sudo
|
# Set up sudo so "wheel" group users can do root commands (password required)
|
||||||
sed -i 's/^# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers
|
sed -i 's/^# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers
|
||||||
# Required to enable network changes
|
# Required to enable network changes (not sure if this is neccesary)
|
||||||
sysctl --system
|
#sysctl --system
|
||||||
# Prompt the user to reboot
|
# Prompt the user to reboot
|
||||||
echo "Install complete, please reboot"
|
echo "Install complete, please reboot"
|
||||||
|
EOF
|
Loading…
Reference in New Issue
Block a user