-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path0_system_setup.sh
More file actions
executable file
·60 lines (44 loc) · 1.9 KB
/
Copy path0_system_setup.sh
File metadata and controls
executable file
·60 lines (44 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
DOTFILES_DIR=$(dirname "$0")
if [[ ! -f $HOME/ran_0_script ]]; then
# Make your dnf fast as F**k boi
echo "max_parallel_downloads=10" | sudo tee -a /etc/dnf/dnf.conf
echo "fastestmirror=True" | sudo tee -a /etc/dnf/dnf.conf
# Update your system as fresh boi
sudo dnf update --refresh -y
################################################
# BEGIN actual grub-btrfs setup #
################################################
mkdir -pv "$HOME/dev/misc"
# Just in case git is not installed install it
sudo dnf install git -y
# Grub-Btrfs Timeshift snapshot booting
git clone https://github.com/Antynea/grub-btrfs "$HOME/dev/misc/grub-btrfs"
cd "$HOME/dev/misc/grub-btrfs" || return 1
# Configure it
sed -i 's/^#GRUB_BTRFS_GRUB_DIRNAME/GRUB_BTRFS_GRUB_DIRNAME/g' config
sed -i 's/^#GRUB_BTRFS_MKCONFIG=\/usr\/bin\/grub2-mkconfig/GRUB_BTRFS_MKCONFIG=\/usr\/sbin\/grub2-mkconfig/g' config
sed -i 's/^#GRUB_BTRFS_SCRIPT/GRUB_BTRFS_SCRIPT/g' config
sudo make install
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
sudo dnf install timeshift
echo "+----------------------------------------------------------------+"
echo "| Rebooting your system and you \"must\" run this script again |"
echo "+----------------------------------------------------------------+"
touch "$HOME/ran_0_script"
systemctl reboot
fi
sudo env SYSTEMD_EDITOR="cp $DOTFILES_DIR/grub-btrfs.path" systemctl edit --full grub-btrfs.path
# before enabling grub-btrfs.path must run timeshift atleast once
timeshift-launcher
sudo systemctl enable --now grub-btrfs.path
# Status of the service we just modified
systemctl status grub-btrfs.path
systemctl -t mount | grep run-timeshift-backup.mount
echo "Sleeping for 15 seconds to allow you look into the output"
rm "$HOME/ran_0_script"
sleep 15s
# Fastening Fedora a bit
# Stop NetworkManager-wait-online.service
systemctl disable NetworkManager-wait-online.service
exit