1
0
mirror of https://github.com/tommytran732/Arch-Setup-Script synced 2024-09-19 23:24:42 -04:00

Improving code.

This commit is contained in:
Tommaso Chiti 2021-02-07 09:45:21 +01:00
parent fa1df31e1a
commit 292a669224

View File

@ -50,7 +50,7 @@ echo "Creating LUKS Container for the root partition."
cryptsetup --type luks1 luksFormat $Cryptroot cryptsetup --type luks1 luksFormat $Cryptroot
echo "Opening the newly created LUKS Container." echo "Opening the newly created LUKS Container."
cryptsetup open $Cryptroot cryptroot cryptsetup open $Cryptroot cryptroot
BTRFS=/dev/mapper/cryptroot BTRFS="/dev/mapper/cryptroot"
# Formatting the LUKS Container as BTRFS. # Formatting the LUKS Container as BTRFS.
echo "Formatting the LUKS container as BTRFS." echo "Formatting the LUKS container as BTRFS."
@ -80,7 +80,7 @@ mount $ESP /mnt/boot
echo "Installing the base system (it may take a while)." echo "Installing the base system (it may take a while)."
pacstrap /mnt base linux linux-firmware btrfs-progs grub grub-btrfs efibootmgr snapper sudo neovim networkmanager &>/dev/null pacstrap /mnt base linux linux-firmware btrfs-progs grub grub-btrfs efibootmgr snapper sudo neovim networkmanager &>/dev/null
# Fstab generation. # Generating /etc/fstab.
echo "Generating a new fstab." echo "Generating a new fstab."
genfstab -U /mnt >> /mnt/etc/fstab genfstab -U /mnt >> /mnt/etc/fstab
@ -141,7 +141,7 @@ else
fi fi
# Configuring the system. # Configuring the system.
arch-chroot /mnt /bin/bash -e <<"EOF" arch-chroot /mnt /bin/bash -e <<EOF
# Setting up clock. # Setting up clock.
hwclock --systohc hwclock --systohc
@ -177,21 +177,18 @@ EOF
echo "Setting root password." echo "Setting root password."
arch-chroot /mnt /bin/passwd arch-chroot /mnt /bin/passwd
# Enabling auto-trimming. # Enabling auto-trimming service.
echo "Enabling auto-trimming." echo "Enabling auto-trimming."
systemctl enable fstrim.timer --root=/mnt &>/dev/null systemctl enable fstrim.timer --root=/mnt &>/dev/null
# Enabling NetworkManager. # Enabling NetworkManager service.
echo "Enabling NetworkManager." echo "Enabling NetworkManager."
systemctl enable NetworkManager --root=/mnt &>/dev/null systemctl enable NetworkManager --root=/mnt &>/dev/null
# Enabling Snapper. # Enabling Snapper automatic snapshots.
echo "Enabling Snapper." echo "Enabling Snapper."
systemctl enable snapper-timeline.timer --root=/mnt &>/dev/null systemctl enable snapper-timeline.timer --root=/mnt &>/dev/null
systemctl enable snapper-cleanup.timer --root=/mnt &>/dev/null systemctl enable snapper-cleanup.timer --root=/mnt &>/dev/null
# Unmounting partitions. echo "Done, you may now wish to reboot (further changes can be done by chrooting into /mnt)."
echo "Unmounting /mnt."
umount -R /mnt
echo "Done, you may now wish to reboot."
exit exit