1
0
mirror of https://github.com/tommytran732/Arch-Setup-Script synced 2024-11-13 21:51:33 -05:00

Update install.sh

This commit is contained in:
TommyTran732 2021-04-23 14:17:41 +00:00 committed by tommytran732
parent db9af7f011
commit 532c8bfaac
No known key found for this signature in database
GPG Key ID: 060B29EB996BD9F2

View File

@ -96,25 +96,29 @@ btrfs subvolume create /mnt/@/boot &>/dev/null
btrfs subvolume create /mnt/@/home &>/dev/null btrfs subvolume create /mnt/@/home &>/dev/null
btrfs subvolume create /mnt/@/root &>/dev/null btrfs subvolume create /mnt/@/root &>/dev/null
btrfs subvolume create /mnt/@/var_log &>/dev/null btrfs subvolume create /mnt/@/var_log &>/dev/null
btrfs subvolume create /mnt/@/var_lib_gdm &>/dev/null
chattr +C /mnt/@/var_log
btrfs subvolume set-default $(btrfs subvolume list /mnt | grep "@/.snapshots/0/snapshot" | grep -oP '(?<=ID )[0-9]+') /mnt
# Mounting the newly created subvolumes. # Mounting the newly created subvolumes.
umount /mnt umount /mnt
echo "Mounting the newly created subvolumes." echo "Mounting the newly created subvolumes."
mount -o ssd,noatime,space_cache,compress=zstd:15,subvol=@ $BTRFS /mnt mount -o ssd,noatime,space_cache,compress=zstd:15 $BTRFS /mnt
mkdir -p /mnt/{home,.snapshots,/var/log,boot} mkdir -p /mnt/{boot,root,home,.snapshots,/var/log,/var/lib/gdm}
mount -o ssd,noatime,space_cache,compress=zstd:15,subvol=@/boot $BTRFS /mnt/boot mount -o ssd,noatime,space_cache,compress=zstd:15,subvol=@/boot $BTRFS /mnt/boot
mount -o ssd,noatime,space_cache,compress=zstd:15,subvol=@/root $BTRFS /mnt/root
mount -o ssd,noatime,space_cache.compress=zstd:15,subvol=@/home $BTRFS /mnt/home mount -o ssd,noatime,space_cache.compress=zstd:15,subvol=@/home $BTRFS /mnt/home
mount -o ssd,noatime,space_cache,compress=zstd:15,subvol=@/.snapshots $BTRFS /mnt/.snapshots mount -o ssd,noatime,space_cache,compress=zstd:15,subvol=@/.snapshots $BTRFS /mnt/.snapshots
mount -o ssd,noatime,space_cache,nodatacow,subvol=@/var_log $BTRFS /mnt/var/log mount -o ssd,noatime,space_cache,compress=zstd:15,nodatacow,subvol=@/var_log $BTRFS /mnt/var/log
chattr +C /mnt/var/log mount -o ssd,noatime,space_cache,compress=zstd:15,subvol=@/var_lib_gdm $BTRFS /mnt/var/lib/gdm
mkdir /mnt/boot/efi mkdir -p /mnt/boot/efi
mount $ESP /mnt/boot/efi mount $ESP /mnt/boot/efi
btrfs subvolume set-default $(btrfs subvolume list /mnt | grep "@/.snapshots/0/snapshot" | grep -oP '(?<=ID )[0-9]+') /mnt
kernel_selector kernel_selector
# Pacstrap (setting up a base sytem onto the new root). # Pacstrap (setting up a base sytem onto the new root).
echo "Installing the base system (it may take a while)." echo "Installing the base system (it may take a while)."
pacstrap /mnt base base-devel ${kernel} ${kernel}-headers ${microcode} linux-firmware btrfs-progs grub grub-btrfs snapper snap-pac os-prober efibootmgr sudo networkmanager apparmor pipewire nano gnome-shell gdm gnome-control-center gnome-terminal gnome-software gnome-tweaks nautilus flatpak xdg-user-dirs firewalld pacstrap /mnt base base-devel ${kernel} ${microcode} linux-firmware grub grub-btrfs snapper efibootmgr sudo networkmanager apparmor pipewire nano gnome-shell gdm gnome-control-center gnome-terminal gnome-software gnome-tweaks nautilus flatpak xdg-user-dirs firewalld
# Generating /etc/fstab. # Generating /etc/fstab.
echo "Generating a new fstab." echo "Generating a new fstab."
@ -189,6 +193,16 @@ arch-chroot /mnt /bin/bash -e <<EOF
chmod 600 /boot/initramfs-linux* &>/dev/null chmod 600 /boot/initramfs-linux* &>/dev/null
mkinitcpio -P &>/dev/null mkinitcpio -P &>/dev/null
# Snapper configuration
umount /.snapshots
rm -r /.snapshots
snapper --no-dbus -c root create-config /
btrfs subvolume delete /.snapshots
mkdir /.snapshots
mount -a
chmod 750 /.snapshots
systemctl enable grub-btrfs.path
# Installing GRUB. # Installing GRUB.
echo "Installing GRUB on /boot." echo "Installing GRUB on /boot."
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB &>/dev/null grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB &>/dev/null