This commit is contained in:
Your Name 2024-03-18 21:47:20 -06:00
commit 0363615579

View File

@ -3,7 +3,7 @@
# What this script is:
#
# An automatic installer for Gentoo Stable with the following features:
# 1. Gentoo with GNOME
# 1. Gentoo with KDE
# 2. VeraCrypt
# 3. The ability to build a custom and deployable image onto any machine
# 4. Easily create a bootable USB drive
@ -18,7 +18,7 @@
#
# Please be sure to change USER,USER_PASSWORD, and ROOT_PASSWORD strings in this file
#
# To install a new OS to a disk, run gentoo-gnome.sh and choose option 1 from the main menu
# To install a new OS to a disk, run gentoo-kde.sh and choose option 1 from the main menu
#
########################
#Configure this section
@ -37,20 +37,21 @@ WIRELESS_PASSWORD='123456'
SSID='123456'
WIRELESS_INTERFACE='wlan0'
COMPRESSION='compress=zstd:10'
SERVICES+=(systemd-bsod gdm cronie libvirt smartd cronie cups NetworkManager dev-zram0.swap)
SERVICES+=(systemd-bsod sddm cronie libvirt smartd cronie cups NetworkManager dev-zram0.swap)
MAKEOPTS="-j$(cat /proc/cpuinfo | grep -i processor | grep -vi 'model' | wc -l)"
ROOT_PARTITION_SIZE=30
FEATURES="distcc getbinpkg -binpkg-request-signature"
EMERGE_DEFAULT_OPTS="--getbinpkg --jobs 10"
#USEFLAG CONFIGURATION
USE_FLAGS="qrcode gnome kernel-install boot proprietary-codecs libei gdk-pixbuf kernel-install gles2 pulseaudio keyring gtk vpx bluray libaom libdrm libilbc libplacebo libsoxr libv4l libxml2 lv2 openh264 encode iconv ladspa libass libcaca mp3 openal opus theora v4l vorbis xvid x264 gstreamer networkmanager tray wayland alsa X sound-server screencast systemd firmware btrfs policykit networkmanager zlib pipewire minizip network browser -cdr"
USE_FLAGS="qrcode kde plasma qt5 kernel-install boot proprietary-codecs libei gdk-pixbuf kernel-install gles2 pulseaudio keyring gtk vpx bluray libaom libdrm libilbc libplacebo libsoxr libv4l libxml2 lv2 openh264 encode iconv ladspa libass libcaca mp3 openal opus theora v4l vorbis xvid x264 gstreamer networkmanager tray wayland alsa X sound-server screencast systemd firmware btrfs policykit networkmanager zlib pipewire minizip network browser -cdr"
#VIDEO_CARDS="amdgpu radeon radensi""
#
#PACKAGE CONFIGURATION
BASE_PACKAGES=" sys-power/powertop net-vpn/tor app-shells/bash-completion app-shells/starship sys-apps/fwupd sys-power/cpupower net-p2p/syncthing media-libs/libmypaint media-libs/gexiv2 gnome-base/gnome-keyring app-vim/airline mail-mta/postfix app-admin/sysstat sys-apps/smartmontools sys-process/cronie net-fs/nfs-utils net-firewall/iptables dev-python/pip sys-fs/inotify-tools net-analyzer/nmap app-misc/screen app-portage/gentoolkit sys-fs/dosfstools app-admin/sudo sys-apps/systemd sys-apps/zram-generator app-eselect/eselect-repository dev-vcs/git sys-block/parted sys-block/zram-init sys-process/btop net-vpn/wireguard-tools app-editors/vim net-misc/yt-dlp sys-fs/btrfs-progs net-print/cups "
DESKTOP_APPS=" media-sound/rhythmbox gnome-base/gnome-light gnome-shell-extension-appindicator gnome-browser-connector sys-power/power-profiles-daemon gnome-system-monitor gnome-shell-extension-dash-to-panel app-text/xournalpp gnome-base/gnome-keyring gnome-extra/gnome-tweaks gnome-extra/gnome-calculator gnome-base/gdm app-arch/file-roller gnome-extra/gnome-shell-extensions gnome-extra/gnome-tweaks www-client/vivaldi-snapshot net-im/element-desktop-bin app-editors/vscodium app-office/libreoffice-bin app-crypt/veracrypt media-video/vlc net-im/telegram-desktop-bin app-admin/keepassxc media-gfx/gimp "
BASE_PACKAGES=" sys-power/powertop net-vpn/tor app-shells/bash-completion app-shells/starship sys-apps/fwupd sys-power/cpupower net-p2p/syncthing media-libs/libmypaint media-libs/gexiv2 app-vim/airline mail-mta/postfix app-admin/sysstat sys-apps/smartmontools sys-process/cronie net-fs/nfs-utils net-firewall/iptables dev-python/pip sys-fs/inotify-tools net-analyzer/nmap app-misc/screen app-portage/gentoolkit sys-fs/dosfstools app-admin/sudo sys-apps/systemd sys-apps/zram-generator app-eselect/eselect-repository dev-vcs/git sys-block/parted sys-block/zram-init sys-process/btop net-vpn/wireguard-tools app-editors/vim net-misc/yt-dlp sys-fs/btrfs-progs net-print/cups "
SHARED_DESKTOP_APPS=" app-office/libreoffice app-crypt/veracrypt media-video/vlc net-im/telegram-desktop-bin x11-drivers/xf86-input-evdev www-client/microsoft-edge app-editors/vscodium app-admin/keepassxc "
KDE_DESKTOP_PACKAGES=" $SHARED_DESKTOP_APPS kde-apps/kcalc kde-apps/dolphin kde-apps/ark plasma-meta kde-apps/konsole media-gfx/krita kde-apps/kdegraphics-meta net-im/neochat x11-misc/sddm "
#
PACKAGES="$BASE_PACKAGES $DESKTOP_APPS"
PACKAGES="$BASE_PACKAGES $KDE_DESKTOP_PACKAGES"
TMPFS_SIZE="32G"
CPU_TYPE="x86-64-v3"
TAR_EXCLUDES="--exclude=/var/lib/strfry/* --exclude=/run/user/* --exclude=/run/media/* --exclude=/var/db/repos/* --exclude=/var/lib/systemd/coredump/* --exclude=/var/cache/distfiles --exclude=/var/lib/flatpak --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 "
@ -118,14 +119,14 @@ os-restore() {
rsync -a --delete /home/ $TARGET/home/
fi
cp -f gentoo-gnome.sh $TARGET/
cp -f gentoo-kde.sh $TARGET/
fstab
chmod +x $TARGET/gentoo-gnome.sh
chroot $TARGET /gentoo-gnome.sh bootloader $1 $2 $5
chroot $TARGET /gentoo-gnome.sh btrfs-tweaks
chroot $TARGET /gentoo-gnome.sh accounts
chmod +x $TARGET/gentoo-kde.sh
chroot $TARGET /gentoo-kde.sh bootloader $1 $2 $5
chroot $TARGET /gentoo-kde.sh btrfs-tweaks
chroot $TARGET /gentoo-kde.sh accounts
chown -R $USER:$USER $TARGET/home/$USER
rm -f $TARGET/gentoo-gnome.sh
rm -f $TARGET/gentoo-kde.sh
}
systemMounts() {
@ -281,7 +282,7 @@ configurePortage() {
echo
echo
echo
GENTOO_PROFILE=$(chroot $TARGET /usr/bin/eselect profile list | grep -i desktop | grep -Evi 'plasma' | grep systemd | grep -i merged | head -1 | cut -d '[' -f2 | cut -d ']' -f1)
GENTOO_PROFILE=$(chroot $TARGET /usr/bin/eselect profile list | grep -i desktop | grep -Evi 'gnome' | grep systemd | grep -i merged | head -1 | cut -d '[' -f2 | cut -d ']' -f1)
chroot $TARGET /usr/bin/eselect profile set $GENTOO_PROFILE
mkdir -p $TARGET/etc/portage/package.license
@ -329,8 +330,8 @@ buildGentoo() {
echo "[Installing Packages]"
echo
echo
cp -f gentoo-gnome.sh $TARGET/usr/bin/gentoo-gnome.sh
chroot $TARGET /usr/bin/bash /usr/bin/gentoo-gnome.sh install-packages
cp -f gentoo-kde.sh $TARGET/usr/bin/gentoo-kde.sh
chroot $TARGET /usr/bin/bash /usr/bin/gentoo-kde.sh install-packages
echo
echo
@ -338,7 +339,7 @@ buildGentoo() {
echo "[Installing the Boot Loader]"
echo
echo
chroot $TARGET /usr/bin/bash /usr/bin/gentoo-gnome.sh bootloader $1 $ROOT_NAME $BTRFS
chroot $TARGET /usr/bin/bash /usr/bin/gentoo-kde.sh bootloader $1 $ROOT_NAME $BTRFS
echo
echo
@ -346,11 +347,11 @@ buildGentoo() {
echo
echo
echo 'bash /usr/bin/gentoo-gnome.sh accounts' >>$TARGET/setup.sh
echo 'bash /usr/bin/gentoo-gnome.sh desktop' >>$TARGET/setup.sh
echo 'bash /usr/bin/gentoo-gnome.sh btrfs-tweaks' >>$TARGET/setup.sh
echo 'bash /usr/bin/gentoo-kde.sh accounts' >>$TARGET/setup.sh
echo 'bash /usr/bin/gentoo-kde.sh desktop' >>$TARGET/setup.sh
echo 'bash /usr/bin/gentoo-kde.sh btrfs-tweaks' >>$TARGET/setup.sh
chmod +x $TARGET/usr/bin/gentoo-gnome.sh
chmod +x $TARGET/usr/bin/gentoo-kde.sh
chmod +x $TARGET/setup.sh
chroot $TARGET /setup.sh
rm -f $TARGET/setup.sh
@ -467,11 +468,9 @@ initialize-disk() {
SWAP_SIZE_END="$(expr $SWAP_SIZE + $ROOT_PARTITION_SIZE)"
parted /dev/$HARD_DISK mklabel gpt
parted -a optimal /dev/$HARD_DISK mkpart primary fat32 1MiB 200MiB
parted -a optimal /dev/$HARD_DISK mkpart root ext3 200MiB ${ROOT_PARTITION_SIZE}GB
parted -a optimal /dev/$HARD_DISK mkpart swap ext3 200MiB ${SWAP_SIZE_END}GB
parted -a optimal /dev/$HARD_DISK mkpart root ext3 200MiB 100%
parted -a optimal /dev/$HARD_DISK set 1 esp on
parted -a optimal /dev/$HARD_DISK mkpart swap ext3 ${ROOT_PARTITION_SIZE}GB ${SWAP_SIZE_END}GB
parted -a optimal /dev/$HARD_DISK mkpart home ext3 ${SWAP_SIZE_END}GB 100%
sleep 10
partitionDetection
echo
echo "Formatting....."
@ -491,15 +490,15 @@ wifi() {
show-help() {
clear
echo
echo "[gentoo-gnome.sh arguments]"
echo "[gentoo-kde.sh arguments]"
echo
echo "./gentoo-gnome.sh wifi"
echo "./gentoo-gnome.sh bootloader [disk] [ROOT_NAME] [ROOT_MAPPER_NAME]"
echo "./gentoo-gnome.sh initialize"
echo "./gentoo-gnome.sh tar [device name] [location]"
echo "./gentoo-gnome.sh snapshot"
echo "./gentoo-gnome.sh reomve-snapshot"
echo "./gentoo-gnome.sh btrfs-tweaks"
echo "./gentoo-kde.sh wifi"
echo "./gentoo-kde.sh bootloader [disk] [ROOT_NAME] [ROOT_MAPPER_NAME]"
echo "./gentoo-kde.sh initialize"
echo "./gentoo-kde.sh tar [device name] [location]"
echo "./gentoo-kde.sh snapshot"
echo "./gentoo-kde.sh reomve-snapshot"
echo "./gentoo-kde.sh btrfs-tweaks"
echo
}
@ -511,7 +510,7 @@ tweaks() {
echo "[1] Reinstall Bootloader"
echo "[2] Chroot into existing OS"
echo "[3] Compile the Kernel"
echo "[4] Upgrade gentoo-gnome.sh"
echo "[4] Upgrade gentoo-kde.sh"
echo
read -p 'Your Choice: ' choice
if [[ $choice = 1 ]]; then
@ -524,13 +523,13 @@ tweaks() {
elif [[ $choice = 3 ]]; then
compile-kernel
elif [[ $choice = 4 ]]; then
rm -f gentoo-gnome.sh
rm -f gentoo-kde.sh
rm -f repos.conf
rm -f gentoobinhost.conf
rm -f /tmp/latest-stage3-amd64-desktop-systemd.txt
wget https://git.poster.place/verita84/gnome/raw/branch/main/gentoo-gnome.sh
wget https://git.poster.place/verita84/gnome/raw/branch/main/repos.conf/repos.conf
wget https://git.poster.place/verita84/gnome/raw/branch/main/repos.conf/gentoobinhost.conf
wget https://git.poster.place/verita84/kde/raw/branch/main/gentoo-kde.sh
wget https://git.poster.place/verita84/kde/raw/branch/main/repos.conf/repos.conf
wget https://git.poster.place/verita84/kde/raw/branch/main/repos.conf/gentoobinhost.conf
BASE_URL="https://mirrors.poster.place/releases/amd64/autobuilds/current-stage3-amd64-desktop-systemd-mergedusr"
wget "$BASE_URL/latest-stage3-amd64-desktop-systemd-mergedusr.txt"
wget $BASE_URL/$(cat latest-stage3-amd64-desktop-systemd-mergedusr.txt | grep tar.xz | tail -1 | cut -d '.' -f1-3 | cut -d '"' -f2 | cut -d ' ' -f1) -O /tmp/stage3.tar.xz
@ -569,7 +568,7 @@ download-setup() {
fstab
cp -f /etc/resolv.conf $TARGET/etc/
configurePortage
cp -f gentoo-gnome.sh $TARGET/usr/bin/
cp -f gentoo-kde.sh $TARGET/usr/bin/
fi
}