Update gentoo.sh

This commit is contained in:
verita84 2023-11-04 21:14:40 +00:00
parent fb18a65cb7
commit c2ed5ebd13

View File

@ -36,15 +36,14 @@ WIRELESS_PASSWORD='123456'
SSID='123456'
WIRELESS_INTERFACE='wlan0'
COMPRESSION='compress=zstd:10'
FLATPAKS+=(io.exodus.Exodus us.zoom.Zoom app/com.valvesoftware.Steam/x86_64/stable app/net.lutris.Lutris)
FLATPAKS+=(io.exodus.Exodus us.zoom.Zoom app/net.lutris.Lutris)
SERVICES+=(smartd cronie avahi-daemon cups grub-btrfsd sddm NetworkManager dev-zram0.swap)
DESKTOP="KDE"
BROWSER="brave"
MAKEOPTS="-j$(cat /proc/cpuinfo | grep -i processor | grep -vi 'model' | wc -l)"
USE_FLAGS="systemd x264 pulseaudio firmware nfsv4 caps zeroconf dbus sound-server X -browser-integration desktop-portal minimal -gnome qt5 kde dvd alsa gui -wayland device-mapper efiemu themes truetype btrfs seccomp cgroup-hybrid geoclue -webengine boot browser keeshare network opengl"
USE_FLAGS=" -gpm proprietary-codecs screencast systemd x264 pulseaudio firmware nfsv4 caps zeroconf dbus sound-server X -browser-integration desktop-portal minimal -gnome qt5 kde dvd alsa gui -wayland device-mapper efiemu themes truetype btrfs seccomp cgroup-hybrid geoclue -webengine boot browser keeshare network opengl"
TMPFS_SIZE="32G"
STAGE3="https://distfiles.gentoo.org/releases/amd64/autobuilds/20231022T164658Z/stage3-amd64-systemd-20231022T164658Z.tar.xz"
BASE_PACKAGES=" kde-apps/kcalc www-client/firefox-bin kde-apps/ark kde-apps/dolphin mail-mta/postfix app-admin/sysstat sys-apps/smartmontools plasma-meta sys-process/cronie net-fs/samba net-fs/nfs-utils net-firewall/iptables dev-python/pip sys-fs/inotify-tools kde-apps/kate kde-apps/konsole media-gfx/krita dev-util/sh net-analyzer/nmap x11-apps/xhost app-misc/screen net-im/element-desktop-bin app-portage/gentoolkit sys-fs/dosfstools app-admin/sudo sys-apps/systemd sys-boot/plymouth sys-apps/zram-generator x11-misc/sddm app-eselect/eselect-repository dev-vcs/git sys-boot/refind sys-block/parted sys-boot/grub sys-block/zram-init media-video/vlc app-office/calligra sys-process/btop net-vpn/wireguard-tools sys-apps/flatpak app-editors/vim app-vim/airline app-misc/fastfetch net-misc/yt-dlp net-im/telegram-desktop net-misc/nextcloud-client app-containers/crun app-containers/podman app-office/calligra media-gfx/krita net-fs/samba sys-fs/btrfs-progs kde-apps/kdegraphics-meta app-admin/keepassxc net-print/cups "
BASE_PACKAGES=" kde-apps/kcalc www-client/vivaldi kde-apps/ark kde-apps/dolphin mail-mta/postfix app-admin/sysstat sys-apps/smartmontools plasma-meta sys-process/cronie net-fs/samba net-fs/nfs-utils net-firewall/iptables dev-python/pip sys-fs/inotify-tools kde-apps/kate kde-apps/konsole media-gfx/krita dev-util/sh net-analyzer/nmap x11-apps/xhost app-misc/screen net-im/neochat app-portage/gentoolkit sys-fs/dosfstools app-admin/sudo sys-apps/systemd sys-boot/plymouth sys-apps/zram-generator x11-misc/sddm app-eselect/eselect-repository dev-vcs/git sys-boot/refind sys-block/parted sys-boot/grub sys-block/zram-init media-video/vlc app-office/calligra sys-process/btop net-vpn/wireguard-tools sys-apps/flatpak app-editors/vim app-vim/airline app-misc/fastfetch net-misc/yt-dlp net-im/telegram-desktop net-misc/nextcloud-client app-containers/crun app-containers/podman app-office/calligra media-gfx/krita net-fs/samba sys-fs/btrfs-progs kde-apps/kdegraphics-meta app-admin/keepassxc net-print/cups "
#VIRTUALIZATION=" virt-manager qemu-system libvirt-daemon-system ovmf cockpit-machines"
TAR_EXCLUDES="--exclude=/var/cache/distfiles --exclude=/var/lib/flatpak --exclude=/opt/stable-diffusion-webui --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 "
@ -69,13 +68,13 @@ create-os-snapshots() {
echo
mkdir $2
DATE=$(date +%Y-%m-%d-%H)
echo "[Creating new OS snapshot to $1/gentoo-$DATE).tgz]"
echo "[Creating new OS snapshot to $1/gentoo-$HOSTNAME-$DATE).tgz]"
echo
echo
NEW_TAR_EXCLUDES="$TAR_EXCLUDES --exclude=/minio --exclude=$TARGET/* --exclude=/var/lib/docker "
echo
time tar cvpzf $1/gentoo-$DATE.tgz $NEW_TAR_EXCLUDES /
chown $USER:$USER $1/gentoo-$DATE.tgz
time tar cvpzf $1/gentoo-$HOSTNAME-$DATE.tgz $NEW_TAR_EXCLUDES /
chown $USER:$USER $1/gentoo-$HOSTNAME-$DATE.tgz
}
homeBackup() {
@ -146,6 +145,7 @@ install() {
if [ -f "$TARGET/bin/bash" ]; then
systemMounts
cp -f ./gentoo.sh $TARGET/usr/bin/
buildGentoo
auto_login
setup_script "$1"
@ -155,11 +155,13 @@ install() {
getInstallFiles() {
cd /tmp
STAGE3_URL=$(curl https://www.gentoo.org/downloads/ | grep -i stage3-amd64-systemd | head -1 | cut -d '"' -f2-3 | cut -d '"' -f1)
wget "$STAGE3_URL"
STAGE3_FILE="/tmp/$(ls /tmp/stage3-* | head -1 | cut -d '/' -f3)"
if [ -f "$STAGE3_FILE" ]; then
echo "Stage3 already here"
else
wget $STAGE3
wget "$STAGE3_URL"
STAGE3_FILE="/tmp/$(ls /tmp/stage3-* | head -1 | cut -d '/' -f3)"
fi
@ -174,7 +176,6 @@ getInstallFiles() {
}
buildGentoo() {
cp -f ./gentoo.sh $TARGET/usr/bin/
if [ ! -d "$TARGET/var/db/repos/gentoo/x11-misc" ]; then
chroot $TARGET /usr/bin/emerge --sync
fi
@ -302,6 +303,15 @@ desktop() {
services
}
installSteam() {
eselect repository enable steam-overlay
emerge --sync steam-overlay
emerge games-util/steam-launcher --autounmask-write
etc-update -q --automode -5
emerge games-util/steam-launcher
}
installBrowser() {
if [ "$BROWSER" = "brave" ]; then
installBrave
@ -501,7 +511,7 @@ menu() {
echo
set-devices
read -p 'Restore Directory Image Source: ' -e -i "/mnt" restore_directory
FILE_SCAN=$(ls $restore_directory/gentoo-* | tail -1)
FILE_SCAN=$(ls $restore_directory/gentoo-$HOSTNAME-* | tail -1)
read -p 'Restore Home Directory? : ' -e -i 'n' home_restore
read -p 'Backup file name to restore: ' -e -i "$FILE_SCAN" backup_name
@ -567,7 +577,9 @@ elif [ "$1" = "bootloader" ]; then
bootloader "$2" "$3" "$4"
elif [ "$1" = "snapshot" ]; then
snapshots
elif [ "$1" = "grub-snapshots" ]; then
elif [ "$1" = "steam" ]; then
installSteam
elif [ "$1" = "grub-snapshots" ]; then
grub-snapshots
elif [ "$1" = "btrfs-tweaks" ]; then
btrfs-tweaks