This commit is contained in:
Your Name 2024-09-01 22:26:47 +00:00
parent 09e9d5d674
commit 4b31f2956c

View File

@ -139,23 +139,6 @@ osSnapshots() {
chown $USER:$USER $1/$2.tgz chown $USER:$USER $1/$2.tgz
} }
homeBackup() {
echo
echo "[Copying USER data from /home to $TARGET/@home]"
echo
rsync -a --delete /home/ --exclude=.cache --exclude=.local/share/flatpak --exclude=.local/share/containers $TARGET/\@home/
}
osBackup() {
umount $TARGET
osSnapshots "$1" "$2"
ls $TARGET/
umount $TARGET
cryptsetup close $ROOT_MAPPER_NAME
}
osRestore() { osRestore() {
partitions partitions
rm -rf $TARGET/usr $TARGET/sbin $TARGET/lib32 $TARGET/libx32 $TARGET/lib $TARGET/vmlinuz* $TARGET/initrd* $TARGET/bin $TARGET/var $TARGET/root $TARGET/opt $TARGET/etc $TARGET/run rm -rf $TARGET/usr $TARGET/sbin $TARGET/lib32 $TARGET/libx32 $TARGET/lib $TARGET/vmlinuz* $TARGET/initrd* $TARGET/bin $TARGET/var $TARGET/root $TARGET/opt $TARGET/etc $TARGET/run
@ -667,8 +650,7 @@ tweaks() {
echo "[2] Chroot into existing OS" echo "[2] Chroot into existing OS"
echo "[3] Compile the Kernel" echo "[3] Compile the Kernel"
echo "[4] Upgrade gentoo.sh" echo "[4] Upgrade gentoo.sh"
echo "[5] Restore Live OS to removable media" echo "[5] Enable/Disable Disk Password at Boot"
echo "[6] Enable/Disable Disk Password at Boot"
echo echo
read -p 'Your Choice: ' choice read -p 'Your Choice: ' choice
if [[ $choice = 1 ]]; then if [[ $choice = 1 ]]; then
@ -687,9 +669,6 @@ tweaks() {
rm -f /tmp/latest-stage3-amd64-desktop-systemd.txt rm -f /tmp/latest-stage3-amd64-desktop-systemd.txt
wget https://git.poster.place/verita84/sway/raw/branch/main/gentoo.sh wget https://git.poster.place/verita84/sway/raw/branch/main/gentoo.sh
elif [[ $choice = 5 ]]; then elif [[ $choice = 5 ]]; then
setDevices
liveOSrestore "$HARD_DISK" $ROOT_MAPPER_NAME "none" "none" "$ROOT_NAME"
elif [[ $choice = 6 ]]; then
clear clear
echo "[Password Protection at Boot]" echo "[Password Protection at Boot]"
echo echo
@ -751,10 +730,9 @@ menu() {
echo "[2] Download Gentoo Installation Files" echo "[2] Download Gentoo Installation Files"
echo "[3] Install System" echo "[3] Install System"
echo "[4] Automatic Install" echo "[4] Automatic Install"
echo "[5] Backup" echo "[5] Backup/Restore Live OS to/from removable media"
echo "[6] Restore" echo "[6] Tools and Tweaks"
echo "[7] Tools and Tweaks" echo "[7] Initialize Disk"
echo "[8] Initialize Disk"
echo echo
read -p 'Your Choice: ' choice read -p 'Your Choice: ' choice
@ -778,31 +756,12 @@ menu() {
exit 1 exit 1
elif [[ $choice = 5 ]]; then elif [[ $choice = 5 ]]; then
clear clear
echo "[Backup OS]"
echo
read -p 'OS Backup Directory Location : ' -e -i "/tmp" backup_directory
osBackup $backup_directory "$ROOT_NAME"
elif [[ $choice = 6 ]]; then
clear
echo "[Restore from Backup]"
echo
echo
rm -f /tmp/disk
setDevices setDevices
read -p 'Hostname for Restore: ' -e -i "gentoo" HOSTNAME setDevices
read -p 'Restore Directory Image Source: ' -e -i "/mnt" restore_directory liveOSrestore "$HARD_DISK" $ROOT_MAPPER_NAME "none" "none" "$ROOT_NAME"
FILE_SCAN=$(ls $restore_directory/gentoo-$HOSTNAME-* | tail -1) elif [[ $choice = 6 ]]; then
read -p 'Restore Home Directory? : ' -e -i 'n' home_restore
read -p 'Backup file name to restore: ' -e -i "$FILE_SCAN" backup_name
if [[ $home_restore = *n* ]]; then
osRestore "$HARD_DISK" "$backup_name" "none" "$restore_directory" "$BTRFS"
else
osRestore "$HARD_DISK" "$backup_name" "home" "$restore_directory" "$BTRFS"
fi
elif [[ $choice = 7 ]]; then
tweaks tweaks
elif [[ $choice = 8 ]]; then elif [[ $choice = 7 ]]; then
clear clear
echo "[Initialize Disk]" echo "[Initialize Disk]"
echo echo