From de41110355803703c20ca1a4219c0c06b55a8c5d Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 27 Nov 2024 11:17:26 -0700 Subject: [PATCH] fix --- gentoo.sh | 42 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/gentoo.sh b/gentoo.sh index 10e9ca7..e6c61f5 100644 --- a/gentoo.sh +++ b/gentoo.sh @@ -44,7 +44,7 @@ AUTO_DECRYPT='False' DISK_PASSWORD='123456' ############################## FLATPAKS+=() -SERVICES+=(cronie libvirtd smartd cronie cups NetworkManager zram_swap.service) +SERVICES+=(cronie libvirtd smartd cronie cups NetworkManager zram_swap.service zram_tmp.service zram_var_tmp.service) MAKEOPTS="-j$(cat /proc/cpuinfo | grep -i processor | grep -vi 'model' | wc -l)" ROOT_PARTITION_SIZE="30GB" FEATURES="-pid-sandbox getbinpkg -binpkg-request-signature" @@ -56,14 +56,14 @@ VIDEO_CARDS="amdgpu radeon radeonsi" #PACKAGE CONFIGURATION BASE_PACKAGES=" sys-power/acpid app-arch/zip dev-python/virtualenv sys-apps/flatpak net-misc/nyx app-emulation/virt-manager sys-power/powertop net-vpn/tor app-shells/bash-completion sys-power/cpupower net-misc/nextcloud-client media-libs/gexiv2 app-vim/airline mail-mta/postfix app-admin/sysstat sys-apps/smartmontools sys-process/cronie net-fs/nfs-utils net-firewall/nftables 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-block/zram-init app-eselect/eselect-repository dev-vcs/git sys-block/parted sys-process/btop net-vpn/wireguard-tools app-editors/vim app-misc/fastfetch net-misc/yt-dlp sys-fs/btrfs-progs net-print/cups " #FIX=" dev-libs/libappindicator" -DESKTOP_APPS=" firefox-bin kde-apps/kcalc kde-apps/ark kde-frameworks/karchive net-im/signal-desktop-bin kde-apps/okular kde-apps/spectacle kde-apps/dolphin konsole kde-plasma/plasma-meta app-office/libreoffice-bin gui-libs/xdg-desktop-portal-wlr sys-apps/xdg-desktop-portal dev-util/android-tools media-video/obs-studio media-video/handbrake xfce-base/thunar kde-apps/kate media-video/vlc media-fonts/fontawesome media-gfx/krita " +DESKTOP_APPS=" kde-apps/krfb kde-apps/krdc kde-apps/korganizer firefox-bin kde-apps/kcalc kde-apps/ark kde-frameworks/karchive net-im/signal-desktop-bin kde-apps/okular kde-apps/spectacle kde-apps/dolphin konsole kde-plasma/plasma-meta app-office/libreoffice-bin gui-libs/xdg-desktop-portal-wlr sys-apps/xdg-desktop-portal dev-util/android-tools media-video/obs-studio media-video/handbrake xfce-base/thunar kde-apps/kate media-video/vlc media-fonts/fontawesome media-gfx/krita " # PACKAGES="$BASE_PACKAGES $DESKTOP_APPS" TMPFS_SIZE="32G" CPU_TYPE="x86-64" BUILD_SERVER="n" BUILD_SERVER_ADDRESS="192.168.0.55" -BUILD_PATH="/raid/@gentoo" +BUILD_PATH="/raid/@os" RSYNC_EXCLUDES="--exclude=/var/tmp/* --exclude=/tmp/* --exclude=/var/lib/libvirt/* --exclude=/var/db/repos --exclude=/var/cache --exclude=/var/notmpfs --exclude=/var/lib/docker --exclude=/var/db/repos/* --exclude=/var/lib/systemd/coredump/* --exclude=/var/cache/* --exclude=/home/$USER* --exclude=/.snapshots/* --exclude=/sys/* --exclude=/dev/* --exclude=/home/$USER/* --exclude=/proc/* --exclude=/run/*" #Add Masked Packages to the Array MASKED_PACKAGES+=(media-video/obs-studio net-misc/nyx net-libs/stem sys-libs/libudev-compat dev-libs/nss dev-libs/libappindicator media-video/ffmpeg games-util/game-device-udev-rules games-util/steam-launcher net-im/telegram-desktop-bin) @@ -205,8 +205,10 @@ configurePortage() { mkdir -p $TARGET/etc/portage/env echo 'EXTRA_ECONF="--disable-bootstrap"' >$TARGET/etc/portage/env/gcc.conf + echo 'PORTAGE_TMPDIR="/var/notmpfs"' >$TARGET/etc/portage/env/notmpfs.conf echo "sys-devel/gcc gcc.conf" >$TARGET/etc/portage/package.env echo "sys-devel/llvm gcc.conf" >>$TARGET/etc/portage/package.env + echo "www-client/chromium notmpfs.conf" >>$TARGET/etc/portage/package.env if [ -f "./repos.conf" ]; then echo @@ -345,7 +347,6 @@ btrfsTweaks() { liveOSrestore() { clear - mkdir /tmp/live SCRIPT=$(pwd) INSTALL_TYPE=$(mount | grep ' / ') #if [[ $INSTALL_TYPE = *mapper* ]]; then @@ -400,7 +401,6 @@ liveOSrestore() { fi cd - umount /tmp/live #unmount } @@ -486,11 +486,37 @@ services() { echo '[Service]' >> /usr/lib/systemd/system/zram_swap.service echo 'Type=oneshot' >> /usr/lib/systemd/system/zram_swap.service echo 'RemainAfterExit=true' >> /usr/lib/systemd/system/zram_swap.service - echo 'ExecStart=/bin/sh -c "exec /sbin/zram-init -p 32767 -s2 -azstd -Lzram_swap 32000 "' >> /usr/lib/systemd/system/zram_swap.service + echo 'ExecStart=/bin/sh -c "exec /sbin/zram-init -p 32767 -s2 -azstd -Lzram_swap 50048 "' >> /usr/lib/systemd/system/zram_swap.service echo 'ExecStop=/sbin/zram-init 0' >> /usr/lib/systemd/system/zram_swap.service echo '[Install]' >> /usr/lib/systemd/system/zram_swap.service echo 'WantedBy=swap.target' >> /usr/lib/systemd/system/zram_swap.service + echo '[Unit]' > /usr/lib/systemd/system/zram_var_tmp.service + echo 'Description=Mount /var/tmp as zram' >> /usr/lib/systemd/system/zram_var_tmp.service + echo 'DefaultDependencies=no' >> /usr/lib/systemd/system/zram_var_tmp.service + echo 'Conflicts=umount.target' >> /usr/lib/systemd/system/zram_var_tmp.service + echo 'Before=local-fs.target umount.target' >> /usr/lib/systemd/system/zram_var_tmp.service + echo '[Service]' >> /usr/lib/systemd/system/zram_var_tmp.service + echo 'Type=oneshot' >> /usr/lib/systemd/system/zram_var_tmp.service + echo 'RemainAfterExit=true' >> /usr/lib/systemd/system/zram_var_tmp.service + echo 'ExecStart=/sbin/zram-init -d2 -s2 -azstd -text4 -orelatime -m1777 -Lvar_tmp_dir 50048 /var/tmp' >> /usr/lib/systemd/system/zram_var_tmp.service + echo 'ExecStop=/sbin/zram-init -d2 0 /var/tmp' >> /usr/lib/systemd/system/zram_var_tmp.service + echo '[Install]' >> /usr/lib/systemd/system/zram_var_tmp.service + echo 'WantedBy=local-fs-pre.target' >> /usr/lib/systemd/system/zram_var_tmp.service + + echo '[Unit]' > /usr/lib/systemd/system/zram_tmp.service + echo 'Description=Mount /tmp as zram. Mask tmp.mount if you use this' >> /usr/lib/systemd/system/zram_tmp.service + echo 'DefaultDependencies=no' >> /usr/lib/systemd/system/zram_tmp.service + echo 'Conflicts=umount.target' >> /usr/lib/systemd/system/zram_tmp.service + echo 'Before=local-fs.target umount.target' >> /usr/lib/systemd/system/zram_tmp.service + echo '[Service]' >> /usr/lib/systemd/system/zram_tmp.service + echo 'Type=oneshot' >> /usr/lib/systemd/system/zram_tmp.service + echo 'RemainAfterExit=true' >> /usr/lib/systemd/system/zram_tmp.service + echo 'ExecStart=/sbin/zram-init -d1 -s2 -azstd -text4 -ostrictatime -m1777 -Ltmp_dir 50048 /tmp' >> /usr/lib/systemd/system/zram_tmp.service + echo 'ExecStop=/sbin/zram-init -d1 0 /tmp' >> /usr/lib/systemd/system/zram_tmp.service + echo '[Install]' >> /usr/lib/systemd/system/zram_tmp.service + echo 'WantedBy=local-fs-pre.target' >> /usr/lib/systemd/system/zram_tmp.service + for i in "${SERVICES[@]}"; do systemctl enable --now $i done @@ -528,8 +554,8 @@ fstab() { echo "UUID=$(/sbin/blkid -s UUID -o value $ROOT_MAPPER_NAME) /var/lib/libvirt btrfs noatime,nodiratime,autodefrag,$COMPRESSION,subvol=@libvirt 0 1" >>$TARGET/etc/fstab echo "UUID=$(/sbin/blkid -s UUID -o value $ROOT_MAPPER_NAME) /var/lib/flatpak btrfs noatime,nodiratime,autodefrag,$COMPRESSION,subvol=@flatpak 0 1" >>$TARGET/etc/fstab echo "tmpfs /var/log tmpfs defaults,dev,exec 0 0" >>$TARGET/etc/fstab - echo "tmpfs /tmp tmpfs defaults,size=32G 0 0" >>$TARGET/etc/fstab - echo "tmpfs /var/tmp/portage tmpfs defaults,size=32G 0 0" >>$TARGET/etc/fstab + echo "/dev/zram1 /tmp tmpfs defaults,size=32G 0 0" >>$TARGET/etc/fstab + echo "/dev/zram2 /var/tmp tmpfs defaults,size=32G 0 0" >>$TARGET/etc/fstab echo "tmpfs /var/lib/systemd/coredump tmpfs defaults,size=5G 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