From 6d65c6f030436ecc8b90fcce452c2c388a368427 Mon Sep 17 00:00:00 2001 From: Jane Doe Date: Sat, 21 Sep 2024 23:08:13 +0000 Subject: [PATCH] Change: 'Graphics Setup' stage > Major code revision in order to comply with the latest Nvidia drivers changes Change: Some minor indentation --- Amelia.sh | 453 ++++++++++++++++++++++++------------------------------ 1 file changed, 199 insertions(+), 254 deletions(-) diff --git a/Amelia.sh b/Amelia.sh index 83adcc2..1ac5283 100644 --- a/Amelia.sh +++ b/Amelia.sh @@ -1,7 +1,7 @@ #!/bin/bash # Amelia Installer -# Version: 7.5 +# Version: 7.6 set -euo pipefail trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR @@ -1718,9 +1718,9 @@ Enter a number ${bwhite}(empty to skip)${blue}: " > Select Nvidia architecture: " NC " - [1] NV110 (Maxwell) Graphics or newer + [1] NV160 (Turing) Graphics or newer - [2] NV160 (Turing) Graphics or newer " + [2] NV110 (Maxwell) Graphics or newer " BLUE " @@ -1732,132 +1732,58 @@ Enter a number: " sleep 0.2 NC " -==> [${green}Maxwell+ OK${nc}] +==> [${green}Turing+ OK${nc}] " elif [[ "${family}" == "2" ]]; then sleep 0.2 - YELLOW " - - - > Select Nvidia driver: " NC " - [1] 'Nvidia-Open' driver - - [2] 'Nvidia' driver " - BLUE " - - -Enter a number: " - read -r -p " -==> " nvdriver - - if [[ "${nvdriver}" == "1" ]]; then - if [[ -n "${vendor2}" ]]; then - sleep 0.2 - YELLOW " - - ### AMD Graphics have also been detected " - RED " - ---------------------------------------------------------------------- - ### ${yellow}There may be incompatibilities with the ${nc}'Nvidia-Open' ${yellow}driver ${red}### - ----------------------------------------------------------------------" - YELLOW " - - - > Please confirm your selection: " - NC " - - [1] 'Nvidia-Open' driver - - [2] 'Nvidia' driver " - BLUE " - - -Enter a number: " - read -r -p " -==> " nvdriver - - if [[ "${nvdriver}" == "1" || "${nvdriver}" == "2" ]]; then - sleep 0.2 - NC " - -==> [${green}Driver Confirmed OK${nc}] " - else - echo - invalid - return 1 - fi - fi - sleep 0.2 - NC " - -==> [${green}Turing+ OK${nc}] - " - elif [[ "${nvdriver}" == "2" ]]; then - sleep 0.2 - NC " - -==> [${green}Turing+ OK${nc}] - " - else - echo - invalid - return 1 - fi +==> [${green}Maxwell+ OK${nc}] + " else echo invalid return 1 fi - if [[ "${kernelnmbr}" == "1" ]]; then - if [[ "${family}" == "1" ]]; then - vgapkgs="libva-nvidia-driver libvdpau-va-gl nvidia nvidia-settings nvidia-utils opencl-nvidia" + + # Turing+ Family + if [[ "${family}" == "1" ]]; then + # Linux Kernel + if [[ "${kernelnmbr}" == "1" ]]; then + nvname="nvidia-open" + vgapkgs="libva-nvidia-driver libvdpau-va-gl nvidia-open nvidia-settings nvidia-utils opencl-nvidia" + # Other Kernels + else + vgapkgs="libva-nvidia-driver libvdpau-va-gl nvidia-open-dkms nvidia-settings nvidia-utils opencl-nvidia" + fi + # Maxwell+ Family + elif [[ "${family}" == "2" ]]; then + # Linux Kernel + if [[ "${kernelnmbr}" == "1" ]]; then nvname="nvidia" - elif [[ "${family}" == "2" ]]; then - if [[ "${nvdriver}" == "1" ]]; then - vgapkgs="libva-nvidia-driver libvdpau-va-gl nvidia-open nvidia-settings nvidia-utils opencl-nvidia" - nvname="nvidia-open" - elif [[ "${nvdriver}" == "2" ]]; then - vgapkgs="libva-nvidia-driver libvdpau-va-gl nvidia nvidia-settings nvidia-utils opencl-nvidia" - nvname="nvidia" - fi - fi - elif [[ "${kernelnmbr}" == "2" ]]; then - if [[ "${family}" == "1" ]]; then - vgapkgs="libva-nvidia-driver libvdpau-va-gl nvidia-lts nvidia-settings nvidia-utils opencl-nvidia" + vgapkgs="libva-nvidia-driver libvdpau-va-gl nvidia nvidia-settings nvidia-utils opencl-nvidia" + # Linux LTS Kernel + elif [[ "${kernelnmbr}" == "2" ]]; then nvname="nvidia-lts" - elif [[ "${family}" == "2" ]]; then - if [[ "${nvdriver}" == "1" ]]; then - vgapkgs="libva-nvidia-driver libvdpau-va-gl nvidia-open-dkms nvidia-settings nvidia-utils opencl-nvidia" - elif [[ "${nvdriver}" == "2" ]]; then - vgapkgs="libva-nvidia-driver libvdpau-va-gl nvidia-lts nvidia-settings nvidia-utils opencl-nvidia" - nvname="nvidia-lts" - fi - fi - else - if [[ "${family}" == "1" ]]; then + vgapkgs="libva-nvidia-driver libvdpau-va-gl nvidia-lts nvidia-settings nvidia-utils opencl-nvidia" + # Other Kernels + else vgapkgs="libva-nvidia-driver libvdpau-va-gl nvidia-dkms nvidia-settings nvidia-utils opencl-nvidia" - elif [[ "${family}" == "2" ]]; then - if [[ "${nvdriver}" == "1" ]]; then - vgapkgs="libva-nvidia-driver libvdpau-va-gl nvidia-open-dkms nvidia-settings nvidia-utils opencl-nvidia" - elif [[ "${nvdriver}" == "2" ]]; then - vgapkgs="libva-nvidia-driver libvdpau-va-gl nvidia-dkms nvidia-settings nvidia-utils opencl-nvidia" - fi fi fi - sleep 0.2 - YELLOW " + + sleep 0.2 + YELLOW " > Enable Nvidia's 'Suspend-Hibernate-Resume' Video Memory Preserving feature ? [y/n] " - BLUE " + BLUE " Enter [y/n]: " - read -r -p " + read -r -p " ==> " nvidia_suspend - echo + echo if [[ "${nvidia_suspend}" == "n" ]]; then skip @@ -1884,6 +1810,7 @@ Enter [y/n]: " return 1 fi fi + sleep 0.2 YELLOW " @@ -5349,17 +5276,17 @@ main_chroot() { export LANG=${SETLOCALE} || exit echo KEYMAP=${SETKBD} > /etc/vconsole.conf || exit cat <<-MKINIT_CONF > /etc/mkinitcpio.conf.d/mkinitcpiod.conf || exit - ${mkinitcpio_mods} - ${mkinitcpio_hooks} + ${mkinitcpio_mods} + ${mkinitcpio_hooks} MKINIT_CONF mkinitcpio -P || exit ln -sf /usr/share/zoneinfo/$(curl -s http://ip-api.com/line?fields=timezone) /etc/localtime || exit hwclock --systohc || exit echo ${HOSTNAME} > /etc/hostname || exit cat <<-HOSTS > /etc/hosts || exit - 127.0.0.1 localhost - ::1 localhost - 127.0.1.1 ${HOSTNAME}.localdomain ${HOSTNAME} + 127.0.0.1 localhost + ::1 localhost + 127.0.1.1 ${HOSTNAME}.localdomain ${HOSTNAME} HOSTS echo root:${ROOTPASSWD2} | chpasswd || exit useradd -m -G wheel -s /bin/bash ${USERNAME} || exit @@ -5384,10 +5311,10 @@ btldr_conf() { bootctl --esp-path=/efi --boot-path=/boot install || exit echo "default arch.conf" > /boot/loader/loader.conf || exit cat <<-SDBOOT_CONF > /boot/loader/entries/arch.conf || exit - title ${entrname} - linux /vmlinuz-${kernel} - initrd /initramfs-${kernel}.img - options rw ${boot_opts} + title ${entrname} + linux /vmlinuz-${kernel} + initrd /initramfs-${kernel}.img + options rw ${boot_opts} SDBOOT_CONF systemctl enable systemd-boot-update || exit XBOOTCTL @@ -5411,10 +5338,10 @@ XBOOTCTL bootctl install || exit echo "default arch.conf" > /boot/loader/loader.conf || exit cat <<-SDBOOT_CONF > /boot/loader/entries/arch.conf || exit - title ${entrname} - linux /vmlinuz-${kernel} - initrd /initramfs-${kernel}.img - options rw ${boot_opts} + title ${entrname} + linux /vmlinuz-${kernel} + initrd /initramfs-${kernel}.img + options rw ${boot_opts} SDBOOT_CONF systemctl enable systemd-boot-update || exit BOOTCTL @@ -5455,7 +5382,7 @@ BOOTCTL GRUB_DISABLE_OS_PROBER=false #GRUB_TERMINAL_OUTPUT=console GRUB_CONF - grub-mkconfig -o /boot/grub/grub.cfg + grub-mkconfig -o /boot/grub/grub.cfg GRUB stage_ok else @@ -5468,12 +5395,12 @@ GRUB esp_dev_uuid="$(lsblk -dno UUID "${esp_dev}")" if arch-chroot /mnt <<-GRUB_UKI > /dev/null 2>&1 ; then cat <<-GRUB_UKI_ENTRY >> /boot/grub/custom.cfg - menuentry "Arch Linux" { - insmod fat - insmod chain - search --no-floppy --set=root --fs-uuid ${esp_dev_uuid} - chainloader /EFI/Linux/arch-${kernel}.efi - } + menuentry "Arch Linux" { + insmod fat + insmod chain + search --no-floppy --set=root --fs-uuid ${esp_dev_uuid} + chainloader /EFI/Linux/arch-${kernel}.efi + } GRUB_UKI_ENTRY GRUB_UKI stage_ok @@ -5563,9 +5490,9 @@ zram_conf() { if arch-chroot /mnt <<-ZRAM > /dev/null 2>&1 ; then mkdir -p /etc/systemd/zram-generator.conf.d cat <<-ZRAM_CONF > /etc/systemd/zram-generator.conf.d/zram.conf || exit - [zram0] - zram-size = ram / 2 - compression-algorithm = zstd + [zram0] + zram-size = ram / 2 + compression-algorithm = zstd ZRAM_CONF systemctl daemon-reload || exit systemctl start ${zram_service} || exit @@ -5580,26 +5507,26 @@ ZRAM nvidia_hook_conf() { if [[ "${vgaconf}" == "y" && "${vendor}" == "Nvidia" ]]; then - if [[ "${kernelnmbr}" == "1" ]] || [[ "${kernelnmbr}" == "2" && "${family}" == "1" ]] || [[ "${kernelnmbr}" == "2" && "${family}" == "2" && "${nvdriver}" == "2" ]]; then + if [[ "${nvname}" == "nvidia-open" ]] || [[ "${nvname}" == "nvidia" ]] || [[ "${nvname}" == "nvidia-lts" ]]; then cnfg local stage_prompt="Nvidia-Hook" - if arch-chroot /mnt <<-NVIDIA_HOOK > /dev/null 2>&1 ; then + if arch-chroot /mnt <<-NVIDIA_HOOK > /dev/null 2>&1 ; then mkdir -p /etc/pacman.d/hooks/ || exit cat <<-HOOK > /etc/pacman.d/hooks/nvidia.hook || exit - [Trigger] - Operation=Install - Operation=Upgrade - Operation=Remove - Type=Package - Target=${nvname} - Target=${kernel} - - [Action] - Description=Update NVIDIA module in initcpio - Depends=mkinitcpio - When=PostTransaction - NeedsTargets - Exec=/bin/sh -c 'while read -r trg; do case $trg in linux*) exit 0; esac; done; /usr/bin/mkinitcpio -P' + [Trigger] + Operation=Install + Operation=Upgrade + Operation=Remove + Type=Package + Target=${nvname} + Target=${kernel} + + [Action] + Description=Update NVIDIA module in initcpio + Depends=mkinitcpio + When=PostTransaction + NeedsTargets + Exec=/bin/sh -c 'while read -r trg; do case $trg in linux*) exit 0; esac; done; /usr/bin/mkinitcpio -P' HOOK NVIDIA_HOOK stage_ok @@ -5615,45 +5542,50 @@ uki_conf() { if [[ "${uki}" == "y" ]]; then cnfg local stage_prompt="UKI" + if [[ ! -e "${esp_mount}"/EFI/Linux ]]; then mkdir -p "${esp_mount}"/EFI/Linux || exit fi - if [[ "${bootloader}" == "1" ]]; then - if arch-chroot /mnt <<- UKI > /dev/null 2>&1 ; then - mkdir /etc/cmdline.d || exit - echo "rw ${boot_opts}" | tee /etc/cmdline.d/cmdline.conf || exit - cp /etc/mkinitcpio.d/${kernel}.preset /etc/mkinitcpio.d/${kernel}.preset.bak - cat <<-MKINITCPIO_PRESET > /etc/mkinitcpio.d/${kernel}.preset || exit - ALL_kver="/boot/vmlinuz-${kernel}" - PRESETS=('default') - default_config="/etc/mkinitcpio.conf.d/mkinitcpiod.conf" - default_uki="${btldr_esp_mount}/EFI/Linux/arch-${kernel}.efi" + + if [[ "${bootloader}" == "1" ]]; then + if arch-chroot /mnt <<- UKI > /dev/null 2>&1 ; then + mkdir /etc/cmdline.d || exit + echo "rw ${boot_opts}" | tee /etc/cmdline.d/cmdline.conf || exit + cp /etc/mkinitcpio.d/${kernel}.preset /etc/mkinitcpio.d/${kernel}.preset.bak + cat <<-MKINITCPIO_PRESET > /etc/mkinitcpio.d/${kernel}.preset || exit + ALL_kver="/boot/vmlinuz-${kernel}" + PRESETS=('default') + default_config="/etc/mkinitcpio.conf.d/mkinitcpiod.conf" + default_uki="${btldr_esp_mount}/EFI/Linux/arch-${kernel}.efi" MKINITCPIO_PRESET - mkinitcpio -P || exit + mkinitcpio -P || exit UKI stage_ok else stage_fail fi - if [[ -e /mnt/boot/initramfs-"${kernel}".img ]]; then - rm /mnt/boot/initramfs-"${kernel}".img || exit - fi - if [[ -e /mnt/boot/initramfs-"${kernel}"-fallback.img ]]; then - rm /mnt/boot/initramfs-"${kernel}"-fallback.img || exit - fi + + if [[ -e /mnt/boot/initramfs-"${kernel}".img ]]; then + rm /mnt/boot/initramfs-"${kernel}".img || exit + fi + + if [[ -e /mnt/boot/initramfs-"${kernel}"-fallback.img ]]; then + rm /mnt/boot/initramfs-"${kernel}"-fallback.img || exit + fi + elif [[ "${bootloader}" == "2" ]]; then - if arch-chroot /mnt <<- UKI > /dev/null 2>&1 ; then - mkdir /etc/cmdline.d || exit - echo "rw ${boot_opts}" | tee /etc/cmdline.d/cmdline.conf || exit - cp /etc/mkinitcpio.d/${kernel}.preset /etc/mkinitcpio.d/${kernel}.preset.bak - cat <<-MKINITCPIO_PRESET > /etc/mkinitcpio.d/${kernel}.preset || exit - ALL_kver="/boot/vmlinuz-${kernel}" - PRESETS=('default') - default_config="/etc/mkinitcpio.conf.d/mkinitcpiod.conf" - default_image="/boot/initramfs-${kernel}.img" - default_uki="${btldr_esp_mount}/EFI/Linux/arch-${kernel}.efi" + if arch-chroot /mnt <<- UKI > /dev/null 2>&1 ; then + mkdir /etc/cmdline.d || exit + echo "rw ${boot_opts}" | tee /etc/cmdline.d/cmdline.conf || exit + cp /etc/mkinitcpio.d/${kernel}.preset /etc/mkinitcpio.d/${kernel}.preset.bak + cat <<-MKINITCPIO_PRESET > /etc/mkinitcpio.d/${kernel}.preset || exit + ALL_kver="/boot/vmlinuz-${kernel}" + PRESETS=('default') + default_config="/etc/mkinitcpio.conf.d/mkinitcpiod.conf" + default_image="/boot/initramfs-${kernel}.img" + default_uki="${btldr_esp_mount}/EFI/Linux/arch-${kernel}.efi" MKINITCPIO_PRESET - mkinitcpio -P || exit + mkinitcpio -P || exit UKI stage_ok else @@ -5733,7 +5665,7 @@ set_vars() { # Set Default '/Temp' path vga_bootopts="nvidia_drm.modeset=1 nvidia_drm.fbdev=1 nvidia.NVreg_UsePageAttributeTable=1 nvidia.NVreg_PreserveVideoMemoryAllocations=1 " fi - # No Preserve-Nvidia-Video-Memory after suspend/hibernate/resume + # No-Preserve-Nvidia-Video-Memory after suspend/hibernate/resume else # Mkinitcpio Modules (Encryption) [Early Nvidia KMS] mkinitcpio_mods="MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm ${fs_mod})" @@ -5762,8 +5694,8 @@ set_vars() { ## Configuration = 'No' elif [[ "${vgaconf}" == "n" ]]; then # Mkinitcpio Hooks (Encryption) - mkinitcpio_hooks="HOOKS=(systemd keyboard autodetect microcode modconf kms sd-vconsole block sd-encrypt filesystems fsck)" - # Nvidia + mkinitcpio_hooks="HOOKS=(systemd keyboard autodetect microcode modconf kms sd-vconsole block sd-encrypt filesystems fsck)" + # Nvidia if [[ "${vendor}" == "Nvidia" ]]; then # Mkinitcpio Modules (Encryption) mkinitcpio_mods="MODULES=(${fs_mod} nouveau)" @@ -5840,8 +5772,8 @@ set_vars() { ## Configuration = 'No' elif [[ "${vgaconf}" == "n" ]]; then # Mkinitcpio Hooks - mkinitcpio_hooks="HOOKS=(systemd autodetect microcode modconf kms keyboard sd-vconsole block filesystems fsck)" - # Nvidia + mkinitcpio_hooks="HOOKS=(systemd autodetect microcode modconf kms keyboard sd-vconsole block filesystems fsck)" + # Nvidia if [[ "${vendor}" == "Nvidia" ]]; then # Mkinitcpio Modules mkinitcpio_mods="MODULES=(nouveau)" @@ -5876,6 +5808,7 @@ ${magenta}###${nc}--------------------------------${magenta}[ ${bwhite}Chroot & if [[ "${packages}" =~ ^(1|3|5|6|7|8|9|10|11)$ ]]; then cnfg main_chroot + if [[ -f /mnt/etc/lightdm/lightdm.conf ]]; then cnfg if [[ "${packages}" == "7" ]]; then @@ -5907,6 +5840,7 @@ SLICK fi fi fi + if [[ -n "${bluetooth}" ]]; then cnfg stage_prompt="Bluetooth Service" @@ -5918,6 +5852,7 @@ BLUETOOTH stage_fail fi fi + if [[ -n "${displaymanager}" ]]; then cnfg stage_prompt="Display Manager Service" @@ -5929,6 +5864,7 @@ DM_SERVICE stage_fail fi fi + if [[ -n "${network}" ]]; then cnfg stage_prompt="Network Manager Service" @@ -5940,6 +5876,7 @@ NETWORK stage_fail fi fi + btldr_conf trim_conf vm_serv_conf @@ -5954,10 +5891,11 @@ NETWORK if [[ "${packages}" == "12" ]]; then cnfg main_chroot + if [[ -f /mnt/etc/lightdm/lightdm.conf ]]; then cnfg - if [[ "${greeternmbr}" == "1" ]]; then - stage_prompt="GTK Greeter" + if [[ "${greeternmbr}" == "1" ]]; then + stage_prompt="GTK Greeter" if arch-chroot /mnt <<-GTK > /dev/null 2>&1 ; then sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=lightdm-gtk-greeter|g' /etc/lightdm/lightdm.conf || exit GTK @@ -5985,6 +5923,7 @@ DEEPIN fi fi fi + if [[ -n "${customservices}" ]]; then cnfg stage_prompt="Custom Service(s)" @@ -5996,6 +5935,7 @@ CUSTOM_SERV stage_fail fi fi + btldr_conf trim_conf vm_serv_conf @@ -6010,16 +5950,19 @@ CUSTOM_SERV if [[ "${packages}" == "2" || "${packages}" == "4" ]]; then stage_prompt="Optimized System" cnfg + if [[ "${packages}" == "2" ]]; then displaymanager="sddm" elif [[ "${packages}" == "4" ]]; then displaymanager="gdm" fi + if [[ -n "${nrg_plc}" ]]; then arch-chroot /mnt <<-NRG > /dev/null 2>&1 ${nrg_plc} performance NRG fi + if arch-chroot /mnt <<-OPTIMIZED_CONF > /dev/null 2>&1 ; then sed -i "/^#${SETLOCALE}/s/^#//" /etc/locale.gen || exit locale-gen || exit @@ -6029,77 +5972,77 @@ NRG sed -i "/^#Color/s/^#//" /etc/pacman.conf || exit update-pciids || exit cat <<-MKINITCPIO_CONF > /etc/mkinitcpio.conf.d/mkinitcpiod.conf || exit - ${mkinitcpio_mods} - ${mkinitcpio_hooks} - COMPRESSION="zstd" - COMPRESSION_OPTIONS=(-c -T$(nproc) --auto-threads=logical -) - MODULES_DECOMPRESS="yes" + ${mkinitcpio_mods} + ${mkinitcpio_hooks} + COMPRESSION="zstd" + COMPRESSION_OPTIONS=(-c -T$(nproc) --auto-threads=logical -) + MODULES_DECOMPRESS="yes" MKINITCPIO_CONF mkinitcpio -P || exit cat <<-MAKEPKG_CONF > /etc/makepkg.conf.d/makepkgd.conf || exit - CFLAGS="-march=native -O2 -pipe -fno-plt -fexceptions \ - -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \ - -fstack-clash-protection -fcf-protection \ - -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer" - MAKEFLAGS="-j4" - BUILDENV=(!distcc color ccache check !sign) - OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug lto) - COMPRESSGZ=(pigz -c -f -n) - COMPRESSBZ2=(pbzip2 -c -f) - COMPRESSZST=(zstd -c -T0 --auto-threads=logical -) + CFLAGS="-march=native -O2 -pipe -fno-plt -fexceptions \ + -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \ + -fstack-clash-protection -fcf-protection \ + -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer" + MAKEFLAGS="-j4" + BUILDENV=(!distcc color ccache check !sign) + OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug lto) + COMPRESSGZ=(pigz -c -f -n) + COMPRESSBZ2=(pbzip2 -c -f) + COMPRESSZST=(zstd -c -T0 --auto-threads=logical -) MAKEPKG_CONF ln -sf /usr/share/zoneinfo/$(curl -s http://ip-api.com/line?fields=timezone) /etc/localtime || exit hwclock --systohc || exit echo ${HOSTNAME} > /etc/hostname || exit cat <<-HOSTS >> /etc/hosts || exit - 127.0.0.1 localhost - ::1 localhost - 127.0.1.1 ${HOSTNAME}.localdomain ${HOSTNAME} + 127.0.0.1 localhost + ::1 localhost + 127.0.1.1 ${HOSTNAME}.localdomain ${HOSTNAME} HOSTS cat <<-SYSCTL_CONF > /etc/sysctl.d/99-sysctld.conf || exit - net.core.netdev_max_backlog = 16384 - net.core.somaxconn = 8192 - net.core.rmem_default = 1048576 - net.core.rmem_max = 16777216 - net.core.wmem_default = 1048576 - net.core.wmem_max = 16777216 - net.core.optmem_max = 65536 - net.ipv4.tcp_rmem = 4096 1048576 2097152 - net.ipv4.tcp_wmem = 4096 65536 16777216 - net.ipv4.udp_rmem_min = 8192 - net.ipv4.udp_wmem_min = 8192 - net.ipv4.tcp_fastopen = 3 - net.ipv4.tcp_max_syn_backlog = 8192 - net.ipv4.tcp_max_tw_buckets = 2000000 - net.ipv4.tcp_tw_reuse = 1 - net.ipv4.tcp_fin_timeout = 10 - net.ipv4.tcp_slow_start_after_idle = 0 - net.ipv4.tcp_keepalive_time = 60 - net.ipv4.tcp_keepalive_intvl = 10 - net.ipv4.tcp_keepalive_probes = 6 - net.ipv4.tcp_mtu_probing = 1 - net.ipv4.tcp_sack = 1 - net.core.default_qdisc = cake - net.ipv4.tcp_congestion_control = bbr - net.ipv4.ip_local_port_range = 30000 65535 - net.ipv4.conf.default.rp_filter = 1 - net.ipv4.conf.all.rp_filter = 1 - vm.vfs_cache_pressure = 50 - vm.mmap_min_addr = 65536 - kernel.printk = 0 0 0 0 - ${perf_stream} + net.core.netdev_max_backlog = 16384 + net.core.somaxconn = 8192 + net.core.rmem_default = 1048576 + net.core.rmem_max = 16777216 + net.core.wmem_default = 1048576 + net.core.wmem_max = 16777216 + net.core.optmem_max = 65536 + net.ipv4.tcp_rmem = 4096 1048576 2097152 + net.ipv4.tcp_wmem = 4096 65536 16777216 + net.ipv4.udp_rmem_min = 8192 + net.ipv4.udp_wmem_min = 8192 + net.ipv4.tcp_fastopen = 3 + net.ipv4.tcp_max_syn_backlog = 8192 + net.ipv4.tcp_max_tw_buckets = 2000000 + net.ipv4.tcp_tw_reuse = 1 + net.ipv4.tcp_fin_timeout = 10 + net.ipv4.tcp_slow_start_after_idle = 0 + net.ipv4.tcp_keepalive_time = 60 + net.ipv4.tcp_keepalive_intvl = 10 + net.ipv4.tcp_keepalive_probes = 6 + net.ipv4.tcp_mtu_probing = 1 + net.ipv4.tcp_sack = 1 + net.core.default_qdisc = cake + net.ipv4.tcp_congestion_control = bbr + net.ipv4.ip_local_port_range = 30000 65535 + net.ipv4.conf.default.rp_filter = 1 + net.ipv4.conf.all.rp_filter = 1 + vm.vfs_cache_pressure = 50 + vm.mmap_min_addr = 65536 + kernel.printk = 0 0 0 0 + ${perf_stream} SYSCTL_CONF cat <<-UDISKS2_CONF > /etc/udisks2/mount_options.conf || exit - [defaults] - ntfs:ntfs3_defaults=uid=1000,gid=1000,windows_names - ntfs:ntfs3_allow=uid=1000,gid=1000,umask,dmask,fmask,iocharset,discard,nodiscard,sparse,nosparse,hidden,nohidden,sys_immutable,nosys_immutable,showmeta,noshowmeta,prealloc,noprealloc,hide_dot_files,nohide_dot_files,windows_names,nocase,case + [defaults] + ntfs:ntfs3_defaults=uid=1000,gid=1000,windows_names + ntfs:ntfs3_allow=uid=1000,gid=1000,umask,dmask,fmask,iocharset,discard,nodiscard,sparse,nosparse,hidden,nohidden,sys_immutable,nosys_immutable,showmeta,noshowmeta,prealloc,noprealloc,hide_dot_files,nohide_dot_files,windows_names,nocase,case UDISKS2_CONF cat <<-POLKIT_CONF > /etc/polkit-1/rules.d/99-udisks2.rules || exit - // Original rules: https://github.com/coldfix/udiskie/wiki/Permissions - // Changes: Added org.freedesktop.udisks2.filesystem-mount-system, as this is used by Dolphin. - polkit.addRule(function(action, subject) { - var YES = polkit.Result.YES; - var permission = { + // Original rules: https://github.com/coldfix/udiskie/wiki/Permissions + // Changes: Added org.freedesktop.udisks2.filesystem-mount-system, as this is used by Dolphin. + polkit.addRule(function(action, subject) { + var YES = polkit.Result.YES; + var permission = { // required for udisks1: "org.freedesktop.udisks.filesystem-mount": YES, "org.freedesktop.udisks.luks-unlock": YES, @@ -6119,40 +6062,40 @@ UDISKS2_CONF "org.freedesktop.udisks2.encrypted-unlock-system": YES, "org.freedesktop.udisks2.eject-media-other-seat": YES, "org.freedesktop.udisks2.power-off-drive-other-seat": YES - }; - if (subject.isInGroup("wheel")) { - return permission[action.id]; - } - }); + }; + if (subject.isInGroup("wheel")) { + return permission[action.id]; + } + }); POLKIT_CONF mkdir -p /etc/systemd/journald.conf.d > /dev/null 2>&1 || exit cat <<-JOURNAL_CONF > /etc/systemd/journald.conf.d/00-journald.conf || exit - [Journal] - SystemMaxUse=100M + [Journal] + SystemMaxUse=100M JOURNAL_CONF mkdir -p /etc/systemd/user.conf.d > /dev/null 2>&1 || exit cat <<-USER_CONF > /etc/systemd/user.conf.d/00-userd.conf || exit - [Manager] - DefaultTimeoutStopSec=5s - DefaultTimeoutAbortSec=5s + [Manager] + DefaultTimeoutStopSec=5s + DefaultTimeoutAbortSec=5s USER_CONF sed -i 's|^hosts.*|hosts: mymachines mdns_minimal resolve [!UNAVAIL=return] files myhostname dns|g' /etc/nsswitch.conf || exit sed -i 's/ interface = [^ ]*/ interface = all/g' /etc/ipp-usb/ipp-usb.conf || exit sed -i "/# set linenumbers/"'s/^#//' /etc/nanorc || exit echo tcp_bbr | tee /etc/modules-load.d/modulesd.conf || exit cat <<-SUPPLICANT_CONF > /etc/wpa_supplicant/wpa_supplicant.conf || exit - country=${REGDOM} - wps_cred_add_sae=1 - pmf=2 + country=${REGDOM} + wps_cred_add_sae=1 + pmf=2 SUPPLICANT_CONF echo root:${ROOTPASSWD2} | chpasswd || exit chsh -s /bin/zsh || exit useradd -m -G wheel,realtime -s /bin/zsh ${USERNAME} || exit echo ${USERNAME}:${USERPASSWD2} | chpasswd || exit cat <<-SUDOERS_CONF > /etc/sudoers.d/sudoersd || exit - Defaults pwfeedback - Defaults editor=/usr/bin/nano - %wheel ALL=(ALL) ALL + Defaults pwfeedback + Defaults editor=/usr/bin/nano + %wheel ALL=(ALL) ALL SUDOERS_CONF visudo -c /etc/sudoers.d/sudoersd systemctl enable avahi-daemon bluetooth cups ipp-usb NetworkManager rngd ${displaymanager} ${trim} ${vm_services} ${nvidia_services} || exit @@ -6161,12 +6104,14 @@ OPTIMIZED_CONF else stage_fail fi + btldr_conf zram_conf nvidia_hook_conf uki_conf completion fi + umount -R /mnt exit }