From 2cf7ba80b31171edcce473b54a02bdca9c593102 Mon Sep 17 00:00:00 2001
From: TommyTran732 <57488583+tommytran732@users.noreply.github.com>
Date: Fri, 23 Apr 2021 12:38:54 -0400
Subject: [PATCH] Update install.sh
---
install.sh | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/install.sh b/install.sh
index 60b1232..deb78e3 100644
--- a/install.sh
+++ b/install.sh
@@ -90,8 +90,9 @@ mount $BTRFS /mnt
echo "Creating BTRFS subvolumes."
btrfs subvolume create /mnt/@ &>/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
+mkdir -p /mnt/@/boot
btrfs subvolume create /mnt/@/boot/grub/ &>/dev/null
btrfs subvolume create /mnt/@/home &>/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_tmp
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
+cat << EOF >> /mnt/@/.snapshots/1/info.xml
+
+
+ single
+ 1
+ First Root Filesystem
+
+EOF
+
+chmod 600 /mnt/@/.snapshots/1/info.xml
+
# Mounting the newly created subvolumes.
umount /mnt
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
mount $ESP /mnt/boot/efi
+
+
kernel_selector
# Pacstrap (setting up a base sytem onto the new root).
@@ -232,8 +246,9 @@ arch-chroot /mnt /bin/bash -e </dev/null
- 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/10_linux
+ sed -i 's#"rootflags=subvol=${rootsubvol}"##g' /etc/grub.d/20_linux_xen
+ pacman -S --noconfirm snap-pac
# Creating grub config file.
echo "Creating GRUB config file."