From 84551e2b6cb4430e57b5cbc5fd4f981f88f61b57 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Thu, 3 Oct 2024 12:17:40 +0300 Subject: [PATCH 01/28] Btrfs Assistant(+snapper), grub-btrfs Setup added Adds fedora-btrfs-assistant.sh, updates tab_data and documentation. --- .../fedora/fedora-btrfs-assistant.sh | 97 +++++++++++++++++++ core/tabs/system-setup/tab_data.toml | 6 ++ docs/userguide.md | 1 + 3 files changed, 104 insertions(+) create mode 100644 core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh new file mode 100644 index 000000000..179c24ed2 --- /dev/null +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -0,0 +1,97 @@ +#!/bin/sh -e + +. ../../common-script.sh + +# This script automates the installation and root snapshot configuration of Snapper and installs Grub-Btrfs on Fedora. Also installs python3-dnf-plugin-snapper package for automatic snapshots after dnf commands. + +# Check the root filesystem type +checkFs() { + fs_type=$(findmnt -n -o FSTYPE /) + if [ "$fs_type" != "btrfs" ]; then + printf "%b\n" "${RED}This operation can only be performed on a Btrfs filesystem.${RC}" + exit 1 + fi + printf "%b\n" "${GREEN}}Btrfs filesystem detected. Continuing with the operation...${RC}" +} + +# Install Btrfs-Assistant/snapper and dependencies +installBtrfsStack() { + if ! command_exists snapper; then + printf "%b\n" "${YELLOW}Installing btrfs-assistant/snapper and dependencies...${RC}" + case "$PACKAGER" in + dnf) + "$ESCALATION_TOOL" "$PACKAGER" install -y btrfs-assistant make inotify-tools python3-dnf-plugin-snapper git + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 + ;; + esac + else + printf "%b\n" "${GREEN}Snapper is already installed.${RC}" + exit 1 + fi +} + +# Create first snapper config for root and home and create new manual snapshots +configureSnapper() { + printf "%b\n" "${YELLOW}Creating snapper root config and taking the first root snapshot...${RC}" + snapper -c root create-config / && snapper -c root create --description "Manual Snapshot" + snapper -c home create-config /home && snapper -c home create --description "Manual Snapshot" + # Modifyling default timeline root config + "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_HOURLY="[^"]*"/TIMELINE_LIMIT_HOURLY="1"/' /etc/snapper/configs/root + "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_DAILY="[^"]*"/TIMELINE_LIMIT_DAILY="2"/' /etc/snapper/configs/root + "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_WEEKLY="[^"]*"/TIMELINE_LIMIT_WEEKLY="1"/' /etc/snapper/configs/root + "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_MONTHLY="[^"]*"/TIMELINE_LIMIT_MONTHLY="0"/' /etc/snapper/configs/root + "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_YEARLY="[^"]*"/TIMELINE_LIMIT_YEARLY="0"/' /etc/snapper/configs/root + # Modifyling default timeline for home config + "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_HOURLY="[^"]*"/TIMELINE_LIMIT_HOURLY="2"/' /etc/snapper/configs/home + "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_DAILY="[^"]*"/TIMELINE_LIMIT_DAILY="1"/' /etc/snapper/configs/home + "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_WEEKLY="[^"]*"/TIMELINE_LIMIT_WEEKLY="0"/' /etc/snapper/configs/home + "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_MONTHLY="[^"]*"/TIMELINE_LIMIT_MONTHLY="1"/' /etc/snapper/configs/home + "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_YEARLY="[^"]*"/TIMELINE_LIMIT_YEARLY="0"/' /etc/snapper/configs/home +} + +# Check if the grub-btrfs dir exists before attempting to clone into it. +cloneGrubBtrfs() { + if [ -d "$HOME/grub-btrfs" ]; then + rm -rf "$HOME/grub-btrfs" + fi + cd "$HOME" && git clone https://github.com/Antynea/grub-btrfs +} + +# Install grub-btrfs +installGrubBtrfs() { + printf "%b\n" "${YELLOW}Installing grub-btrfs...${RC}" + cd "$HOME/grub-btrfs" + printf "%b\n" "${YELLOW}Modifying grub-btrfs configuration for Fedora...${RC}" + sed -i '/#GRUB_BTRFS_SNAPSHOT_KERNEL/a GRUB_BTRFS_SNAPSHOT_KERNEL_PARAMETERS="systemd.volatile=state"' config + sed -i '/#GRUB_BTRFS_GRUB_DIRNAME/a GRUB_BTRFS_GRUB_DIRNAME="/boot/grub2"' config + sed -i '/#GRUB_BTRFS_MKCONFIG=/a GRUB_BTRFS_MKCONFIG=/sbin/grub2-mkconfig' config + sed -i '/#GRUB_BTRFS_SCRIPT_CHECK=/a GRUB_BTRFS_SCRIPT_CHECK=grub2-script-check' config + "$ESCALATION_TOOL" make install + printf "%b\n" "${YELLOW}Cleaning up installation files...${RC}" + cd .. && rm -rf "$HOME/grub-btrfs" #deletes downloaded git folder +} + +# Starting services +serviceStartEnable() { + printf "%b\n" "${YELLOW}Starting and enabling snapper-timeline.timer and snapper-cleanup.timer services...${RC}" + systemctl start snapper-timeline.timer && systemctl enable snapper-timeline.timer #enables scheduled timeline snapshots + systemctl start snapper-cleanup.timer && systemctl enable snapper-cleanup.timer #enables scheduled snapshot cleanup + printf "%b\n" "${YELLOW}Restarting grub-btrfsd service...${RC}" + systemctl restart grub-btrfsd + printf "%b\n" "${YELLOW}Setup complete. Grub-btrfs and automatic snapshot configuration is now active.${RC}" + printf "%b\n" "${YELLOW}Notice: You can manage snapshots from the GUI with Btrfs Assistant.${RC}" + printf "%b\n" "${YELLOW}Notice: You may want to change (Hourly, daily, weekly, monthly, yearly) timeline settings via Btrfs Assistant GUI.${RC}" + printf "%b\n" "${YELLOW}Notice: To perform a system recovery via Grub-btrfs, after booting into your snapshot, do the 'restore' operation with the Btrfs Assistant GUI.${RC}" +} + +checkEnv +checkEscalationTool +checkFs +installBtrfsStack +configureSnapper +cloneGrubBtrfs +installGrubBtrfs +serviceStartEnable diff --git a/core/tabs/system-setup/tab_data.toml b/core/tabs/system-setup/tab_data.toml index 080c06d99..14005759f 100644 --- a/core/tabs/system-setup/tab_data.toml +++ b/core/tabs/system-setup/tab_data.toml @@ -65,6 +65,12 @@ description = "Enables Virtualization through dnf" script = "fedora/virtualization.sh" task_list = "I" +[[data.entries]] +name = "Btrfs Assistant(+snapper), grub-btrfs Setup" +description = "Installs Btrfs-Assistan/Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots\nInstalls Grub-Btrfs.\nEnables snapper-timeline and snapper-cleanup services.\nNotice: After installation you may want to change (Hourly, daily, weekly, monthly, yearly) timeline settings via Btrfs Assistant GUI.\nNotice: To perform a system recovery via Grub-btrfs, after the snapshot is booted, perform the restore operation with the Btrfs Assistant GUI.\nNotice: The /boot partition is in EXT4 format by default in Fedora, so it will not be included in the snapshots." +script = "fedora/fedora-btrfs-assistant.sh" +task_list = "I" + [[data]] name = "Build Prerequisites" description = "This script is designed to handle the installation of various software dependencies across different Linux distributions" diff --git a/docs/userguide.md b/docs/userguide.md index ede993313..17e9ba6ca 100644 --- a/docs/userguide.md +++ b/docs/userguide.md @@ -23,6 +23,7 @@ - **NVIDIA Proprietary Driver Setup**: Installs proprietary NVIDIA drivers for GPUs from 2014 or later. - **Virtualization Setup**: Installs virtualization tools. - **Configure DNF**: Optimizes DNF for better speeds. +- **Btrfs Assistant(+snapper), grub-btrfs Setup**: Installs Btrfs-Assistan/Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots. Enables snapper-timeline and snapper-cleanup services. Notice: After installation you may want to change (Hourly, daily, weekly, monthly, yearly) timeline settings via Btrfs Assistant GUI. Notice: To perform a system recovery via Grub-btrfs, after the snapshot is booted, perform the restore operation with the Btrfs Assistant GUI. Notice: The /boot partition is in EXT4 format by default in Fedora, so it will not be included in the snapshots. ## Applications Setup From 62ab2096fca52b4af8259bb9ee021d71baa18867 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Fri, 4 Oct 2024 01:10:52 +0300 Subject: [PATCH 02/28] updated doc, ta_data and sh --- .../fedora/fedora-btrfs-assistant.sh | 19 +++++++++++++------ core/tabs/system-setup/tab_data.toml | 2 +- docs/userguide.md | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index 179c24ed2..3cc0cf479 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -11,7 +11,7 @@ checkFs() { printf "%b\n" "${RED}This operation can only be performed on a Btrfs filesystem.${RC}" exit 1 fi - printf "%b\n" "${GREEN}}Btrfs filesystem detected. Continuing with the operation...${RC}" + printf "%b\n" "${GREEN}Btrfs filesystem detected. Continuing with the operation...${RC}" } # Install Btrfs-Assistant/snapper and dependencies @@ -20,7 +20,7 @@ installBtrfsStack() { printf "%b\n" "${YELLOW}Installing btrfs-assistant/snapper and dependencies...${RC}" case "$PACKAGER" in dnf) - "$ESCALATION_TOOL" "$PACKAGER" install -y btrfs-assistant make inotify-tools python3-dnf-plugin-snapper git + "$ESCALATION_TOOL" "$PACKAGER" install -y btrfs-assistant inotify-tools python3-dnf-plugin-snapper make git ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" @@ -35,9 +35,9 @@ installBtrfsStack() { # Create first snapper config for root and home and create new manual snapshots configureSnapper() { - printf "%b\n" "${YELLOW}Creating snapper root config and taking the first root snapshot...${RC}" - snapper -c root create-config / && snapper -c root create --description "Manual Snapshot" - snapper -c home create-config /home && snapper -c home create --description "Manual Snapshot" + printf "%b\n" "${YELLOW}Creating snapper root(/) and home config and taking the first snapshots...${RC}" + snapper -c root create-config / && snapper -c root create --description "First root Snapshot" + snapper -c home create-config /home && snapper -c home create --description "First home Snapshot" # Modifyling default timeline root config "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_HOURLY="[^"]*"/TIMELINE_LIMIT_HOURLY="1"/' /etc/snapper/configs/root "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_DAILY="[^"]*"/TIMELINE_LIMIT_DAILY="2"/' /etc/snapper/configs/root @@ -54,6 +54,7 @@ configureSnapper() { # Check if the grub-btrfs dir exists before attempting to clone into it. cloneGrubBtrfs() { + printf "%b\n" "${YELLOW}Downloading grub-btrfs...${RC}" if [ -d "$HOME/grub-btrfs" ]; then rm -rf "$HOME/grub-btrfs" fi @@ -81,10 +82,15 @@ serviceStartEnable() { systemctl start snapper-cleanup.timer && systemctl enable snapper-cleanup.timer #enables scheduled snapshot cleanup printf "%b\n" "${YELLOW}Restarting grub-btrfsd service...${RC}" systemctl restart grub-btrfsd - printf "%b\n" "${YELLOW}Setup complete. Grub-btrfs and automatic snapshot configuration is now active.${RC}" + printf "%b\n" "${GREEN}Installation completed. Grub-btrfs and automatic snapshot configuration is now active.${RC}" +} + +# Post install information +someNotices() { printf "%b\n" "${YELLOW}Notice: You can manage snapshots from the GUI with Btrfs Assistant.${RC}" printf "%b\n" "${YELLOW}Notice: You may want to change (Hourly, daily, weekly, monthly, yearly) timeline settings via Btrfs Assistant GUI.${RC}" printf "%b\n" "${YELLOW}Notice: To perform a system recovery via Grub-btrfs, after booting into your snapshot, do the 'restore' operation with the Btrfs Assistant GUI.${RC}" + printf "%b\n" "${CYAN}Notice: The /boot partition is in EXT4 format by default in Fedora, so it can't be included in the snapshots. Backup it seperately."${RC}" } checkEnv @@ -95,3 +101,4 @@ configureSnapper cloneGrubBtrfs installGrubBtrfs serviceStartEnable +someNotices diff --git a/core/tabs/system-setup/tab_data.toml b/core/tabs/system-setup/tab_data.toml index 14005759f..45cac1f4f 100644 --- a/core/tabs/system-setup/tab_data.toml +++ b/core/tabs/system-setup/tab_data.toml @@ -67,7 +67,7 @@ task_list = "I" [[data.entries]] name = "Btrfs Assistant(+snapper), grub-btrfs Setup" -description = "Installs Btrfs-Assistan/Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots\nInstalls Grub-Btrfs.\nEnables snapper-timeline and snapper-cleanup services.\nNotice: After installation you may want to change (Hourly, daily, weekly, monthly, yearly) timeline settings via Btrfs Assistant GUI.\nNotice: To perform a system recovery via Grub-btrfs, after the snapshot is booted, perform the restore operation with the Btrfs Assistant GUI.\nNotice: The /boot partition is in EXT4 format by default in Fedora, so it will not be included in the snapshots." +description = "Installs Btrfs-Assistan/Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots\nInstalls Grub-Btrfs.\nEnables snapper-timeline and snapper-cleanup services.\nNotice: To perform a system recovery via Grub-btrfs, after the snapshot is booted, restore with the Btrfs Assistant GUI.\nNotice: The /boot partition is in EXT4 format by default in Fedora, so it can't be included in the snapshots. Backup seperately." script = "fedora/fedora-btrfs-assistant.sh" task_list = "I" diff --git a/docs/userguide.md b/docs/userguide.md index 17e9ba6ca..f01ee75f3 100644 --- a/docs/userguide.md +++ b/docs/userguide.md @@ -23,7 +23,7 @@ - **NVIDIA Proprietary Driver Setup**: Installs proprietary NVIDIA drivers for GPUs from 2014 or later. - **Virtualization Setup**: Installs virtualization tools. - **Configure DNF**: Optimizes DNF for better speeds. -- **Btrfs Assistant(+snapper), grub-btrfs Setup**: Installs Btrfs-Assistan/Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots. Enables snapper-timeline and snapper-cleanup services. Notice: After installation you may want to change (Hourly, daily, weekly, monthly, yearly) timeline settings via Btrfs Assistant GUI. Notice: To perform a system recovery via Grub-btrfs, after the snapshot is booted, perform the restore operation with the Btrfs Assistant GUI. Notice: The /boot partition is in EXT4 format by default in Fedora, so it will not be included in the snapshots. +- **Btrfs Assistant(+snapper), grub-btrfs Setup**: Installs Btrfs-Assistan/Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots. Notice: The /boot partition is in EXT4 format by default in Fedora, so it can't be included in the snapshots. Backup it seperately. ## Applications Setup From f97639e0cbb2302536cc0870ca85fff171138176 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Fri, 4 Oct 2024 01:42:41 +0300 Subject: [PATCH 03/28] enable grub-btrfsd service added --- core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index 3cc0cf479..a734d3e4d 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -71,6 +71,9 @@ installGrubBtrfs() { sed -i '/#GRUB_BTRFS_MKCONFIG=/a GRUB_BTRFS_MKCONFIG=/sbin/grub2-mkconfig' config sed -i '/#GRUB_BTRFS_SCRIPT_CHECK=/a GRUB_BTRFS_SCRIPT_CHECK=grub2-script-check' config "$ESCALATION_TOOL" make install + # Update grub.cfg and enable grub-btrfsd service + printf "%b\n" "${YELLOW}Updating grub configuration and enabling grub-btrfsd service...${RC}" + "$ESCALATION_TOOL" grub2-mkconfig -o /boot/grub2/grub.cfg && systemctl enable --now grub-btrfsd.service printf "%b\n" "${YELLOW}Cleaning up installation files...${RC}" cd .. && rm -rf "$HOME/grub-btrfs" #deletes downloaded git folder } From 64b8a4fb86b1497a45a4e8b75cfaf798c4c368a6 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Fri, 4 Oct 2024 16:03:52 +0300 Subject: [PATCH 04/28] updated some wording in notices. --- core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh | 6 +++--- core/tabs/system-setup/tab_data.toml | 2 +- docs/userguide.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index a734d3e4d..06e041261 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -91,9 +91,9 @@ serviceStartEnable() { # Post install information someNotices() { printf "%b\n" "${YELLOW}Notice: You can manage snapshots from the GUI with Btrfs Assistant.${RC}" - printf "%b\n" "${YELLOW}Notice: You may want to change (Hourly, daily, weekly, monthly, yearly) timeline settings via Btrfs Assistant GUI.${RC}" - printf "%b\n" "${YELLOW}Notice: To perform a system recovery via Grub-btrfs, after booting into your snapshot, do the 'restore' operation with the Btrfs Assistant GUI.${RC}" - printf "%b\n" "${CYAN}Notice: The /boot partition is in EXT4 format by default in Fedora, so it can't be included in the snapshots. Backup it seperately."${RC}" + printf "%b\n" "${YELLOW}Notice: You may change (Hourly, daily, weekly, monthly, yearly) timeline settings via Btrfs Assistant GUI.${RC}" + printf "%b\n" "${YELLOW}Notice: To perform a system recovery via Grub-btrfs, after booting into your snapshot, do the 'restore' operation via Btrfs Assistant GUI.${RC}" + printf "%b\n" "${CYAN}Notice: If you used the default Fedora disk partitioning during OS installation, the /boot configured as an separate EXT4 partition. Therefore, it cannot be included in root snapshots. Backup separately...${RC}" } checkEnv diff --git a/core/tabs/system-setup/tab_data.toml b/core/tabs/system-setup/tab_data.toml index 45cac1f4f..b9665c9e0 100644 --- a/core/tabs/system-setup/tab_data.toml +++ b/core/tabs/system-setup/tab_data.toml @@ -67,7 +67,7 @@ task_list = "I" [[data.entries]] name = "Btrfs Assistant(+snapper), grub-btrfs Setup" -description = "Installs Btrfs-Assistan/Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots\nInstalls Grub-Btrfs.\nEnables snapper-timeline and snapper-cleanup services.\nNotice: To perform a system recovery via Grub-btrfs, after the snapshot is booted, restore with the Btrfs Assistant GUI.\nNotice: The /boot partition is in EXT4 format by default in Fedora, so it can't be included in the snapshots. Backup seperately." +description = "Installs Btrfs-Assistan/Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots\nInstalls Grub-Btrfs.\nEnables snapper-timeline and snapper-cleanup services.\nNotice: To perform a system recovery via Grub-btrfs, after the snapshot is booted, restore with the Btrfs Assistant GUI.\nNotice: If you used the default Fedora disk partitioning during OS installation, the /boot configured as an separate EXT4 partition. Therefore, it cannot be included in root snapshots. Backup separately." script = "fedora/fedora-btrfs-assistant.sh" task_list = "I" diff --git a/docs/userguide.md b/docs/userguide.md index f01ee75f3..99b4c1ec6 100644 --- a/docs/userguide.md +++ b/docs/userguide.md @@ -23,7 +23,7 @@ - **NVIDIA Proprietary Driver Setup**: Installs proprietary NVIDIA drivers for GPUs from 2014 or later. - **Virtualization Setup**: Installs virtualization tools. - **Configure DNF**: Optimizes DNF for better speeds. -- **Btrfs Assistant(+snapper), grub-btrfs Setup**: Installs Btrfs-Assistan/Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots. Notice: The /boot partition is in EXT4 format by default in Fedora, so it can't be included in the snapshots. Backup it seperately. +- **Btrfs Assistant(+snapper), grub-btrfs Setup**: Installs Btrfs-Assistan/Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots. Notice: The /boot configured as a separate EXT4 partition by default in Fedora, so it can't be included in the snapshots. Backup it seperately. ## Applications Setup From 6c1572dfe9f28ad614d9d9446a6f9fcd29b8e885 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sat, 5 Oct 2024 11:32:50 +0300 Subject: [PATCH 05/28] updated wording and add prompts for actions --- .../fedora/fedora-btrfs-assistant.sh | 108 ++++++++++++------ core/tabs/system-setup/tab_data.toml | 4 +- docs/userguide.md | 2 +- 3 files changed, 73 insertions(+), 41 deletions(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index 06e041261..8a006b925 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -16,11 +16,11 @@ checkFs() { # Install Btrfs-Assistant/snapper and dependencies installBtrfsStack() { - if ! command_exists snapper; then - printf "%b\n" "${YELLOW}Installing btrfs-assistant/snapper and dependencies...${RC}" + if ! command_exists btrfs-assistant; then + printf "%b\n" "${YELLOW}Installing Btrfs Assistant with snapper...${RC}" case "$PACKAGER" in dnf) - "$ESCALATION_TOOL" "$PACKAGER" install -y btrfs-assistant inotify-tools python3-dnf-plugin-snapper make git + "$ESCALATION_TOOL" "$PACKAGER" install -y btrfs-assistant ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" @@ -28,41 +28,83 @@ installBtrfsStack() { ;; esac else - printf "%b\n" "${GREEN}Snapper is already installed.${RC}" - exit 1 + printf "%b\n" "${GREEN}Btrfs Assistant is already installed.${RC}" fi } # Create first snapper config for root and home and create new manual snapshots configureSnapper() { + if command_exists snapper; then + printf "%b\n" "${YELLOW}Snapper tool detected. Do you want to configure root and home configs and take first snapshots? (y/n): ${RC}" + read -r response + case "$response" in + [yY]*) + ;; + *) + printf "%b\n" "${GREEN}Snapper configurations will not be changed.${RC}" + return + ;; + esac + else + "$ESCALATION_TOOL" "$PACKAGER" install -y snapper python3-dnf-plugin-snapper + fi printf "%b\n" "${YELLOW}Creating snapper root(/) and home config and taking the first snapshots...${RC}" snapper -c root create-config / && snapper -c root create --description "First root Snapshot" snapper -c home create-config /home && snapper -c home create --description "First home Snapshot" + printf "%b\n" "${YELLOW}Updating timeline settings...${RC}" # Modifyling default timeline root config - "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_HOURLY="[^"]*"/TIMELINE_LIMIT_HOURLY="1"/' /etc/snapper/configs/root - "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_DAILY="[^"]*"/TIMELINE_LIMIT_DAILY="2"/' /etc/snapper/configs/root - "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_WEEKLY="[^"]*"/TIMELINE_LIMIT_WEEKLY="1"/' /etc/snapper/configs/root - "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_MONTHLY="[^"]*"/TIMELINE_LIMIT_MONTHLY="0"/' /etc/snapper/configs/root - "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_YEARLY="[^"]*"/TIMELINE_LIMIT_YEARLY="0"/' /etc/snapper/configs/root + "$ESCALATION_TOOL" sed -i ' + s/^TIMELINE_LIMIT_HOURLY="[^"]*"/TIMELINE_LIMIT_HOURLY="1"/; + s/^TIMELINE_LIMIT_DAILY="[^"]*"/TIMELINE_LIMIT_DAILY="2"/; + s/^TIMELINE_LIMIT_WEEKLY="[^"]*"/TIMELINE_LIMIT_WEEKLY="1"/; + s/^TIMELINE_LIMIT_MONTHLY="[^"]*"/TIMELINE_LIMIT_MONTHLY="0"/; + s/^TIMELINE_LIMIT_YEARLY="[^"]*"/TIMELINE_LIMIT_YEARLY="0"/ + ' /etc/snapper/configs/root # Modifyling default timeline for home config - "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_HOURLY="[^"]*"/TIMELINE_LIMIT_HOURLY="2"/' /etc/snapper/configs/home - "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_DAILY="[^"]*"/TIMELINE_LIMIT_DAILY="1"/' /etc/snapper/configs/home - "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_WEEKLY="[^"]*"/TIMELINE_LIMIT_WEEKLY="0"/' /etc/snapper/configs/home - "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_MONTHLY="[^"]*"/TIMELINE_LIMIT_MONTHLY="1"/' /etc/snapper/configs/home - "$ESCALATION_TOOL" sed -i 's/^TIMELINE_LIMIT_YEARLY="[^"]*"/TIMELINE_LIMIT_YEARLY="0"/' /etc/snapper/configs/home + "$ESCALATION_TOOL" sed -i ' + s/^TIMELINE_LIMIT_HOURLY="[^"]*"/TIMELINE_LIMIT_HOURLY="2"/; + s/^TIMELINE_LIMIT_DAILY="[^"]*"/TIMELINE_LIMIT_DAILY="1"/; + s/^TIMELINE_LIMIT_WEEKLY="[^"]*"/TIMELINE_LIMIT_WEEKLY="0"/; + s/^TIMELINE_LIMIT_MONTHLY="[^"]*"/TIMELINE_LIMIT_MONTHLY="1"/; + s/^TIMELINE_LIMIT_YEARLY="[^"]*"/TIMELINE_LIMIT_YEARLY="0"/ + ' /etc/snapper/configs/home + printf "%b\n" "${GREEN}Snapper configs and first snapshots created.${RC}" + serviceStartEnable } -# Check if the grub-btrfs dir exists before attempting to clone into it. -cloneGrubBtrfs() { - printf "%b\n" "${YELLOW}Downloading grub-btrfs...${RC}" - if [ -d "$HOME/grub-btrfs" ]; then - rm -rf "$HOME/grub-btrfs" - fi - cd "$HOME" && git clone https://github.com/Antynea/grub-btrfs +# Starting services +serviceStartEnable() { + printf "%b\n" "${YELLOW}Starting and enabling snapper-timeline.timer and snapper-cleanup.timer services...${RC}" + systemctl start snapper-timeline.timer && systemctl enable snapper-timeline.timer #enables scheduled timeline snapshots + systemctl start snapper-cleanup.timer && systemctl enable snapper-cleanup.timer #enables scheduled snapshot cleanup + printf "%b\n" "${GREEN}Snapper services started and enabled.${RC}" +} + +# Ask user if they want to install grub-btrfs +askInstallGrubBtrfs() { + printf "%b\n" "${YELLOW}You can skip installing grub-btrfs and use only Btrfs Assistant GUI or snapper CLI.${RC}" + printf "%b\n" "${RED}grub-btrfs may cause problems on encrypted systems with secure boot/tpm. ${RC}" + printf "%b\n" "${YELLOW}Do you want to install grub-btrfs? (y/n): ${RC}" + read -r response + case "$response" in + [yY]*) + installGrubBtrfs + ;; + *) + printf "%b\n" "${GREEN}Skipping grub-btrfs installation.${RC}" + ;; + esac } # Install grub-btrfs installGrubBtrfs() { + # Check if the grub-btrfs dir exists before attempting to clone into it. + printf "%b\n" "${YELLOW}Downloading grub-btrfs and installing dependencies...${RC}" + if [ -d "$HOME/grub-btrfs" ]; then + rm -rf "$HOME/grub-btrfs" + fi + "$ESCALATION_TOOL" "$PACKAGER" install -y make git inotify-tools + cd "$HOME" && git clone https://github.com/Antynea/grub-btrfs printf "%b\n" "${YELLOW}Installing grub-btrfs...${RC}" cd "$HOME/grub-btrfs" printf "%b\n" "${YELLOW}Modifying grub-btrfs configuration for Fedora...${RC}" @@ -76,23 +118,15 @@ installGrubBtrfs() { "$ESCALATION_TOOL" grub2-mkconfig -o /boot/grub2/grub.cfg && systemctl enable --now grub-btrfsd.service printf "%b\n" "${YELLOW}Cleaning up installation files...${RC}" cd .. && rm -rf "$HOME/grub-btrfs" #deletes downloaded git folder -} - -# Starting services -serviceStartEnable() { - printf "%b\n" "${YELLOW}Starting and enabling snapper-timeline.timer and snapper-cleanup.timer services...${RC}" - systemctl start snapper-timeline.timer && systemctl enable snapper-timeline.timer #enables scheduled timeline snapshots - systemctl start snapper-cleanup.timer && systemctl enable snapper-cleanup.timer #enables scheduled snapshot cleanup - printf "%b\n" "${YELLOW}Restarting grub-btrfsd service...${RC}" - systemctl restart grub-btrfsd - printf "%b\n" "${GREEN}Installation completed. Grub-btrfs and automatic snapshot configuration is now active.${RC}" + printf "%b\n" "${GREEN}Grub-btrfs installed and service enabled.${RC}" + printf "%b\n" "${CYAN}Notice: To perform a system recovery via grub-btrfs, after booting into your snapshot, do the 'restore' operation via Btrfs Assistant GUI.${RC}" } # Post install information someNotices() { - printf "%b\n" "${YELLOW}Notice: You can manage snapshots from the GUI with Btrfs Assistant.${RC}" - printf "%b\n" "${YELLOW}Notice: You may change (Hourly, daily, weekly, monthly, yearly) timeline settings via Btrfs Assistant GUI.${RC}" - printf "%b\n" "${YELLOW}Notice: To perform a system recovery via Grub-btrfs, after booting into your snapshot, do the 'restore' operation via Btrfs Assistant GUI.${RC}" + printf "%b\n" "${GREEN}Notice: Setup process completed.${RC}" + printf "%b\n" "${YELLOW}Notice: You can manage snapshots from GUI with Btrfs Assistant or CLI with snapper.${RC}" + printf "%b\n" "${YELLOW}Notice: You may change (Hourly, daily, weekly, monthly, yearly) timeline settings with Btrfs Assistant GUI.${RC}" printf "%b\n" "${CYAN}Notice: If you used the default Fedora disk partitioning during OS installation, the /boot configured as an separate EXT4 partition. Therefore, it cannot be included in root snapshots. Backup separately...${RC}" } @@ -101,7 +135,5 @@ checkEscalationTool checkFs installBtrfsStack configureSnapper -cloneGrubBtrfs -installGrubBtrfs -serviceStartEnable +askInstallGrubBtrfs someNotices diff --git a/core/tabs/system-setup/tab_data.toml b/core/tabs/system-setup/tab_data.toml index b9665c9e0..0ff47dee4 100644 --- a/core/tabs/system-setup/tab_data.toml +++ b/core/tabs/system-setup/tab_data.toml @@ -66,8 +66,8 @@ script = "fedora/virtualization.sh" task_list = "I" [[data.entries]] -name = "Btrfs Assistant(+snapper), grub-btrfs Setup" -description = "Installs Btrfs-Assistan/Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots\nInstalls Grub-Btrfs.\nEnables snapper-timeline and snapper-cleanup services.\nNotice: To perform a system recovery via Grub-btrfs, after the snapshot is booted, restore with the Btrfs Assistant GUI.\nNotice: If you used the default Fedora disk partitioning during OS installation, the /boot configured as an separate EXT4 partition. Therefore, it cannot be included in root snapshots. Backup separately." +name = "Btrfs Assistant, Snapper Config, grub-btrfs" +description = "Installs Btrfs Assistant, Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots.\nEnables snapper-timeline and snapper-cleanup services.\n(Optionally)Installs Grub-Btrfs.\nTo perform a system recovery via grub-btrfs, do restore operation with Btrfs Assistant GUI after booting into snapshot.\nNotice: If you used the default Fedora disk partitioning during OS installation, the /boot configured as an separate EXT4 partition. Therefore, it cannot be included in root snapshots. Backup separately." script = "fedora/fedora-btrfs-assistant.sh" task_list = "I" diff --git a/docs/userguide.md b/docs/userguide.md index 99b4c1ec6..2ee441c21 100644 --- a/docs/userguide.md +++ b/docs/userguide.md @@ -23,7 +23,7 @@ - **NVIDIA Proprietary Driver Setup**: Installs proprietary NVIDIA drivers for GPUs from 2014 or later. - **Virtualization Setup**: Installs virtualization tools. - **Configure DNF**: Optimizes DNF for better speeds. -- **Btrfs Assistant(+snapper), grub-btrfs Setup**: Installs Btrfs-Assistan/Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots. Notice: The /boot configured as a separate EXT4 partition by default in Fedora, so it can't be included in the snapshots. Backup it seperately. +- **Btrfs Assistant, Snapper Config, grub-btrfs**: Installs Btrfs Assistant, Snapper, dnf snapper plugin and grub-btrfs. Creates snapper configs. Notice: The /boot configured as a separate EXT4 partition by default in Fedora, so it can't be included in the snapshots. Backup it seperately. ## Applications Setup From 8403042acae48f02bcedc3ce9bdca0ce3e181db9 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sat, 5 Oct 2024 16:47:16 +0300 Subject: [PATCH 06/28] added fix for a possible grub error also some more enhancements and wording improvements. --- .../fedora/fedora-btrfs-assistant.sh | 34 +++++++++++++++---- core/tabs/system-setup/tab_data.toml | 2 +- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index 8a006b925..86ddf01df 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -20,7 +20,7 @@ installBtrfsStack() { printf "%b\n" "${YELLOW}Installing Btrfs Assistant with snapper...${RC}" case "$PACKAGER" in dnf) - "$ESCALATION_TOOL" "$PACKAGER" install -y btrfs-assistant + "$ESCALATION_TOOL" "$PACKAGER" install -y btrfs-assistant python3-dnf-plugin-snapper ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" @@ -46,7 +46,7 @@ configureSnapper() { ;; esac else - "$ESCALATION_TOOL" "$PACKAGER" install -y snapper python3-dnf-plugin-snapper + "$ESCALATION_TOOL" "$PACKAGER" install -y snapper fi printf "%b\n" "${YELLOW}Creating snapper root(/) and home config and taking the first snapshots...${RC}" snapper -c root create-config / && snapper -c root create --description "First root Snapshot" @@ -83,7 +83,7 @@ serviceStartEnable() { # Ask user if they want to install grub-btrfs askInstallGrubBtrfs() { printf "%b\n" "${YELLOW}You can skip installing grub-btrfs and use only Btrfs Assistant GUI or snapper CLI.${RC}" - printf "%b\n" "${RED}grub-btrfs may cause problems on encrypted systems with secure boot/tpm. ${RC}" + printf "%b\n" "${RED}Notice: grub-btrfs may cause problems with booting into snapshots and other os on encrypted systems with secure boot/tpm. You will be asked to apply mitigation for this issue in next step.${RC}" printf "%b\n" "${YELLOW}Do you want to install grub-btrfs? (y/n): ${RC}" read -r response case "$response" in @@ -119,15 +119,37 @@ installGrubBtrfs() { printf "%b\n" "${YELLOW}Cleaning up installation files...${RC}" cd .. && rm -rf "$HOME/grub-btrfs" #deletes downloaded git folder printf "%b\n" "${GREEN}Grub-btrfs installed and service enabled.${RC}" - printf "%b\n" "${CYAN}Notice: To perform a system recovery via grub-btrfs, after booting into your snapshot, do the 'restore' operation via Btrfs Assistant GUI.${RC}" + printf "%b\n" "${CYAN}Notice: To perform a system recovery via grub-btrfs, perform a restore operation with Btrfs Assistant GUI after booting into the snapshot.${RC}" + # Ask user if they want to apply mitigation for "tpm.c:150:unknown TPM error" + printf "%b\n" "${YELLOW}Do you want to apply mitigation for 'tpm.c:150:unknown TPM error' on systems with secure boot/tpm? (y/n): ${RC}" + read -r response + case "$response" in + [yY]*) + mitigateTpmError + ;; + *) + printf "%b\n" "${GREEN}Skipping mitigation for 'tpm.c:150:unknown TPM error'.${RC}" + ;; + esac +} + +# Mitigation for "tpm.c:150:unknown TPM error" +mitigateTpmError() { + printf "%b\n" "${YELLOW}Applying mitigation for 'tpm.c:150:unknown TPM error'...${RC}" + printf "%b\n" "${YELLOW}Creating /etc/grub.d/02_tpm file...${RC}" + echo '#!/bin/sh' | "$ESCALATION_TOOL" tee /etc/grub.d/02_tpm > /dev/null + echo 'echo "rmmod tpm"' | "$ESCALATION_TOOL" tee -a /etc/grub.d/02_tpm > /dev/null + "$ESCALATION_TOOL" chmod +x /etc/grub.d/02_tpm #makes the file executable + "$ESCALATION_TOOL" grub2-mkconfig -o /boot/grub2/grub.cfg #updates grub config + printf "%b\n" "${GREEN}Mitigation applied and grub config updated.${RC}" } # Post install information someNotices() { - printf "%b\n" "${GREEN}Notice: Setup process completed.${RC}" printf "%b\n" "${YELLOW}Notice: You can manage snapshots from GUI with Btrfs Assistant or CLI with snapper.${RC}" printf "%b\n" "${YELLOW}Notice: You may change (Hourly, daily, weekly, monthly, yearly) timeline settings with Btrfs Assistant GUI.${RC}" - printf "%b\n" "${CYAN}Notice: If you used the default Fedora disk partitioning during OS installation, the /boot configured as an separate EXT4 partition. Therefore, it cannot be included in root snapshots. Backup separately...${RC}" + printf "%b\n" "${RED}Notice: If you used the default Fedora disk partitioning during OS installation, the /boot configured as an separate EXT4 partition. Therefore, it cannot be included in root snapshots. Backup separately...${RC}" + printf "%b\n" "${GREEN}Setup process completed.${RC}" } checkEnv diff --git a/core/tabs/system-setup/tab_data.toml b/core/tabs/system-setup/tab_data.toml index 0ff47dee4..8a9953b1a 100644 --- a/core/tabs/system-setup/tab_data.toml +++ b/core/tabs/system-setup/tab_data.toml @@ -67,7 +67,7 @@ task_list = "I" [[data.entries]] name = "Btrfs Assistant, Snapper Config, grub-btrfs" -description = "Installs Btrfs Assistant, Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots.\nEnables snapper-timeline and snapper-cleanup services.\n(Optionally)Installs Grub-Btrfs.\nTo perform a system recovery via grub-btrfs, do restore operation with Btrfs Assistant GUI after booting into snapshot.\nNotice: If you used the default Fedora disk partitioning during OS installation, the /boot configured as an separate EXT4 partition. Therefore, it cannot be included in root snapshots. Backup separately." +description = "Installs Btrfs Assistant, Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots.\nEnables snapper-timeline and snapper-cleanup services.\nInstalls Grub-Btrfs.\nNotice: To perform a system recovery via grub-btrfs, perform a restore operation with Btrfs Assistant GUI after booting into the snapshot.\nNotice: If you used the default Fedora disk partitioning during OS installation, the /boot configured as an separate EXT4 partition. Therefore, it cannot be included in root snapshots. Backup separately." script = "fedora/fedora-btrfs-assistant.sh" task_list = "I" From 38088f1d2fbb106778ff020f5ec5f5138fbc2492 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sat, 5 Oct 2024 18:55:56 +0300 Subject: [PATCH 07/28] user action removed reinstall snapper action removed because removing and reinstalling snapper is a very unlikely action. and also snapper can't handle ./snapsots folder in the disk after reinstalling: "creating btrfs subvolume .snapshots failed since it already exists". --- .../fedora/fedora-btrfs-assistant.sh | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index 86ddf01df..1e9fd85ef 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -34,20 +34,6 @@ installBtrfsStack() { # Create first snapper config for root and home and create new manual snapshots configureSnapper() { - if command_exists snapper; then - printf "%b\n" "${YELLOW}Snapper tool detected. Do you want to configure root and home configs and take first snapshots? (y/n): ${RC}" - read -r response - case "$response" in - [yY]*) - ;; - *) - printf "%b\n" "${GREEN}Snapper configurations will not be changed.${RC}" - return - ;; - esac - else - "$ESCALATION_TOOL" "$PACKAGER" install -y snapper - fi printf "%b\n" "${YELLOW}Creating snapper root(/) and home config and taking the first snapshots...${RC}" snapper -c root create-config / && snapper -c root create --description "First root Snapshot" snapper -c home create-config /home && snapper -c home create --description "First home Snapshot" @@ -69,7 +55,6 @@ configureSnapper() { s/^TIMELINE_LIMIT_YEARLY="[^"]*"/TIMELINE_LIMIT_YEARLY="0"/ ' /etc/snapper/configs/home printf "%b\n" "${GREEN}Snapper configs and first snapshots created.${RC}" - serviceStartEnable } # Starting services @@ -83,7 +68,7 @@ serviceStartEnable() { # Ask user if they want to install grub-btrfs askInstallGrubBtrfs() { printf "%b\n" "${YELLOW}You can skip installing grub-btrfs and use only Btrfs Assistant GUI or snapper CLI.${RC}" - printf "%b\n" "${RED}Notice: grub-btrfs may cause problems with booting into snapshots and other os on encrypted systems with secure boot/tpm. You will be asked to apply mitigation for this issue in next step.${RC}" + printf "%b\n" "${RED}Notice: grub-btrfs may cause problems with booting into snapshots and other os on systems with secure boot/tpm. You will be asked to apply mitigation for this issue in next step.${RC}" printf "%b\n" "${YELLOW}Do you want to install grub-btrfs? (y/n): ${RC}" read -r response case "$response" in @@ -157,5 +142,6 @@ checkEscalationTool checkFs installBtrfsStack configureSnapper +serviceStartEnable askInstallGrubBtrfs someNotices From 34e38ad188e06b2665a73f4ebd78443062e1d217 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sat, 5 Oct 2024 21:34:15 +0300 Subject: [PATCH 08/28] firs snapshot order changed home snapshot taken first because it's config can be saved to first root snapshot. --- core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index 1e9fd85ef..19fa119ea 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -35,8 +35,8 @@ installBtrfsStack() { # Create first snapper config for root and home and create new manual snapshots configureSnapper() { printf "%b\n" "${YELLOW}Creating snapper root(/) and home config and taking the first snapshots...${RC}" - snapper -c root create-config / && snapper -c root create --description "First root Snapshot" snapper -c home create-config /home && snapper -c home create --description "First home Snapshot" + snapper -c root create-config / && snapper -c root create --description "First root Snapshot" printf "%b\n" "${YELLOW}Updating timeline settings...${RC}" # Modifyling default timeline root config "$ESCALATION_TOOL" sed -i ' From 7ef34b6791062089673678a21e9587c07cc05a0b Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sun, 6 Oct 2024 07:38:01 +0300 Subject: [PATCH 09/28] better explanations in user prompts --- core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index 19fa119ea..d4db85154 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -67,8 +67,9 @@ serviceStartEnable() { # Ask user if they want to install grub-btrfs askInstallGrubBtrfs() { + printf "%b\n" "${YELLOW}grub-btrfs installation...${RC}" printf "%b\n" "${YELLOW}You can skip installing grub-btrfs and use only Btrfs Assistant GUI or snapper CLI.${RC}" - printf "%b\n" "${RED}Notice: grub-btrfs may cause problems with booting into snapshots and other os on systems with secure boot/tpm. You will be asked to apply mitigation for this issue in next step.${RC}" + printf "%b\n" "${CYAN}Notice: grub-btrfs may cause problems with booting into snapshots and other OSes on systems with secure boot/tpm. You will be asked to apply mitigation for this issue in next step.${RC}" printf "%b\n" "${YELLOW}Do you want to install grub-btrfs? (y/n): ${RC}" read -r response case "$response" in @@ -106,7 +107,10 @@ installGrubBtrfs() { printf "%b\n" "${GREEN}Grub-btrfs installed and service enabled.${RC}" printf "%b\n" "${CYAN}Notice: To perform a system recovery via grub-btrfs, perform a restore operation with Btrfs Assistant GUI after booting into the snapshot.${RC}" # Ask user if they want to apply mitigation for "tpm.c:150:unknown TPM error" - printf "%b\n" "${YELLOW}Do you want to apply mitigation for 'tpm.c:150:unknown TPM error' on systems with secure boot/tpm? (y/n): ${RC}" + printf "%b\n" "${YELLOW}Mitigation for 'tpm.c:150:unknown TPM error'...${RC}" + printf "%b\n" "${YELLOW}Some systems with secure boot/tpm may encounter 'tpm.c:150:unknown TPM error' when booting into snapshots.${RC}" + printf "%b\n" "${YELLOW}If you encounter this issue, you can come back later and apply this mitigation or you can apply it now.${RC}" + printf "%b\n" "${YELLOW}Do you want to apply mitigation for 'tpm.c:150:unknown TPM error'? (y/n): ${RC}" read -r response case "$response" in [yY]*) From 7cb3bdc3ca4505325fa4e7c6f7eede120d580e43 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sun, 6 Oct 2024 08:36:19 +0300 Subject: [PATCH 10/28] improved y/n loop --- .../fedora/fedora-btrfs-assistant.sh | 82 +++++++++++-------- 1 file changed, 50 insertions(+), 32 deletions(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index d4db85154..1e36be79e 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -67,19 +67,31 @@ serviceStartEnable() { # Ask user if they want to install grub-btrfs askInstallGrubBtrfs() { - printf "%b\n" "${YELLOW}grub-btrfs installation...${RC}" + printf "%b\n" "${YELLOW}(optional) grub-btrfs installation...${RC}" printf "%b\n" "${YELLOW}You can skip installing grub-btrfs and use only Btrfs Assistant GUI or snapper CLI.${RC}" printf "%b\n" "${CYAN}Notice: grub-btrfs may cause problems with booting into snapshots and other OSes on systems with secure boot/tpm. You will be asked to apply mitigation for this issue in next step.${RC}" - printf "%b\n" "${YELLOW}Do you want to install grub-btrfs? (y/n): ${RC}" - read -r response - case "$response" in - [yY]*) - installGrubBtrfs - ;; - *) - printf "%b\n" "${GREEN}Skipping grub-btrfs installation.${RC}" - ;; - esac + + while true; do + printf "%b\n" "${YELLOW}Do you want to install grub-btrfs? Press (y) for yes, (n) for no, (f) to apply tpm mitigation to already installed grub-btrfs: ${RC}" + read -r response + case "$response" in + [yY]*) + installGrubBtrfs + break + ;; + [nN]*) + printf "%b\n" "${GREEN}Skipping grub-btrfs installation.${RC}" + break + ;; + [fF]*) + mitigateTpmError + break + ;; + *) + printf "%b\n" "${RED}Invalid input. Please enter 'y' for yes or 'n' for no.${RC}" + ;; + esac + done } # Install grub-btrfs @@ -106,31 +118,37 @@ installGrubBtrfs() { cd .. && rm -rf "$HOME/grub-btrfs" #deletes downloaded git folder printf "%b\n" "${GREEN}Grub-btrfs installed and service enabled.${RC}" printf "%b\n" "${CYAN}Notice: To perform a system recovery via grub-btrfs, perform a restore operation with Btrfs Assistant GUI after booting into the snapshot.${RC}" - # Ask user if they want to apply mitigation for "tpm.c:150:unknown TPM error" - printf "%b\n" "${YELLOW}Mitigation for 'tpm.c:150:unknown TPM error'...${RC}" - printf "%b\n" "${YELLOW}Some systems with secure boot/tpm may encounter 'tpm.c:150:unknown TPM error' when booting into snapshots.${RC}" - printf "%b\n" "${YELLOW}If you encounter this issue, you can come back later and apply this mitigation or you can apply it now.${RC}" - printf "%b\n" "${YELLOW}Do you want to apply mitigation for 'tpm.c:150:unknown TPM error'? (y/n): ${RC}" - read -r response - case "$response" in - [yY]*) - mitigateTpmError - ;; - *) - printf "%b\n" "${GREEN}Skipping mitigation for 'tpm.c:150:unknown TPM error'.${RC}" - ;; - esac + mitigateTpmError } # Mitigation for "tpm.c:150:unknown TPM error" mitigateTpmError() { - printf "%b\n" "${YELLOW}Applying mitigation for 'tpm.c:150:unknown TPM error'...${RC}" - printf "%b\n" "${YELLOW}Creating /etc/grub.d/02_tpm file...${RC}" - echo '#!/bin/sh' | "$ESCALATION_TOOL" tee /etc/grub.d/02_tpm > /dev/null - echo 'echo "rmmod tpm"' | "$ESCALATION_TOOL" tee -a /etc/grub.d/02_tpm > /dev/null - "$ESCALATION_TOOL" chmod +x /etc/grub.d/02_tpm #makes the file executable - "$ESCALATION_TOOL" grub2-mkconfig -o /boot/grub2/grub.cfg #updates grub config - printf "%b\n" "${GREEN}Mitigation applied and grub config updated.${RC}" + # Ask user if they want to apply mitigation for "tpm.c:150:unknown TPM error" + printf "%b\n" "${YELLOW}Mitigation for 'tpm.c:150:unknown TPM error'...${RC}" + printf "%b\n" "${YELLOW}Some systems with secure boot/tpm may encounter 'tpm.c:150:unknown TPM error' when booting into snapshots.${RC}" + printf "%b\n" "${YELLOW}If you encounter this issue, you can come back later and apply this mitigation or you can apply it now.${RC}" + while true; do + printf "%b\n" "${YELLOW}Do you want to apply the TPM error mitigation? (y/n): ${RC}" + read -r response + case "$response" in + [yY]*) + printf "%b\n" "${YELLOW}Creating /etc/grub.d/02_tpm file...${RC}" + echo '#!/bin/sh' | "$ESCALATION_TOOL" tee /etc/grub.d/02_tpm > /dev/null + echo 'echo "rmmod tpm"' | "$ESCALATION_TOOL" tee -a /etc/grub.d/02_tpm > /dev/null + "$ESCALATION_TOOL" chmod +x /etc/grub.d/02_tpm # makes the file executable + "$ESCALATION_TOOL" grub2-mkconfig -o /boot/grub2/grub.cfg # updates grub config + printf "%b\n" "${GREEN}Mitigation applied and grub config updated.${RC}" + break + ;; + [nN]*) + printf "%b\n" "${GREEN}Skipping TPM error mitigation.${RC}" + break + ;; + *) + printf "%b\n" "${RED}Invalid input. Please enter 'y' for yes or 'n' for no.${RC}" + ;; + esac + done } # Post install information From 6425a4a410ed1c23fb85b87493ed30cf2a723e53 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sun, 6 Oct 2024 10:10:39 +0300 Subject: [PATCH 11/28] formatting improvements --- .../fedora/fedora-btrfs-assistant.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index 1e36be79e..0a65f56ed 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -2,7 +2,8 @@ . ../../common-script.sh -# This script automates the installation and root snapshot configuration of Snapper and installs Grub-Btrfs on Fedora. Also installs python3-dnf-plugin-snapper package for automatic snapshots after dnf commands. +# This script automates the installation and root and homesnapshot configuration of Snapper and installs Grub-Btrfs on Fedora. +# Also installs python3-dnf-plugin-snapper package for automatic snapshots after dnf commands. # Check the root filesystem type checkFs() { @@ -17,7 +18,9 @@ checkFs() { # Install Btrfs-Assistant/snapper and dependencies installBtrfsStack() { if ! command_exists btrfs-assistant; then + printf "%b\n" "${YELLOW}==========================================${RC}" printf "%b\n" "${YELLOW}Installing Btrfs Assistant with snapper...${RC}" + printf "%b\n" "${YELLOW}==========================================${RC}" case "$PACKAGER" in dnf) "$ESCALATION_TOOL" "$PACKAGER" install -y btrfs-assistant python3-dnf-plugin-snapper @@ -34,7 +37,9 @@ installBtrfsStack() { # Create first snapper config for root and home and create new manual snapshots configureSnapper() { + printf "%b\n" "${YELLOW}==========================================================================${RC}" printf "%b\n" "${YELLOW}Creating snapper root(/) and home config and taking the first snapshots...${RC}" + printf "%b\n" "${YELLOW}==========================================================================${RC}" snapper -c home create-config /home && snapper -c home create --description "First home Snapshot" snapper -c root create-config / && snapper -c root create --description "First root Snapshot" printf "%b\n" "${YELLOW}Updating timeline settings...${RC}" @@ -59,7 +64,9 @@ configureSnapper() { # Starting services serviceStartEnable() { + printf "%b\n" "${YELLOW}==================================================================================${RC}" printf "%b\n" "${YELLOW}Starting and enabling snapper-timeline.timer and snapper-cleanup.timer services...${RC}" + printf "%b\n" "${YELLOW}==================================================================================${RC}" systemctl start snapper-timeline.timer && systemctl enable snapper-timeline.timer #enables scheduled timeline snapshots systemctl start snapper-cleanup.timer && systemctl enable snapper-cleanup.timer #enables scheduled snapshot cleanup printf "%b\n" "${GREEN}Snapper services started and enabled.${RC}" @@ -67,7 +74,9 @@ serviceStartEnable() { # Ask user if they want to install grub-btrfs askInstallGrubBtrfs() { + printf "%b\n" "${YELLOW}=====================================${RC}" printf "%b\n" "${YELLOW}(optional) grub-btrfs installation...${RC}" + printf "%b\n" "${YELLOW}=====================================${RC}" printf "%b\n" "${YELLOW}You can skip installing grub-btrfs and use only Btrfs Assistant GUI or snapper CLI.${RC}" printf "%b\n" "${CYAN}Notice: grub-btrfs may cause problems with booting into snapshots and other OSes on systems with secure boot/tpm. You will be asked to apply mitigation for this issue in next step.${RC}" @@ -88,7 +97,7 @@ askInstallGrubBtrfs() { break ;; *) - printf "%b\n" "${RED}Invalid input. Please enter 'y' for yes or 'n' for no.${RC}" + printf "%b\n" "${RED}Invalid input. Please enter 'y' for yes, 'n' for no, or (f) to apply tpm mitigation to already installed grub-btrfs.${RC}" ;; esac done @@ -124,7 +133,9 @@ installGrubBtrfs() { # Mitigation for "tpm.c:150:unknown TPM error" mitigateTpmError() { # Ask user if they want to apply mitigation for "tpm.c:150:unknown TPM error" + printf "%b\n" "${YELLOW}===============================================${RC}" printf "%b\n" "${YELLOW}Mitigation for 'tpm.c:150:unknown TPM error'...${RC}" + printf "%b\n" "${YELLOW}===============================================${RC}" printf "%b\n" "${YELLOW}Some systems with secure boot/tpm may encounter 'tpm.c:150:unknown TPM error' when booting into snapshots.${RC}" printf "%b\n" "${YELLOW}If you encounter this issue, you can come back later and apply this mitigation or you can apply it now.${RC}" while true; do @@ -153,9 +164,11 @@ mitigateTpmError() { # Post install information someNotices() { + printf "%b\n" "${YELLOW}================================NOTICES================================${RC}" printf "%b\n" "${YELLOW}Notice: You can manage snapshots from GUI with Btrfs Assistant or CLI with snapper.${RC}" printf "%b\n" "${YELLOW}Notice: You may change (Hourly, daily, weekly, monthly, yearly) timeline settings with Btrfs Assistant GUI.${RC}" printf "%b\n" "${RED}Notice: If you used the default Fedora disk partitioning during OS installation, the /boot configured as an separate EXT4 partition. Therefore, it cannot be included in root snapshots. Backup separately...${RC}" + printf "%b\n" "${YELLOW}================================NOTICES================================${RC}" printf "%b\n" "${GREEN}Setup process completed.${RC}" } From 050f5b407620b3c54ab6c5981ce21d7fe4629afd Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sun, 6 Oct 2024 14:04:21 +0300 Subject: [PATCH 12/28] formatting improvement Co-authored-by: Adam Perkowski --- .../fedora/fedora-btrfs-assistant.sh | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index 0a65f56ed..4af62e21e 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -18,18 +18,18 @@ checkFs() { # Install Btrfs-Assistant/snapper and dependencies installBtrfsStack() { if ! command_exists btrfs-assistant; then - printf "%b\n" "${YELLOW}==========================================${RC}" - printf "%b\n" "${YELLOW}Installing Btrfs Assistant with snapper...${RC}" - printf "%b\n" "${YELLOW}==========================================${RC}" - case "$PACKAGER" in - dnf) - "$ESCALATION_TOOL" "$PACKAGER" install -y btrfs-assistant python3-dnf-plugin-snapper - ;; + printf "%b\n" "${YELLOW}==========================================${RC}" + printf "%b\n" "${YELLOW}Installing Btrfs Assistant with snapper...${RC}" + printf "%b\n" "${YELLOW}==========================================${RC}" + case "$PACKAGER" in + dnf) + "$ESCALATION_TOOL" "$PACKAGER" install -y btrfs-assistant python3-dnf-plugin-snapper + ;; *) - printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" - exit 1 - ;; - esac + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 + ;; + esac else printf "%b\n" "${GREEN}Btrfs Assistant is already installed.${RC}" fi From 7b77a9284b50f1e43ebfbb0c62e6aed760daaf0b Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sun, 6 Oct 2024 14:10:34 +0300 Subject: [PATCH 13/28] formatting improvement Co-authored-by: Adam Perkowski --- core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index 4af62e21e..cb73cbf61 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -81,7 +81,7 @@ askInstallGrubBtrfs() { printf "%b\n" "${CYAN}Notice: grub-btrfs may cause problems with booting into snapshots and other OSes on systems with secure boot/tpm. You will be asked to apply mitigation for this issue in next step.${RC}" while true; do - printf "%b\n" "${YELLOW}Do you want to install grub-btrfs? Press (y) for yes, (n) for no, (f) to apply tpm mitigation to already installed grub-btrfs: ${RC}" + printf "%b" "${YELLOW}Do you want to install grub-btrfs? Press (y) for yes, (n) for no, (f) to apply tpm mitigation to already installed grub-btrfs: ${RC}" read -r response case "$response" in [yY]*) From 8b6ff2199a8743a3846fc16aa694c57c710c28f9 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sun, 6 Oct 2024 14:11:55 +0300 Subject: [PATCH 14/28] Update task list Co-authored-by: Adam Perkowski --- core/tabs/system-setup/tab_data.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/system-setup/tab_data.toml b/core/tabs/system-setup/tab_data.toml index 8a9953b1a..f5a5bfdf5 100644 --- a/core/tabs/system-setup/tab_data.toml +++ b/core/tabs/system-setup/tab_data.toml @@ -69,7 +69,7 @@ task_list = "I" name = "Btrfs Assistant, Snapper Config, grub-btrfs" description = "Installs Btrfs Assistant, Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots.\nEnables snapper-timeline and snapper-cleanup services.\nInstalls Grub-Btrfs.\nNotice: To perform a system recovery via grub-btrfs, perform a restore operation with Btrfs Assistant GUI after booting into the snapshot.\nNotice: If you used the default Fedora disk partitioning during OS installation, the /boot configured as an separate EXT4 partition. Therefore, it cannot be included in root snapshots. Backup separately." script = "fedora/fedora-btrfs-assistant.sh" -task_list = "I" +task_list = "I PFM SS" [[data]] name = "Build Prerequisites" From eb3881b7664d8c96ef2c74bcbe6be05e72e7ff08 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sun, 6 Oct 2024 14:12:43 +0300 Subject: [PATCH 15/28] removed a inline comment Co-authored-by: Adam Perkowski --- core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index cb73cbf61..9caae29ef 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -124,7 +124,7 @@ installGrubBtrfs() { printf "%b\n" "${YELLOW}Updating grub configuration and enabling grub-btrfsd service...${RC}" "$ESCALATION_TOOL" grub2-mkconfig -o /boot/grub2/grub.cfg && systemctl enable --now grub-btrfsd.service printf "%b\n" "${YELLOW}Cleaning up installation files...${RC}" - cd .. && rm -rf "$HOME/grub-btrfs" #deletes downloaded git folder + cd .. && rm -rf "$HOME/grub-btrfs" printf "%b\n" "${GREEN}Grub-btrfs installed and service enabled.${RC}" printf "%b\n" "${CYAN}Notice: To perform a system recovery via grub-btrfs, perform a restore operation with Btrfs Assistant GUI after booting into the snapshot.${RC}" mitigateTpmError From 2dce55a987b13b76a75f0b6c07ff21bd7ab23cb1 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sun, 6 Oct 2024 14:13:27 +0300 Subject: [PATCH 16/28] removed an unnececary inline comment Co-authored-by: Adam Perkowski --- core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index 9caae29ef..f12a31c94 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -130,9 +130,7 @@ installGrubBtrfs() { mitigateTpmError } -# Mitigation for "tpm.c:150:unknown TPM error" mitigateTpmError() { - # Ask user if they want to apply mitigation for "tpm.c:150:unknown TPM error" printf "%b\n" "${YELLOW}===============================================${RC}" printf "%b\n" "${YELLOW}Mitigation for 'tpm.c:150:unknown TPM error'...${RC}" printf "%b\n" "${YELLOW}===============================================${RC}" From 4f88719a0c8282b65e8f620e9a3b3828741a7d86 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sun, 6 Oct 2024 14:14:01 +0300 Subject: [PATCH 17/28] removed an unnececary inline comment Co-authored-by: Adam Perkowski --- core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index f12a31c94..bbb4f960c 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -120,7 +120,6 @@ installGrubBtrfs() { sed -i '/#GRUB_BTRFS_MKCONFIG=/a GRUB_BTRFS_MKCONFIG=/sbin/grub2-mkconfig' config sed -i '/#GRUB_BTRFS_SCRIPT_CHECK=/a GRUB_BTRFS_SCRIPT_CHECK=grub2-script-check' config "$ESCALATION_TOOL" make install - # Update grub.cfg and enable grub-btrfsd service printf "%b\n" "${YELLOW}Updating grub configuration and enabling grub-btrfsd service...${RC}" "$ESCALATION_TOOL" grub2-mkconfig -o /boot/grub2/grub.cfg && systemctl enable --now grub-btrfsd.service printf "%b\n" "${YELLOW}Cleaning up installation files...${RC}" From fc82525ff07d87c57154a289d030715d6e25e78b Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sun, 6 Oct 2024 14:22:40 +0300 Subject: [PATCH 18/28] improved sed -i Co-authored-by: Adam Perkowski --- core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index bbb4f960c..902e5c98b 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -44,7 +44,7 @@ configureSnapper() { snapper -c root create-config / && snapper -c root create --description "First root Snapshot" printf "%b\n" "${YELLOW}Updating timeline settings...${RC}" # Modifyling default timeline root config - "$ESCALATION_TOOL" sed -i ' + "$ESCALATION_TOOL" sed -i'' ' s/^TIMELINE_LIMIT_HOURLY="[^"]*"/TIMELINE_LIMIT_HOURLY="1"/; s/^TIMELINE_LIMIT_DAILY="[^"]*"/TIMELINE_LIMIT_DAILY="2"/; s/^TIMELINE_LIMIT_WEEKLY="[^"]*"/TIMELINE_LIMIT_WEEKLY="1"/; From 346e76000745592bc80ec4cb517f0586b1beabb0 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sun, 6 Oct 2024 14:22:50 +0300 Subject: [PATCH 19/28] improved sed -i Co-authored-by: Adam Perkowski --- core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index 902e5c98b..8e0f48e0b 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -52,7 +52,7 @@ configureSnapper() { s/^TIMELINE_LIMIT_YEARLY="[^"]*"/TIMELINE_LIMIT_YEARLY="0"/ ' /etc/snapper/configs/root # Modifyling default timeline for home config - "$ESCALATION_TOOL" sed -i ' + "$ESCALATION_TOOL" sed -i'' ' s/^TIMELINE_LIMIT_HOURLY="[^"]*"/TIMELINE_LIMIT_HOURLY="2"/; s/^TIMELINE_LIMIT_DAILY="[^"]*"/TIMELINE_LIMIT_DAILY="1"/; s/^TIMELINE_LIMIT_WEEKLY="[^"]*"/TIMELINE_LIMIT_WEEKLY="0"/; From 09c1efbdf0d96c655d58caf8e26e539cf9a6961f Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sun, 6 Oct 2024 14:28:32 +0300 Subject: [PATCH 20/28] improved sed -i Co-authored-by: Adam Perkowski --- core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index 8e0f48e0b..83d9f28fe 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -115,10 +115,10 @@ installGrubBtrfs() { printf "%b\n" "${YELLOW}Installing grub-btrfs...${RC}" cd "$HOME/grub-btrfs" printf "%b\n" "${YELLOW}Modifying grub-btrfs configuration for Fedora...${RC}" - sed -i '/#GRUB_BTRFS_SNAPSHOT_KERNEL/a GRUB_BTRFS_SNAPSHOT_KERNEL_PARAMETERS="systemd.volatile=state"' config - sed -i '/#GRUB_BTRFS_GRUB_DIRNAME/a GRUB_BTRFS_GRUB_DIRNAME="/boot/grub2"' config - sed -i '/#GRUB_BTRFS_MKCONFIG=/a GRUB_BTRFS_MKCONFIG=/sbin/grub2-mkconfig' config - sed -i '/#GRUB_BTRFS_SCRIPT_CHECK=/a GRUB_BTRFS_SCRIPT_CHECK=grub2-script-check' config + sed -i'' '/#GRUB_BTRFS_SNAPSHOT_KERNEL/a GRUB_BTRFS_SNAPSHOT_KERNEL_PARAMETERS="systemd.volatile=state"' config + sed -i'' '/#GRUB_BTRFS_GRUB_DIRNAME/a GRUB_BTRFS_GRUB_DIRNAME="/boot/grub2"' config + sed -i'' '/#GRUB_BTRFS_MKCONFIG=/a GRUB_BTRFS_MKCONFIG=/sbin/grub2-mkconfig' config + sed -i'' '/#GRUB_BTRFS_SCRIPT_CHECK=/a GRUB_BTRFS_SCRIPT_CHECK=grub2-script-check' config "$ESCALATION_TOOL" make install printf "%b\n" "${YELLOW}Updating grub configuration and enabling grub-btrfsd service...${RC}" "$ESCALATION_TOOL" grub2-mkconfig -o /boot/grub2/grub.cfg && systemctl enable --now grub-btrfsd.service From 067dd54f6338837fee5cfd15161afea435c2eca7 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sun, 6 Oct 2024 15:08:40 +0300 Subject: [PATCH 21/28] newlines removed from tab_data.toml Co-authored-by: Nyx --- core/tabs/system-setup/tab_data.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/system-setup/tab_data.toml b/core/tabs/system-setup/tab_data.toml index f5a5bfdf5..4ffdbb07b 100644 --- a/core/tabs/system-setup/tab_data.toml +++ b/core/tabs/system-setup/tab_data.toml @@ -67,7 +67,7 @@ task_list = "I" [[data.entries]] name = "Btrfs Assistant, Snapper Config, grub-btrfs" -description = "Installs Btrfs Assistant, Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots.\nEnables snapper-timeline and snapper-cleanup services.\nInstalls Grub-Btrfs.\nNotice: To perform a system recovery via grub-btrfs, perform a restore operation with Btrfs Assistant GUI after booting into the snapshot.\nNotice: If you used the default Fedora disk partitioning during OS installation, the /boot configured as an separate EXT4 partition. Therefore, it cannot be included in root snapshots. Backup separately." +description = "Installs Btrfs Assistant, Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots. Enables snapper-timeline and snapper-cleanup services. Installs Grub-Btrfs. Notice: To perform a system recovery via grub-btrfs, perform a restore operation with Btrfs Assistant GUI after booting into the snapshot. Notice: If you used the default Fedora disk partitioning during OS installation, the /boot configured as an separate EXT4 partition. Therefore, it cannot be included in root snapshots. Backup separately." script = "fedora/fedora-btrfs-assistant.sh" task_list = "I PFM SS" From 85588c6a10a93367c68d68c08d27dfd80cc5846b Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sun, 6 Oct 2024 15:09:17 +0300 Subject: [PATCH 22/28] btrfs detection moved to toml Co-authored-by: Nyx --- .../tabs/system-setup/fedora/fedora-btrfs-assistant.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index 83d9f28fe..e662638c5 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -5,16 +5,6 @@ # This script automates the installation and root and homesnapshot configuration of Snapper and installs Grub-Btrfs on Fedora. # Also installs python3-dnf-plugin-snapper package for automatic snapshots after dnf commands. -# Check the root filesystem type -checkFs() { - fs_type=$(findmnt -n -o FSTYPE /) - if [ "$fs_type" != "btrfs" ]; then - printf "%b\n" "${RED}This operation can only be performed on a Btrfs filesystem.${RC}" - exit 1 - fi - printf "%b\n" "${GREEN}Btrfs filesystem detected. Continuing with the operation...${RC}" -} - # Install Btrfs-Assistant/snapper and dependencies installBtrfsStack() { if ! command_exists btrfs-assistant; then From 7e09b49abb830505b1ce11532eb216cbace291b2 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sun, 6 Oct 2024 17:35:33 +0300 Subject: [PATCH 23/28] data.preconditions added - escalation tool used --- .../fedora/fedora-btrfs-assistant.sh | 19 +++++++++---------- core/tabs/system-setup/tab_data.toml | 5 +++++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index e662638c5..e1e8496b0 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -13,7 +13,7 @@ installBtrfsStack() { printf "%b\n" "${YELLOW}==========================================${RC}" case "$PACKAGER" in dnf) - "$ESCALATION_TOOL" "$PACKAGER" install -y btrfs-assistant python3-dnf-plugin-snapper + "$ESCALATION_TOOL" dnf install -y btrfs-assistant python3-dnf-plugin-snapper ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" @@ -27,11 +27,11 @@ installBtrfsStack() { # Create first snapper config for root and home and create new manual snapshots configureSnapper() { - printf "%b\n" "${YELLOW}==========================================================================${RC}" - printf "%b\n" "${YELLOW}Creating snapper root(/) and home config and taking the first snapshots...${RC}" - printf "%b\n" "${YELLOW}==========================================================================${RC}" - snapper -c home create-config /home && snapper -c home create --description "First home Snapshot" - snapper -c root create-config / && snapper -c root create --description "First root Snapshot" + printf "%b\n" "${YELLOW}===========================================================================${RC}" + printf "%b\n" "${YELLOW}Creating snapper root(/) and /home config and taking the first snapshots...${RC}" + printf "%b\n" "${YELLOW}===========================================================================${RC}" + "$ESCALATION_TOOL" snapper -c home create-config /home && "$ESCALATION_TOOL" snapper -c home create --description "First home Snapshot" + "$ESCALATION_TOOL" snapper -c root create-config / && "$ESCALATION_TOOL" snapper -c root create --description "First root Snapshot" printf "%b\n" "${YELLOW}Updating timeline settings...${RC}" # Modifyling default timeline root config "$ESCALATION_TOOL" sed -i'' ' @@ -57,8 +57,8 @@ serviceStartEnable() { printf "%b\n" "${YELLOW}==================================================================================${RC}" printf "%b\n" "${YELLOW}Starting and enabling snapper-timeline.timer and snapper-cleanup.timer services...${RC}" printf "%b\n" "${YELLOW}==================================================================================${RC}" - systemctl start snapper-timeline.timer && systemctl enable snapper-timeline.timer #enables scheduled timeline snapshots - systemctl start snapper-cleanup.timer && systemctl enable snapper-cleanup.timer #enables scheduled snapshot cleanup + "$ESCALATION_TOOL" systemctl enable --now snapper-timeline.timer + "$ESCALATION_TOOL" systemctl enable --now snapper-cleanup.timer printf "%b\n" "${GREEN}Snapper services started and enabled.${RC}" } @@ -111,7 +111,7 @@ installGrubBtrfs() { sed -i'' '/#GRUB_BTRFS_SCRIPT_CHECK=/a GRUB_BTRFS_SCRIPT_CHECK=grub2-script-check' config "$ESCALATION_TOOL" make install printf "%b\n" "${YELLOW}Updating grub configuration and enabling grub-btrfsd service...${RC}" - "$ESCALATION_TOOL" grub2-mkconfig -o /boot/grub2/grub.cfg && systemctl enable --now grub-btrfsd.service + "$ESCALATION_TOOL" grub2-mkconfig -o /boot/grub2/grub.cfg && "$ESCALATION_TOOL" systemctl enable --now grub-btrfsd.service printf "%b\n" "${YELLOW}Cleaning up installation files...${RC}" cd .. && rm -rf "$HOME/grub-btrfs" printf "%b\n" "${GREEN}Grub-btrfs installed and service enabled.${RC}" @@ -161,7 +161,6 @@ someNotices() { checkEnv checkEscalationTool -checkFs installBtrfsStack configureSnapper serviceStartEnable diff --git a/core/tabs/system-setup/tab_data.toml b/core/tabs/system-setup/tab_data.toml index 4ffdbb07b..fbb81db76 100644 --- a/core/tabs/system-setup/tab_data.toml +++ b/core/tabs/system-setup/tab_data.toml @@ -71,6 +71,11 @@ description = "Installs Btrfs Assistant, Snapper, dnf snapper plugin and takes t script = "fedora/fedora-btrfs-assistant.sh" task_list = "I PFM SS" +[[data.preconditions]] +matches = true +data = "command_exists" +values = [ "btrfs" ] + [[data]] name = "Build Prerequisites" description = "This script is designed to handle the installation of various software dependencies across different Linux distributions" From ec4080ffb7de3478555ad034056e92e1cd09d590 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sun, 6 Oct 2024 17:42:59 +0300 Subject: [PATCH 24/28] $PACKAGER replaced with dnf --- core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index e1e8496b0..4a1e5578d 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -100,7 +100,7 @@ installGrubBtrfs() { if [ -d "$HOME/grub-btrfs" ]; then rm -rf "$HOME/grub-btrfs" fi - "$ESCALATION_TOOL" "$PACKAGER" install -y make git inotify-tools + "$ESCALATION_TOOL" dnf install -y make git inotify-tools cd "$HOME" && git clone https://github.com/Antynea/grub-btrfs printf "%b\n" "${YELLOW}Installing grub-btrfs...${RC}" cd "$HOME/grub-btrfs" From 75d56e7f49b21564280a054f2bdc76071b56afa2 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sun, 6 Oct 2024 18:36:31 +0300 Subject: [PATCH 25/28] re-added packager Co-authored-by: Adam Perkowski --- core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index 4a1e5578d..96cc185f8 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -13,7 +13,7 @@ installBtrfsStack() { printf "%b\n" "${YELLOW}==========================================${RC}" case "$PACKAGER" in dnf) - "$ESCALATION_TOOL" dnf install -y btrfs-assistant python3-dnf-plugin-snapper + "$ESCALATION_TOOL" "$PACKAGER" install -y btrfs-assistant python3-dnf-plugin-snapper ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" From fed5afcbec0bd8df921efec873712947ba4bf8d7 Mon Sep 17 00:00:00 2001 From: leventbesli Date: Sun, 6 Oct 2024 18:36:43 +0300 Subject: [PATCH 26/28] re-added packager Co-authored-by: Adam Perkowski --- core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index 96cc185f8..b398b553b 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -100,7 +100,7 @@ installGrubBtrfs() { if [ -d "$HOME/grub-btrfs" ]; then rm -rf "$HOME/grub-btrfs" fi - "$ESCALATION_TOOL" dnf install -y make git inotify-tools + "$ESCALATION_TOOL" "$PACKAGER" install -y make git inotify-tools cd "$HOME" && git clone https://github.com/Antynea/grub-btrfs printf "%b\n" "${YELLOW}Installing grub-btrfs...${RC}" cd "$HOME/grub-btrfs" From 1b4fb60e6d38676ff2171687f413a4b9dcf5b85c Mon Sep 17 00:00:00 2001 From: leventbesli Date: Wed, 9 Oct 2024 16:52:10 +0300 Subject: [PATCH 27/28] usergide updated with docgen --- docs/userguide.md | 204 +++++++++++++++++++++++++++++++--------------- 1 file changed, 137 insertions(+), 67 deletions(-) diff --git a/docs/userguide.md b/docs/userguide.md index 2ee441c21..610c1fe9c 100644 --- a/docs/userguide.md +++ b/docs/userguide.md @@ -1,82 +1,152 @@ + # Walkthrough ---- - -## System Setup - -- **System Update**: Starts a system-wide update. -- **Compile Setup**: Installs tools and dependencies for compiling software. -- **Gaming Setup**: Configures Steam, Lutris, etc. -- **Global Theming**: Sets up and manages global themes. -- **Remove Snaps**: Removes snap packages. -- **TTY Fonts**: This Script will set the default TTY font to Terminus size 32 Bold - -### Arch Setup - -- **Paru Setup**: Installs the Paru AUR helper. -- **Yay Setup**: Installs the Yay AUR helper. -- **Server Setup**: Installs Arch Linux. - -### Fedora Setup - -- **RPM Fusion Setup**: Adds RPM Fusion free and nonfree repositories. -- **Multimedia Codecs**: Installs multimedia codecs and updates multimedia-related packages. Requires RPM Fusion repositories to be set up first. -- **NVIDIA Proprietary Driver Setup**: Installs proprietary NVIDIA drivers for GPUs from 2014 or later. -- **Virtualization Setup**: Installs virtualization tools. -- **Configure DNF**: Optimizes DNF for better speeds. -- **Btrfs Assistant, Snapper Config, grub-btrfs**: Installs Btrfs Assistant, Snapper, dnf snapper plugin and grub-btrfs. Creates snapper configs. Notice: The /boot configured as a separate EXT4 partition by default in Fedora, so it can't be included in the snapshots. Backup it seperately. ## Applications Setup -- **Flathub**: Installs Flatpak and Flathub. -- **Alacritty Setup**: Installs and configures Alacritty for you. -- **DwmTitus Setup**: Sets up the Dwm window manager. -- **Kitty Setup**: Installs and configures Kitty for you. -- **Rofi Setup**: Installs the Rofi application/script launcher. -- **Zsh Setup**: Installs and configures Zsh for you. -- **Fastfetch Setup**: Installs and configures Fastfetch. -- **Linutil Updater**: Updates the Linutil AUR / Crates.io Package. -- **Linutil Installer**: Installs Linutil via Crates.io or AUR. -- **Office Suite Setup**: Installs various office suites and PDF viewers (OnlyOffice, LibreOffice, WPS Office, FreeOffice, Evince, Okular, PDF Studio Viewer, PDF Studio). ### Developer Tools -- **Meld Setup**: Installs Meld, a visual diff and merge tool. -- **Ngrok Setup**: Installs Ngrok, a tool for creating secure tunnels to localhost. -- **Neovim Setup**: Installs and configures Neovim, a Vim-based text editor. -- **VS Code Setup**: Installs Visual Studio Code, a popular text editor. -- **Sublime Setup**: Installs Sublime Text, a nice text editor for code and markup. -- **VS Codium Setup**: Installs VS Codium, an open-source build of VS Code. -- **GitHub Desktop Setup**: Installs GitHub Desktop, a GUI for Git and GitHub. +- **Github Desktop**: GitHub Desktop is a user-friendly application that simplifies the process of managing Git repositories and interacting with GitHub, providing a graphical interface for tasks like committing, branching, and syncing changes. +- **Neovim**: Neovim is a refactor, and sometimes redactor, in the tradition of Vim. +It is not a rewrite but a continuation and extension of Vim. +This command configures neovim from CTT's neovim configuration. +https://github.com/ChrisTitusTech/neovim +- **Sublime Text**: Sublime Text is a fast, lightweight, and customizable text editor known for its simplicity, powerful features, and wide range of plugins for various programming languages. +- **VS Code**: Visual Studio Code (VS Code) is a lightweight, open-source code editor with built-in support for debugging, version control, and extensions for various programming languages and frameworks. +- **VS Codium**: VSCodium is a free, open-source version of Visual Studio Code (VS Code) that removes Microsoft-specific telemetry and branding. +- **Meld**: Meld is a visual diff and merge tool that helps compare files, directories, and version-controlled projects. +- **Ngrok**: Ngrok is a tool that creates secure, temporary tunnels to expose local servers to the internet for testing and development. + +### Communication Apps + +- **Discord**: Discord is a versatile communication platform for gamers and communities, offering voice, video, and text chat features. +- **Jitsi**: Jitsi Meet is an open-source video conferencing tool that allows users to host and join secure meetings directly from their web browsers without the need for downloads. +- **Signal**: Signal is a privacy-focused messaging app that provides end-to-end encryption for secure text, voice, and video communication. +- **Slack**: Slack is a collaboration platform designed for team communication, featuring channels, direct messaging, file sharing, and integrations with various productivity tools. +- **Telegram**: Telegram is a cloud-based messaging app known for its speed and security, offering features like group chats, channels, and end-to-end encrypted calls. +- **Zoom**: Zoom is a widely-used video conferencing platform that allows users to host virtual meetings, webinars, and online collaboration with features like screen sharing and recording. +- **Thunderbird**: Thunderbird is a free, open-source email client that offers powerful features like customizable email management, a built-in calendar, and extensive add-ons for enhanced functionality. + +### Office Suites + + +### PDF Suites + + +### Web Browsers + +- **Brave**: Brave is a free and open-source web browser developed by Brave Software, Inc. based on the Chromium web browser. +- **Chromium**: Chromium is an open-source web browser project started by Google, to provide the source code for the proprietary Google Chrome browser. +- **Google Chrome**: Google Chrome is a fast, secure, and free web browser, built for the modern web. +- **LibreWolf**: LibreWolf is a fork of Firefox, focused on privacy, security, and freedom. +- **Lynx**: Lynx is a highly configurable text-based web browser for use on cursor-addressable character cell terminals. +- **Mozilla Firefox**: Mozilla Firefox is a free and open-source web browser developed by the Mozilla Foundation. +- **Thorium**: Thorium is a Chromium-based browser focused on privacy and performance. +- **Vivaldi**: Vivaldi is a freeware, cross-platform web browser developed by Vivaldi Technologies. +- **Alacritty**: Alacritty is a modern terminal emulator that comes with sensible defaults, but allows for extensive configuration. By integrating with other applications, rather than reimplementing their functionality, it manages to provide a flexible set of features with high performance. The supported platforms currently consist of BSD, Linux, macOS and Windows. +This command installs and condifures alacritty terminal emulator. +- **Android Debloater**: Universal Android Debloater (UAD) is a tool designed to help users remove bloatware and unnecessary pre-installed applications from Android devices, enhancing performance and user experience. +- **Bash Prompt**: The .bashrc file is a script that runs every time a new terminal session is started in Unix-like operating systems. +It is used to configure the shell session, set up aliases, define functions, and more, making the terminal easier to use and more powerful. +This command configures the key sections and functionalities defined in the .bashrc file from CTT's mybash repository. +https://github.com/ChrisTitusTech/mybash +- **Bottles**: Bottles allows Windows software, like applications and games, to run on Linux. +Bottles also provides tools to categorize, organize and optimize your applications. +- **DWM-Titus**: DWM is a dynamic window manager for X. +It manages windows in tiled, monocle and floating layouts. +All of the layouts can be applied dynamically, optimising the environment for the application in use and the task performed. +This command installs and configures DWM and a desktop manager. +The list of patches applied can be found in CTT's DWM repository +https://github.com/ChrisTitusTech/dwm-titus +- **Docker**: Docker is an open platform that uses OS-level virtualization to deliver software in packages called containers. +- **Fastfetch**: Fastfetch is a neofetch-like tool for fetching system information and displaying it prettily. +It is written mainly in C, with performance and customizability in mind. +This command installs fastfetch and configures from CTT's mybash repository. +https://github.com/ChrisTitusTech/mybash +- **Flatpak / Flathub**: Flatpak is a universal application sandbox for Linux that uses isolated packages from Flathub to prevent conflicts and system alterations, while alleviating dependency concerns. +This command installs Flatpak and adds the Flathub repository +- **Grub Theme**: Installs ChrisTitusTech's Top 5 Bootloader Themes script to allow for easy customization of GRUB. +- **Kitty**: kitty is a free and open-source GPU-accelerated terminal emulator for Linux, macOS, and some BSD distributions, focused on performance and features. +kitty is written in a mix of C and Python programming languages. + This command installs and configures kitty. +- **Linutil Installer**: Installs a distro-specific Linutil package locally. +- **Linutil Updater**: Updates your local Linutil crate installation. +- **Rofi**: Rofi is a window switcher, run dialog, ssh-launcher and dmenu replacement that started as a clone of simpleswitcher, written by Sean Pringle and later expanded by Dave Davenport. +This command installs and configures rofi with configuration from CTT's DWM repo. +https://github.com/ChrisTitusTech/dwm-titus +- **Waydroid**: Waydroid is an emulator that allows you to run Android apps and games on Linux. +- **ZSH Prompt**: The Z shell is a Unix shell that can be used as an interactive login shell and as a command interpreter for shell scripting. Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh. +This command installs ZSH prompt and provides basic configuration. + +## Gaming + + +### Diablo II Resurrected + +- **Loot Filter**: This is a loot filter for Diablo II Resurrected. +It's designed to be a simple, clean, and easy to read loot filter that highlights the most important items. +Works on battle.net and single player. +No frills, no config, just highlights high runes and other valuable items. +For more information visit: https://github.com/ChrisTitusTech/d2r-loot-filter + +## Security + +- **Firewall Baselines (CTT)**: Developed to ease iptables firewall configuration, UFW provides a user friendly way to create an IPv4 or IPv6 host-based firewall. +This command installs UFW and configures UFW based on CTT's recommended rules. +For more information visit: https://christitus.com/linux-security-mistakes + +## System Setup -## Security Features -- **Firewall Baselines**: Sets up firewall rules. +### Arch Linux + +- **Arch Server Setup**: This command installs a minimal arch server setup under 5 minutes. +- **Paru AUR Helper**: Paru is your standard pacman wrapping AUR helper with lots of features and minimal interaction. +To know more about AUR helpers visit: https://wiki.archlinux.org/title/AUR_helpers +- **Yay AUR Helper**: Yet Another Yogurt - An AUR Helper Written in Go. +To know more about AUR helpers visit: https://wiki.archlinux.org/title/AUR_helpers + +### Fedora + +- **Configure DNF**: Optimizes DNF for parallel downloads +- **Multimedia Codecs**: This script is designed to install multimedia codecs, and to ensure RPM Fusion repositories are installed. +- **Nvidia Proprietary Drivers**: This script is designed to download the proprietary NVIDIA drivers in Fedora. +- **RPM Fusion**: RPM Fusion provides software that the Fedora Project or Red Hat doesn't want to ship. +That software is provided as precompiled RPMs for all current Fedora versions and current Red Hat Enterprise Linux or clones versions; you can use the RPM Fusion repositories with tools like yum and PackageKit. +For more information visit: https://rpmfusion.org/ +- **Virtualization**: Enables Virtualization through dnf +- **Btrfs Assistant, Snapper Config, grub-btrfs**: Installs Btrfs Assistant, Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots. Enables snapper-timeline and snapper-cleanup services. Installs Grub-Btrfs. Notice: To perform a system recovery via grub-btrfs, perform a restore operation with Btrfs Assistant GUI after booting into the snapshot. Notice: If you used the default Fedora disk partitioning during OS installation, the /boot configured as an separate EXT4 partition. Therefore, it cannot be included in root snapshots. Backup separately. +- **Build Prerequisites**: This script is designed to handle the installation of various software dependencies across different Linux distributions +- **Full System Cleanup**: This script is designed to remove unnecessary packages, clean old cache files, remove temporary files, and to empty the trash. +- **Full System Update**: This command updates your system to the latest packages available for your distro +- **Gaming Dependencies**: This script is designed to handle the installation of gaming dependencies across different Linux distributions +- **Global Theme**: This script is designed to handle the installation and configuration of global theming +- **Remove Snaps**: This script is designed to remove snap +- **TTY Fonts**: This Script will set the default TTY font to Terminus size 32 Bold ## Utilities -- **Wifi Control**: Controls WiFi settings. -- **Numlock Control**: Sets up Numlock on boot. -- **Bluetooth Control**: Controls Bluetooth settings. - -### Monitor control - -- **Reset Scaling**: Resets monitor scaling to native resolution. -- **Scale Monitor**: Scales smaller monitors to the highest resolution of a bigger monitor. -- **Enable Monitor**: Enables a selected monitor. -- **Disable Monitor**: Disables a selected monitor. -- **Set Brightness**: Adjusts brightness for a selected monitor. -- **Set Resolutions**: Sets resolutions for connected monitors. -- **Change Orientation**: Changes the orientation of a selected monitor. -- **Extend Displays**: Extends displays to the right. -- **Duplicate Displays**: Duplicates displays. -- **Manage Arrangement**: Manages the arrangement of multiple monitors. -- **Set Primary Monitor**: Sets a selected monitor as the main display. -- **Auto Detect Displays**: Sets common resolution. + +### Monitor Control + +- **Auto Detect Displays**: This script is designed to detect and apply recommended configuration for monitors connected with your system +- **Change Orientation**: This script is designed to change the orientation of monitors in your system +- **Disable Monitor**: This script is designed to disable a monitor in your system +- **Duplicate Displays**: This script is designed to duplicate display among multi-monitor setup in your system +- **Enable Monitor**: This script is designed to enable a monitor in your system +- **Extend Displays**: This script is designed to extend display among multi-monitor setup in your system +- **Manage Arrangement**: This script is designed to arrange monitors in multi-monitor setup in your system +- **Reset Scaling**: This script is designed to reset scaling of a monitor in your system +- **Scale Monitors**: This script is designed to change the scaling of monitors in your system +- **Set Brightness**: This script is designed to change the Brightness of monitors connected to your system +- **Set Primary Monitor**: This script is designed to set a Primary monitor in your system +- **Set Resolution**: This script is designed to change the resolution of monitors connected to your system ### User Account Manager -- **Add User**: Creates a new user account. -- **Delete User**: Deletes an existing user account. -- **Add to Group**: Adds a user to specified groups. -- **Remove from Group**: Removes a user from specified groups. -- **Change Password**: Changes the password for a user account. +- **Auto Mount Drive**: This utility is designed to help with automating the process of mounting a drive on to your system. +- **Bluetooth Manager**: This utility is designed to manage bluetooth in your system +- **Numlock on Startup**: This utility is designed to configure auto enabling of numlock on boot +- **Ollama**: This utility is designed to manage ollama in your system +- **Service Manager**: This utility is designed to manage services in your system +- **WiFi Manager**: This utility is designed to manage wifi in your system From 4939861f59a3f2236723732ab6baf0970f172ede Mon Sep 17 00:00:00 2001 From: leventbesli Date: Wed, 9 Oct 2024 16:54:37 +0300 Subject: [PATCH 28/28] typo fix --- core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh index b398b553b..1d5dc2ff1 100644 --- a/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh +++ b/core/tabs/system-setup/fedora/fedora-btrfs-assistant.sh @@ -2,7 +2,7 @@ . ../../common-script.sh -# This script automates the installation and root and homesnapshot configuration of Snapper and installs Grub-Btrfs on Fedora. +# This script automates the installation and root and home snapshot configuration of Snapper and installs Grub-Btrfs on Fedora. # Also installs python3-dnf-plugin-snapper package for automatic snapshots after dnf commands. # Install Btrfs-Assistant/snapper and dependencies