Update gentoo.sh

This commit is contained in:
verita84 2024-01-01 21:33:08 -07:00
parent b206d62e87
commit 6f2a7a7a51

View File

@ -40,21 +40,18 @@ COMPRESSION='compress=zstd:10'
FLATPAKS+=()
SERVICES+=(cronie gdm libvirt smartd cronie cups grub-btrfsd sddm NetworkManager dev-zram0.swap)
MAKEOPTS="-j$(cat /proc/cpuinfo | grep -i processor | grep -vi 'model' | wc -l)"
ROOT_PARTITION_SIZE="30GB"
#USEFLAG CONFIGURATION
MULTIMEDIA_CODECS="proprietary-codecs vpx bluray libaom libdrm libilbc libplacebo libsoxr libv4l libxml2 lv2 openh264 encode iconv jpeg2k ladspa libass libcaca mp3 openal opus svg theora v4l vorbis webp xvid x264 "
BASE_DESKTOP=" wayland desktop-portal dbus gui alsa X flatpak -browser-integration -samba sound-server -telemetry -zeroconf -bluetooth wxwidgets jumbo-build kernel-install dvd hwaccel sasl -gpm proprietary-codecs screencast systemd pulseaudio firmware nfsv4 caps device-mapper efiemu themes truetype btrfs seccomp cgroup-hybrid geoclue -webengine boot browser keeshare network opengl "
BASE_DESKTOP=" -tiff wayland desktop-portal dbus gui alsa X flatpak -browser-integration -samba sound-server -telemetry -zeroconf -bluetooth wxwidgets jumbo-build kernel-install dvd hwaccel sasl -gpm proprietary-codecs screencast systemd pulseaudio firmware nfsv4 caps device-mapper efiemu themes truetype btrfs seccomp cgroup-hybrid geoclue -webengine boot browser keeshare network opengl "
KDE_DESKTOP_USE_FLAGS="$MULTIMEDIA_CODECS $BASE_DESKTOP -gnome qt5 kde "
GNOME_DESKTOP_USE_FLAGS="$MULTIMEDIA_CODECS $BASE_DESKTOP keyring minizip -gnome-online-accounts -gpm gtk gnome qt5 -kde "
SERVER_USE_FLAGS="$MULTIMEDIA_CODECS -samba -gtk kernel-install -pipewire -bluetooth udev -sound -ipv6 sasl usb usbredir spice vhost-net virtfs -vnc -wayland -gpm -proprietary-codecs -screencast systemd pulseaudio sound-server -x264 firmware nfsv4 caps -zeroconf dbus -X -browser-integration desktop-portal -gnome -qt5 -kde -dvd -alsa -gui device-mapper efiemu themes truetype btrfs seccomp cgroup-hybrid geoclue -webengine boot -browser -keeshare network -opengl "
#PACKAGE CONFIGURATION
BASE_PACKAGES=" app-vim/airline app-containers/netavark 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 x11-apps/xhost app-misc/screen app-portage/gentoolkit sys-fs/dosfstools app-admin/sudo sys-apps/systemd sys-boot/plymouth sys-apps/zram-generator app-eselect/eselect-repository dev-vcs/git sys-block/parted sys-boot/grub sys-block/zram-init sys-process/btop net-vpn/wireguard-tools sys-apps/flatpak app-editors/vim app-misc/fastfetch net-misc/yt-dlp app-containers/crun app-containers/podman sys-fs/btrfs-progs net-print/cups "
SHARED_DESKTOP_APPS=" media-video/vlc net-im/telegram-desktop-bin net-misc/nextcloud-client x11-drivers/xf86-input-evdev www-client/firefox app-editors/vscodium app-admin/keepassxc "
GNOME_DESKTOP_PACKAGES=" $SHARED_DESKTOP_APPS gnome-extra/gnome-software app-text/evince gnome-extra/gnome-system-monitor dev-libs/qtkeychain gnome-extra/gnome-browser-connector sys-power/power-profiles-daemon gnome-extra/gnome-shell-extensions gnome-extra/gnome-calculator gnome-extra/gnome-tweaks app-office/libreoffice media-gfx/gimp gnome-light "
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 app-office/calligra net-im/neochat x11-misc/sddm "
#Change/Set Desktop: GNOME/KDE
DESKTOP_ENVIRONMENT="gnome"
DESKTOP_PACKAGES=$GNOME_DESKTOP_PACKAGES
DESKTOP_USE_FLAGS=$GNOME_DESKTOP_USE_FLAGS
SHARED_DESKTOP_APPS=" app-office/libreoffice app-crypt/veracrypt media-video/vlc net-im/telegram-desktop-bin net-misc/nextcloud-client x11-drivers/xf86-input-evdev www-client/firefox app-editors/vscodium app-admin/keepassxc "
KDED_ESKTOP_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 "
DESKTOP_PACKAGES=$KDE_DESKTOP_PACKAGES
DESKTOP_USE_FLAGS=$KDE_DESKTOP_USE_FLAGS
#
USE_FLAGS=""
PACKAGES=""
@ -66,7 +63,7 @@ DISTCC_HOSTS+=(192.168.0.44/2 192.168.0.146/2 192.168.0.153/2 192.168.0.148/2 19
DISTCC_LISTEN="192.168.0.0/24"
DISTCC_CORES="30"
#Add Masked Packages to the Array
MASKED_PACKAGES+=(gnome-extra/gnome-software dev-libs/nss www-client/firefox net-im/element-desktop-bin media-libs/harfbuzz games-util/game-device-udev-rules dev-lang/python dev-python/pyrate-limiter dev-python/moddb dev-python/pypresence games-util/lutris games-util/steam-launcher app-misc/fastfetch net-im/telegram-desktop-bin dev-libs/yyjson)
MASKED_PACKAGES+=(dev-games/irrlicht-mt dev-games/irrlicht-mt-headers games-arcade/supertux games-engines/minetest games-action/extreme-tuxrace dev-libs/nss www-client/firefox net-im/element-desktop-bin media-libs/harfbuzz games-util/game-device-udev-rules dev-lang/python dev-python/pyrate-limiter dev-python/moddb dev-python/pypresence games-util/lutris games-util/steam-launcher app-misc/fastfetch net-im/telegram-desktop-bin dev-libs/yyjson)
partitionDetection() {
#This is used for the installer to do script-based actions
@ -282,9 +279,10 @@ buildGentoo() {
echo
echo
if [[ $INSTALL_TYPE = *desktop* ]]; then
GENTOO_PROFILE=$(chroot $TARGET /usr/bin/eselect profile list | grep -i $DESKTOP_ENVIRONMENT | grep systemd | grep -i merged | head -1 | cut -d '[' -f2 | cut -d ']' -f1)
GENTOO_PROFILE=$(chroot $TARGET /usr/bin/eselect profile list | grep -i plasma | grep systemd | grep -i merged | head -1 | cut -d '[' -f2 | cut -d ']' -f1)
chroot $TARGET /usr/bin/eselect profile set $GENTOO_PROFILE
echo ">=x11-misc/$(find $TARGET/var/db/repos/gentoo/x11-misc/appmenu-gtk-module/ | grep ebuild | tail -1 | cut -d '/' -f9 | sed 's/.ebuild//i') wayland" >>$TARGET/etc/portage/package.use/zz-autounmask
echo ">=media-libs/$(find $TARGET/var/db/repos/gentoo/media-libs/libsndfile/ | grep ebuild | head -1 | cut -d '/' -f9 | sed 's/.ebuild//i') minimal" >>$TARGET/etc/portage/package.use/zz-autounmask
else
chroot $TARGET /usr/bin/eselect profile set $(/usr/bin/eselect profile list | grep -Evi 'gnome|plasma' | grep systemd | grep -i merged | head -1 | cut -d '[' -f2 | cut -d ']' -f1)
fi
@ -394,9 +392,8 @@ services() {
done
#Required for Audio to work
systemctl --global enable --now pipewire.socket
systemctl --global enable --now pipewire.service
systemctl --global enable --now wireplumber.service
systemctl --user enable --now pipewire.socket pipewire-pulse.socket wireplumber.service
systemctl --user enable --now pipewire.service
}
desktop() {
@ -430,9 +427,7 @@ fstab() {
echo "tmpfs /var/log tmpfs defaults,dev,exec 0 0" >>$TARGET/etc/fstab
echo "tmpfs /tmp tmpfs defaults 0 0" >>$TARGET/etc/fstab
echo "tmpfs /var/tmp/portage tmpfs defaults,size=$TMPFS_SIZE 0 0" >>$TARGET/etc/fstab
echo "tmpfs /home/${USER}/.cache tmpfs rw,user,exec 0 0" >>$TARGET/etc/fstab
echo "tmpfs /home/${USER}/Downloads tmpfs rw,user,exec 0 0" >>$TARGET/etc/fstab
echo "$BTRFS /home btrfs noatime,nodiratime,autodefrag,$COMPRESSION,subvol=@home 0 1" >>$TARGET/etc/fstab
#echo "$BTRFS /home btrfs noatime,nodiratime,autodefrag,$COMPRESSION,subvol=@home 0 1" >>$TARGET/etc/fstab
echo "$BTRFS /root btrfs noatime,nodiratime,autodefrag,$COMPRESSION,subvol=@root 0 1" >>$TARGET/etc/fstab
echo "$BTRFS /var/lib/containers btrfs noatime,nodiratime,autodefrag,$COMPRESSION,subvol=@containers 0 1" >>$TARGET/etc/fstab
}
@ -470,8 +465,8 @@ initialize-disk() {
parted -a optimal /dev/$HARD_DISK mkpart primary fat32 1MiB 200MiB
parted -a optimal /dev/$HARD_DISK mkpart primary ext3 200MiB 700MiB
parted -a optimal /dev/$HARD_DISK set 1 esp on
parted -a optimal /dev/$HARD_DISK mkpart P2 ext3 700MiB 100%
#parted -a optimal /dev/$HARD_DISK mkpart P2 ext3 98% 100%
parted -a optimal /dev/$HARD_DISK mkpart P2 ext3 700MiB $ROOT_PARTITION_SIZE
parted -a optimal /dev/$HARD_DISK mkpart P2 ext3 $ROOT_PARTITION_SIZE 100%
partitionDetection
echo
echo "Formatting....."
@ -735,10 +730,10 @@ set-devices() {
compile-kernel() {
cd /usr/src/linux
#echo y | make localmodconfig
time make $MAKEOPTS CC="distcc gcc"
time make $MAKEOPTS CC="distcc gcc" modules_install
time make -j30 CC="distcc gcc"
time make -j30 CC="distcc gcc" modules_install
time make install
dracut --kver "$(eselect kernel list | grep \* | cut -d '-' -f2-3 | sed 's/\*//' | sed 's/ //g')-gentoo-dist" --force
#dracut --kver "$(eselect kernel list | grep \* | cut -d '-' -f2-3 | sed 's/\*//' | sed 's/ //g')-gentoo-dist" --force
grub-mkconfig -o /boot/grub/grub.cfg
}
@ -778,4 +773,4 @@ elif [ "$1" = "help" ]; then
show-help
else
menu
fi
fi