This commit is contained in:
Your Name 2023-10-18 13:52:31 -06:00
parent 88a58da5a2
commit 01dcf1b8be

111
debian.sh
View File

@ -11,7 +11,7 @@
# 6. Easily create a bootable USB drive
# 7. Automatic Partitioning
# 8. Bypass entering encrypted disk password at boot time if desired
# 9. Xanmod Kernel
# 9. Xanmod Kernel
#
# INSTRUCTIONS
#
@ -48,11 +48,11 @@ DESKTOP="KDE"
XANMOD_KERNEL="y"
#Packages
BASE_PACKAGES=" firmware-realtek neofetch linux-image-amd64 grub-efi efibootmgr plymouth plymouth-themes duperemove btrfs-compsize btrfs-progs cryptsetup-initramfs linux-headers-amd64 firmware-iwlwifi firmware-linux firmware-linux-nonfree podman-compose podman-toolbox cockpit cockpit-podman packagekit cockpit-packagekit cockpit-storaged shfmt aardvark-dns power-profiles-daemon iptables-persistent resolvconf wireguard wireguard-tools nmap libsecret-tools libglu1-mesa preload flatpak powertop acpi btop inotify-tools debootstrap cups apt-transport-https samba samba-common nfs-common nfs-kernel-server linux-cpupower locales zram-tools acpid podman ghostscript cifs-utils ntp vim-airline rsync screen base udev git network-manager cryptsetup network-manager-openvpn ntp screen docbook-xsl alsa-utils sysstat fuse3 build-essential unzip bash-completion parted dosfstools wget curl "
KDE_DESKTOP_ENV=" keepassxc krita libdbus-glib-1-2 calligra print-manager plasma-discover-backend-flatpak kwin-addons kde-standard konsole dolphin kde-spectacle "
KDE_DESKTOP_ENV=" krita libdbus-glib-1-2 calligra print-manager plasma-discover-backend-flatpak kwin-addons kde-standard konsole dolphin kde-spectacle "
XFCE_DESKTOP_ENV=" xfce4 xfce4-goodies xfce4-whiskermenu-plugin xfce4-pulseaudio-plugin slim "
CINNAMON_DESKTOP_ENV=" cinnamon slim gimp "
GNOME_DESKTOP_ENV=" gnome gnome-shell-extension-weather gnome-shell-extension-dashtodock gnome-shell-extension-appindicator gnome-shell-extension-gsconnect gnome-tweaks synaptic gimp "
SHARED_DESKTOP_APPS=" telegram-desktop handbrake vlc nextcloud-desktop yt-dlp "
GNOME_DESKTOP_ENV=" gnome-core gdm3 gnome-shell-extension-weather gnome-shell-extension-dashtodock gnome-shell-extension-appindicator gnome-tweaks synaptic gimp "
SHARED_DESKTOP_APPS=" keepassxc telegram-desktop handbrake vlc nextcloud-desktop yt-dlp "
#VIRTUALIZATION=" virt-manager qemu-system libvirt-daemon-system ovmf cockpit-machines"
PACKAGES=""
TAR_EXCLUDES="--exclude=/.snapshots --exclude=/snapshots --exclude=/var/backups --exclude=/volumes/* --exclude=/mnt/* --exclude=/var/tmp/* --exclude=/tmp/* --exclude=/raid/* --exclude=/root/* --exclude=/var/cache/apt/archives/* --exclude=/proc/* --exclude=/.snapshots/* --exclude=/var/lib/libvirt/* --exclude=/dev/* --exclude=/sys/* --exclude=/home/* --exclude=/var/lib/postgresql --exclude=/var/lib/containers --exclude=/opt/chatgpt "
@ -107,7 +107,7 @@ hibernate-setup() {
echo "AllowSuspendThenHibernate=yes" >>/etc/systemd/sleep.conf
echo "HibernateState=disk" >>/etc/systemd/sleep.conf
echo "HibernateMode=platform" >>/etc/systemd/sleep.conf
echo "HibernateDelaySec=300" >>/etc/systemd/sleep.conf
echo "HibernateDelaySec=1800" >>/etc/systemd/sleep.conf
echo "HandleLidSwitch=suspend-then-hibernate" >>/etc/systemd/logind.conf
echo "HandleLidSwitchExternalPower=suspend-then-hibernate" >>/etc/systemd/logind.conf
unlink /usr/lib/systemd/system/systemd-suspend.service
@ -715,6 +715,66 @@ show-help() {
echo
}
tweaks() {
clear
echo
echo "[Debian Installer System Tweaks]"
echo
echo "[1] Enable/Disable Disk Password at Boot"
echo "[2] Create a deployable System Image"
echo "[3] Reinstall Bootloader"
echo "[4] Chroot into existing OS"
echo
read -p 'Your Choice: ' choice
if [[ $choice = 1 ]]; then
clear
echo "[Password Protection at Boot]"
echo
echo
set-devices
read -p 'Unlock Disk without password at boot time? ' -e -i "y" pass_change
if [[ $pass_change = *n* ]]; then
AUTO_DECRYPT="False"
bootloader "$HARD_DISK" "$ROOT_NAME" "$ROOT_MAPPER_NAME"
else
AUTO_DECRYPT="True"
bootloader "$HARD_DISK" "$ROOT_NAME" "$ROOT_MAPPER_NAME"
fi
elif [[ $choice = 2 ]]; then
clear
echo
echo "[Create Debian Image]"
echo
read -p 'Location to Store Image: ' -e -i "/home/$USER" image_directory
read -p 'Image File Name: ' -e -i "debian" ROOT_NAME
read -p 'Debian Version: ' -e -i "stable" DEBIAN_RELEASE
read -p 'KDE, CINNAMON, XFCE, or GNOME: ' -e -i "KDE" DESKTOP
if [[ $DESKTOP = *KDE* ]]; then
PACKAGES=$BASE_PACKAGES$SHARED_DESKTOP_APPS$KDE_DESKTOP_ENV
elif [[ $DESKTOP = *XFCE* ]]; then
PACKAGES=$BASE_PACKAGES$SHARED_DESKTOP_APPS$XFCE_DESKTOP_ENV
elif [[ $DESKTOP = *CINNAMON* ]]; then
PACKAGES=$BASE_PACKAGES$SHARED_DESKTOP_APPS$CINNAMON_DESKTOP_ENV
else
PACKAGES=$BASE_PACKAGES$SHARED_DESKTOP_APPS$GNOME_DESKTOP_ENV
fi
ROOT_MAPPER_NAME="/dev/foo"
make-image "$image_directory"
elif [[ $choice = 3 ]]; then
set-devices
bootloader $HARD_DISK $ROOT_NAME $ROOT_MAPPER_NAME
elif [[ $choice = 4 ]]; then
set-devices
partitions
systemMounts
if [[ -e "$TARGET/usr/bin/bash" ]]; then
/usr/sbin/chroot $TARGET /usr/bin/bash
fi
unmount
fi
}
menu() {
clear
echo
@ -723,14 +783,13 @@ menu() {
echo "[1] Install"
echo "[2] Backup"
echo "[3] Restore"
echo "[4] Create a deployable System Image"
echo "[5] Enable/Disable Disk Password at Boot"
echo "[6] Initialize Disk"
echo "[4] Tools and Tweaks"
echo "[5] Initialize Disk"
echo
read -p 'Your Choice: ' choice
if [[ $choice = 1 ]]; then
clear
echo "[Install] OS]"
echo "[Install OS]"
echo
echo
read -p 'Debian Version: ' -e -i "stable" DEBIAN_RELEASE
@ -774,40 +833,8 @@ menu() {
os-restore "$HARD_DISK" "$backup_name" "home" "$restore_directory" "$ROOT_MAPPER_NAME"
fi
elif [[ $choice = 4 ]]; then
clear
echo
echo "[Create Debian Image]"
echo
read -p 'Location to Store Image: ' -e -i "/home/$USER" image_directory
read -p 'Image File Name: ' -e -i "debian" ROOT_NAME
read -p 'Debian Version: ' -e -i "stable" DEBIAN_RELEASE
read -p 'KDE, CINNAMON, XFCE, or GNOME: ' -e -i "KDE" DESKTOP
if [[ $DESKTOP = *KDE* ]]; then
PACKAGES=$BASE_PACKAGES$SHARED_DESKTOP_APPS$KDE_DESKTOP_ENV
elif [[ $DESKTOP = *XFCE* ]]; then
PACKAGES=$BASE_PACKAGES$SHARED_DESKTOP_APPS$XFCE_DESKTOP_ENV
elif [[ $DESKTOP = *CINNAMON* ]]; then
PACKAGES=$BASE_PACKAGES$SHARED_DESKTOP_APPS$CINNAMON_DESKTOP_ENV
else
PACKAGES=$BASE_PACKAGES$SHARED_DESKTOP_APPS$GNOME_DESKTOP_ENV
fi
ROOT_MAPPER_NAME="/dev/foo"
make-image "$image_directory"
tweaks
elif [[ $choice = 5 ]]; then
clear
echo "[Password Protection at Boot]"
echo
echo
set-devices
read -p 'Unlock Disk without password at boot time? ' -e -i "y" pass_change
if [[ $pass_change = *n* ]]; then
AUTO_DECRYPT="False"
bootloader "$HARD_DISK" "$ROOT_NAME" "$ROOT_MAPPER_NAME"
else
AUTO_DECRYPT="True"
bootloader "$HARD_DISK" "$ROOT_NAME" "$ROOT_MAPPER_NAME"
fi
elif [[ $choice = 6 ]]; then
clear
echo "[Initialize Disk]"
echo