1
0
mirror of https://github.com/tommytran732/Arch-Setup-Script synced 2024-11-22 01:21:34 -05:00

Update install.sh

This commit is contained in:
TommyTran732 2021-04-23 12:38:54 -04:00 committed by tommytran732
parent 64e63a39f1
commit 2cf7ba80b3
No known key found for this signature in database
GPG Key ID: 060B29EB996BD9F2

View File

@ -90,8 +90,9 @@ mount $BTRFS /mnt
echo "Creating BTRFS subvolumes." echo "Creating BTRFS subvolumes."
btrfs subvolume create /mnt/@ &>/dev/null btrfs subvolume create /mnt/@ &>/dev/null
btrfs subvolume create /mnt/@/.snapshots &>/dev/null btrfs subvolume create /mnt/@/.snapshots &>/dev/null
mkdir /mnt/@/.snapshots/0 &>/dev/null mkdir -p /mnt/@/.snapshots/1 &>/dev/null
btrfs subvolume create /mnt/@/.snapshots/1/snapshot &>/dev/null btrfs subvolume create /mnt/@/.snapshots/1/snapshot &>/dev/null
mkdir -p /mnt/@/boot
btrfs subvolume create /mnt/@/boot/grub/ &>/dev/null btrfs subvolume create /mnt/@/boot/grub/ &>/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
@ -113,9 +114,20 @@ chattr +C /mnt/@/var_crash
chattr +C /mnt/@/var_cache chattr +C /mnt/@/var_cache
chattr +C /mnt/@/var_tmp chattr +C /mnt/@/var_tmp
chattr +C /mnt/@/var_spool chattr +C /mnt/@/var_spool
chattr +C /mnt/@/var_lib_libvirt_iamges chattr +C /mnt/@/var_lib_libvirt_images
btrfs subvolume set-default $(btrfs subvolume list /mnt | grep "@/.snapshots/1/snapshot" | grep -oP '(?<=ID )[0-9]+') /mnt btrfs subvolume set-default $(btrfs subvolume list /mnt | grep "@/.snapshots/1/snapshot" | grep -oP '(?<=ID )[0-9]+') /mnt
cat << EOF >> /mnt/@/.snapshots/1/info.xml
<?xml version="1.0"?>
<snapshot>
<type>single</type>
<num>1</num>
<description>First Root Filesystem</description>
</snapshot>
EOF
chmod 600 /mnt/@/.snapshots/1/info.xml
# 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."
@ -138,6 +150,8 @@ mount -o ssd,noatime,space_cache,compress=zstd:15,subvol=@/var_lib_libvirt_image
mkdir -p /mnt/boot/efi mkdir -p /mnt/boot/efi
mount $ESP /mnt/boot/efi mount $ESP /mnt/boot/efi
kernel_selector kernel_selector
# Pacstrap (setting up a base sytem onto the new root). # Pacstrap (setting up a base sytem onto the new root).
@ -232,8 +246,9 @@ arch-chroot /mnt /bin/bash -e <<EOF
# 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
sed -i 's#"rootflags=subvol=${rootsubvol}##g' /etc/grub.d/10_linux sed -i 's#"rootflags=subvol=${rootsubvol}"##g' /etc/grub.d/10_linux
sed -i 's#"rootflags=subvol=${rootsubvol}##g' /etc/grub.d/20_linux_xen sed -i 's#"rootflags=subvol=${rootsubvol}"##g' /etc/grub.d/20_linux_xen
pacman -S --noconfirm snap-pac
# Creating grub config file. # Creating grub config file.
echo "Creating GRUB config file." echo "Creating GRUB config file."