mirror of
https://github.com/tommytran732/Arch-Setup-Script
synced 2024-11-22 01:21:34 -05:00
Silencing certain outputs.
This commit is contained in:
parent
b3ba0ac08d
commit
ac7d8980f9
36
easy-arch.sh
36
easy-arch.sh
@ -8,7 +8,7 @@ umount -R /mnt
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Setting up the correct time.
|
# Setting up the correct time.
|
||||||
timedatectl set-ntp true
|
timedatectl set-ntp true &>/dev/null
|
||||||
|
|
||||||
# Selecting the target for the installation.
|
# Selecting the target for the installation.
|
||||||
echo "Select the disk where Arch Linux is going to be installed."
|
echo "Select the disk where Arch Linux is going to be installed."
|
||||||
@ -24,8 +24,8 @@ read -r -p "This will delete the current partition table on $DISK. Do you agree
|
|||||||
response=${response,,}
|
response=${response,,}
|
||||||
if [[ "$response" =~ ^(yes|y)$ ]]
|
if [[ "$response" =~ ^(yes|y)$ ]]
|
||||||
then
|
then
|
||||||
wipefs -af $DISK
|
wipefs -af $DISK &>/dev/null
|
||||||
sgdisk -Zo $DISK
|
sgdisk -Zo $DISK &>/dev/null
|
||||||
else
|
else
|
||||||
echo "Quitting."
|
echo "Quitting."
|
||||||
exit
|
exit
|
||||||
@ -46,7 +46,7 @@ partprobe $DISK
|
|||||||
|
|
||||||
# Formatting the ESP as FAT32.
|
# Formatting the ESP as FAT32.
|
||||||
echo "Formatting the EFI Partition as FAT32."
|
echo "Formatting the EFI Partition as FAT32."
|
||||||
mkfs.fat -F 32 $ESP
|
mkfs.fat -F 32 $ESP &>/dev/null
|
||||||
|
|
||||||
# Creating a LUKS Container for the root partition.
|
# Creating a LUKS Container for the root partition.
|
||||||
echo "Creating LUKS Container for the root partition."
|
echo "Creating LUKS Container for the root partition."
|
||||||
@ -57,16 +57,16 @@ 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."
|
||||||
mkfs.btrfs $BTRFS
|
mkfs.btrfs $BTRFS &>/dev/null
|
||||||
mount $BTRFS /mnt
|
mount $BTRFS /mnt
|
||||||
|
|
||||||
# Creating BTRFS subvolumes.
|
# Creating BTRFS subvolumes.
|
||||||
echo "Creating BTRFS subvolumes."
|
echo "Creating BTRFS subvolumes."
|
||||||
btrfs su cr /mnt/@
|
btrfs su cr /mnt/@ &>/dev/null
|
||||||
btrfs su cr /mnt/@home
|
btrfs su cr /mnt/@home &>/dev/null
|
||||||
btrfs su cr /mnt/@snapshots
|
btrfs su cr /mnt/@snapshots &>/dev/null
|
||||||
btrfs su cr /mnt/@var_log
|
btrfs su cr /mnt/@var_log &>/dev/null
|
||||||
btrfs su cr /mnt/@swap
|
btrfs su cr /mnt/@swap &>/dev/null
|
||||||
|
|
||||||
# Mounting the newly created subvolumes.
|
# Mounting the newly created subvolumes.
|
||||||
umount /mnt
|
umount /mnt
|
||||||
@ -81,7 +81,7 @@ mount $ESP /mnt/boot
|
|||||||
|
|
||||||
# Pacstrap (setting up a base sytem onto the new root).
|
# Pacstrap (setting up a base sytem onto the new root).
|
||||||
echo "Installing the base sytem."
|
echo "Installing the base sytem."
|
||||||
pacstrap /mnt base linux linux-firmware btrfs-progs grub grub-btrfs efibootmgr snapper sudo neovim networkmanager
|
pacstrap /mnt base linux linux-firmware btrfs-progs grub grub-btrfs efibootmgr snapper sudo neovim networkmanager &>/dev/null
|
||||||
|
|
||||||
# Fstab generation.
|
# Fstab generation.
|
||||||
echo "Generating a new fstab."
|
echo "Generating a new fstab."
|
||||||
@ -127,16 +127,16 @@ then
|
|||||||
read -r -p "How much big should the swap file be? Type the size, just a number (eg: 1 = 1GB..): " swap
|
read -r -p "How much big should the swap file be? Type the size, just a number (eg: 1 = 1GB..): " swap
|
||||||
truncate -s 0 /mnt/swap/swapfile
|
truncate -s 0 /mnt/swap/swapfile
|
||||||
chattr +C /mnt/swap/swapfile
|
chattr +C /mnt/swap/swapfile
|
||||||
btrfs property set /mnt/swap/swapfile compression none
|
btrfs property set /mnt/swap/swapfile compression none &>/dev/null
|
||||||
dd if=/dev/zero of=/mnt/swap/swapfile bs=1G count=$swap status=progress
|
dd if=/dev/zero of=/mnt/swap/swapfile bs=1G count=$swap &>/dev/null
|
||||||
chmod 600 /mnt/swap/swapfile
|
chmod 600 /mnt/swap/swapfile
|
||||||
mkswap /mnt/swap/swapfile
|
mkswap /mnt/swap/swapfile &>/dev/null
|
||||||
swapon /mnt/swap/swapfile
|
swapon /mnt/swap/swapfile &>/dev/null
|
||||||
echo "/swap/swapfile none swap defaults 0 0" >> /mnt/etc/fstab
|
echo "/swap/swapfile none swap defaults 0 0" >> /mnt/etc/fstab
|
||||||
else
|
else
|
||||||
echo "Deleting BTRFS swap subvolume."
|
echo "Deleting BTRFS swap subvolume."
|
||||||
mount $BTRFS -o subvolid=5 /home
|
mount $BTRFS -o subvolid=5 /home
|
||||||
btrfs su de /home/@swap
|
btrfs su de /home/@swap &>/dev/null
|
||||||
umount -R /home
|
umount -R /home
|
||||||
echo "No swapfile has been added."
|
echo "No swapfile has been added."
|
||||||
fi
|
fi
|
||||||
@ -167,11 +167,11 @@ arch-chroot /mnt /bin/passwd
|
|||||||
|
|
||||||
# Enabling auto-trimming.
|
# Enabling auto-trimming.
|
||||||
echo "Enabling auto-trimming."
|
echo "Enabling auto-trimming."
|
||||||
systemctl enable fstrim.timer --root=/mnt
|
systemctl enable fstrim.timer --root=/mnt &>/dev/null
|
||||||
|
|
||||||
# Enabling NetworkManager.
|
# Enabling NetworkManager.
|
||||||
echo "Enabling NetworkManager."
|
echo "Enabling NetworkManager."
|
||||||
systemctl enable NetworkManager --root=/mnt
|
systemctl enable NetworkManager --root=/mnt &>/dev/null
|
||||||
|
|
||||||
# Unmounting partitions.
|
# Unmounting partitions.
|
||||||
echo "Unmounting /mnt."
|
echo "Unmounting /mnt."
|
||||||
|
Loading…
Reference in New Issue
Block a user