diff --git a/Amelia.sh b/Amelia.sh index 9ac13c1..686b6a9 100644 --- a/Amelia.sh +++ b/Amelia.sh @@ -2,7 +2,7 @@ # Amelia Installer # Source: https://gitlab.com/prism7/archery -# Version: 8.12.4 +# Version: 8.13.0 set -euo pipefail ################################################################################################### @@ -52,11 +52,11 @@ reload() { --> [${green}Reloading${nc}] " } -process() { +next() { sleep 0.2 NC " - --> [${green}Processing..${nc}] " + --> [${green}Loading next stage..${nc}] " } pkg_displ() { sleep 0.2 @@ -514,36 +514,6 @@ ${magenta}###${nc}------------------------------------${magenta}[ ${bwhite}Machi ### The ${nc}${cpu_name} ${yellow}cpu microcode will be installed " - fi - YELLOW " - - - > Disable ${nc}Watchdogs ${yellow}in the installed system ? [Y/n] - - - ### Applicable for non-critical platforms such as desktops & laptops " - BLUE " - - -Enter [Y/n]: " - read -r -p " -==> " kill_watchdog - - echo - kill_watchdog="${kill_watchdog:-y}" - kill_watchdog="${kill_watchdog,,}" - - if [[ "${kill_watchdog}" == "y" ]]; then - sleep 0.2 - YELLOW " - - ### Watchdogs will be disabled - " - elif [[ "${kill_watchdog}" == "n" ]]; then - skip - else - y_n - return 1 fi ok } @@ -562,7 +532,7 @@ ${magenta}###${nc}----------------------------------------${magenta}[ ${bwhite}M if [[ -e /usr/bin/pv ]]; then CYAN " - (*) ${nc}Select ${bwhite}[4] ${nc}to utilize ${yellowl}'Guided Navigation' ${nc}& ${yellowl}'Smart Partitioning' ${nc}features + (*) ${nc}Select ${bwhite}[4] ${nc}to utilize ${yellowl}'Assisted Navigation' ${nc}& ${yellowl}'Smart Partitioning' ${nc}features " | pv -qL 70 else CYAN " @@ -925,6 +895,8 @@ ${magenta}###${nc}----------------------------------${magenta}[ ${bwhite}System [6] Wireless Regulatory Domain Setup + [7] System Optimizations + [ ] Return to Main Menu " BLUE " @@ -957,6 +929,9 @@ Enter a number: " 6) until wireless_rgd; do : ; done return 1 ;; + 7) + until sys_opt; do : ; done + return 1 ;; "") until main_menu; do : ; done ;; *) @@ -1399,7 +1374,6 @@ Enter a number: " sleep 0.2 YELLOW " - > Enable ${nc}systemd-oomd ${yellow}for enhanced 'OOM' management ? [Y/n]" BLUE " @@ -1976,11 +1950,11 @@ ${magenta}###${nc}--------------------------------------${magenta}[ ${bwhite}Des [1] Plasma - [2] Minimal Plasma + Desktop Apps + System Optimizations + [2] Minimal Plasma + Desktop Apps [3] Gnome - [4] Minimal Gnome + Desktop Apps + System Optimizations + [4] Minimal Gnome + Desktop Apps [5] Xfce @@ -1998,7 +1972,7 @@ ${magenta}###${nc}--------------------------------------${magenta}[ ${bwhite}Des [12] Custom Arch Linux - [13] Cosmic ${red}# ${yellow}Alpha ${red}# " + [13] Cosmic ${red}### ${yellow}Alpha ${red}### " BLUE " @@ -2153,6 +2127,7 @@ Enter [Y/n]: " return 1 ;; esac + if [[ "${packages}" =~ ^(1|2|3|4|5|6|7|8|9|10|13)$ ]]; then sleep 0.2 YELLOW " @@ -2175,78 +2150,55 @@ Enter a number ${bwhite}(empty to skip)${blue}: " ==> " web local prompt="Web Browser" - case "${web}" in - 1) - web_browser="firefox" - ok ;; - 2) - web_browser="chromium" - ok ;; - 3) - web_browser="vivaldi" - ok ;; - "") - skip ;; - *) - invalid - return 1 ;; - esac + case "${web}" in + 1) + web_browser="firefox" + ok ;; + 2) + web_browser="chromium" + ok ;; + 3) + web_browser="vivaldi" + ok ;; + "") + web_browser="" + skip ;; + *) + invalid + return 1 ;; + esac - sleep 0.2 - YELLOW " + if [[ "${hypervisor}" == "none" ]]; then + sleep 0.2 + YELLOW " - ### Printing support is available + ### Printer & Scanner support is available - > Enable Printing support ? [Y/n] " - BLUE " + > Enable support ? [Y/n] " + BLUE " Enter [Y/n]: " - read -r -p " + read -r -p " ==> " printer - printer="${printer:-y}" - printer="${printer,,}" + printer="${printer:-y}" + printer="${printer,,}" + local prompt="Printer & Scanner Support" - case "${printer}" in - y) - local prompt="Printer Support" - print_pkgs="cups-pdf cups-browsed cups-pk-helper ipp-usb system-config-printer xdg-utils colord" - ok ;; - n) - skip ;; - *) - invalid - return 1 ;; - esac - - sleep 0.2 - YELLOW " - - - ### Custom Kernel Parameters can be set at boot time - - > Enter your own additional Kernel Parameters ? [y/N] " - BLUE " - - -Enter [y/N]: " - read -r -p " -==> " ask_param - - ask_param="${ask_param:-n}" - ask_param="${ask_param,,}" - - case "${ask_param}" in - y) - add_prmtrs ;; - n) - skip ;; - *) - invalid - return 1 ;; - esac + case "${printer}" in + y) + print_pkgs="cups-pdf cups-browsed cups-pk-helper ipp-usb nss-mdns sane-airscan system-config-printer xdg-utils colord" + ok ;; + n) + skip ;; + *) + invalid + return 1 ;; + esac + fi + fi local prompt="Desktop Setup" ok } @@ -2256,7 +2208,6 @@ cust_sys() { local prompt="Custom Arch Linux" until add_pkgs; do : ; done until add_services; do : ; done - until add_prmtrs; do : ; done echo ok } @@ -2272,8 +2223,7 @@ ${magenta}###${nc}------------------------------------${magenta}[ ${bwhite}Add Y " YELLOW " - ### 'base', 'linux-firmware' (if on bare-metal), 'sudo' & your current choices are already included - " + ### 'base', 'linux-firmware' (if on bare-metal), 'sudo' & your current choices are already included " BLUE " @@ -2356,8 +2306,7 @@ ${magenta}###${nc}------------------------------------${magenta}[ ${bwhite}Add Y " YELLOW " - ### Empty to skip - " + ### Empty to skip " BLUE " @@ -2375,16 +2324,13 @@ Enter services to be enabled ${bwhite}(space-seperated)${blue}: " add_prmtrs() { local prompt="Kernel Parameters" - sleep 0.2 - NC " - - -${magenta}###${nc}-------------------------------${magenta}[ ${bwhite}Add Your Kernel Parameters${nc} ${magenta}]${nc}-------------------------------${magenta}### - " YELLOW " - ### Empty to skip - " + + ### Add Your Kernel Parameters + + + ### Empty to skip " BLUE " @@ -2528,6 +2474,102 @@ Enter your Country Code, ie:${nc} ${cyan}US ${bwhite}(empty to skip)${blue}: " wrlss_rgd="yes" } ################################################################################################### +sys_opt() { + + sleep 0.2 + NC " + + +${magenta}###${nc}----------------------------------${magenta}[ ${bwhite}System Optimizations${nc} ${magenta}]${nc}----------------------------------${magenta}### + " + + sleep 0.2 + YELLOW " + + + ### ${nc}Custom ${yellow}Kernel Parameters can be set at boot time + + + > Enter your own additional Kernel Parameters ? [y/N] " + BLUE " + + +Enter [y/N]: " + read -r -p " +==> " ask_param + + ask_param="${ask_param:-n}" + ask_param="${ask_param,,}" + + case "${ask_param}" in + y) + add_prmtrs ;; + n) + skip ;; + *) + invalid + return 1 ;; + esac + + sleep 0.2 + YELLOW " + + + > Disable ${nc}Watchdogs ${yellow}in the installed system ? [Y/n] + + + ### Applicable for non-critical platforms such as desktops & laptops " + BLUE " + + +Enter [Y/n]: " + read -r -p " +==> " kill_watchdog + + kill_watchdog="${kill_watchdog:-y}" + kill_watchdog="${kill_watchdog,,}" + + case "${kill_watchdog}" in + y) + local prompt="Watchdogs Disabled" + ok ;; + n) + skip ;; + *) + invalid + return 1 ;; + esac + + sleep 0.2 + YELLOW " + + + ### System ${nc}Optimizations ${yellow}are available + + + > Enable System Optimizations ? [Y/n] " + BLUE " + + +Enter [Y/n]: " + read -r -p " +==> " sysopt + + sysopt="${sysopt:-y}" + sysopt="${sysopt,,}" + + case "${sysopt}" in + y) + local prompt="System Optimizations" + ok ;; + n) + skip ;; + *) + invalid + return 1 ;; + esac +} +################################################################################################### dsks_submn() { sleep 0.2 @@ -2746,15 +2788,6 @@ ${magenta}###${nc}------------------------------------${magenta}[ ${bwhite}Prese REDBG " [!] WARNING: All data on selected disk will be destroyed [!] " REDBG " ------------------------------------------------------------ " line2 - NC " - - - - ${bwhite}Press any key to continue${nc} - - - " - read -r -s -n 1 YELLOW " > Select a Partition Layout Preset: " @@ -2789,8 +2822,8 @@ Enter a Preset number ${bwhite}(empty to skip)${blue}: " auto_part() { slct_autoprt="yes" - smartpart="" - presetpart="" + #smartpart="" + #presetpart="" local prompt="Disk Partitions" local stage_prompt="Auto-Partitioning" sleep 0.2 @@ -2805,16 +2838,6 @@ ${magenta}###${nc}---------------------------------${magenta}[ ${bwhite}Automati REDBG " [!] WARNING: All data on selected disk will be destroyed [!] " REDBG " ------------------------------------------------------------ " line2 - NC " - - - - ${bwhite}Press any key to continue${nc} - - - " - read -r -s -n 1 - if [[ -e "${instl_drive}" && "${use_manpreset}" != "yes" ]]; then sleep 0.2 NC " @@ -2834,7 +2857,7 @@ ${magenta}###${nc}---------------------------------${magenta}[ ${bwhite}Automati elif [[ "${smartpart}" == "n" ]]; then sgdsk_nmbr="${instl_dsk_nmbr}" use_manpreset="yes" - process + next until man_preset; do : ; done else y_n @@ -2892,7 +2915,7 @@ Enter a disk number ${bwhite}(empty to skip)${blue}: " until man_preset; do : ; done fi elif [[ -z "${preset}" ]] ; then - process + next until manual_part; do : ; done return 0 fi @@ -3805,10 +3828,10 @@ ${multi_swap} elif [[ "${partok}" == "n" ]]; then if [[ "${multibooting}" == "n" ]]; then if [[ "${smartpart}" == "y" ]]; then - process + next until manual_part; do : ; done else - process + next if [[ "${slct_autoprt}" != "yes" && "${xbootloader}" != "yes" ]]; then until auto_part; do : ; done else @@ -3816,7 +3839,7 @@ ${multi_swap} fi fi elif [[ "${multibooting}" == "y" ]]; then - process + next until manual_part; do : ; done fi else @@ -3887,14 +3910,14 @@ ${multi_swap} fi elif [[ "${multibooting}" == "n" ]]; then if [[ "${smartpart}" == "n" && -z "${preset}" ]] ; then - process + next until manual_part; do : ; done elif [[ "${smartpart}" == "n" && -n "${preset}" ]] ; then local stage_prompt="Partitioning" line2 stage_fail else - process + next until auto_part; do : ; done fi fi @@ -4149,6 +4172,11 @@ instl() { fi fi + if [[ -z "${sysopt}" ]]; then + local stage_prompt="System Optimizations" + completion_err + until sys_opt; do : ; done + fi until instl_dsk; do : ; done until ask_crypt; do : ; done @@ -4180,8 +4208,6 @@ swappart() { local stage_prompt="Swap Partition Creation" sleep 0.2 NC " - - ${magenta}###${nc}----------------------------------${magenta}[ ${bwhite}Swap Partition Setup${nc} ${magenta}]${nc}----------------------------------${magenta}### " if mkswap "${swap_dev}" > /dev/null 2> amelia_log.txt ; then @@ -4214,10 +4240,11 @@ set_mode() { return 0 fi + if [[ "${swapmode}" != "1" ]]; then + line2 + fi sleep 0.2 NC " - - ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}Mode Selection${nc} ${magenta}]${nc}-------------------------------------${magenta}### " YELLOW " @@ -5088,7 +5115,7 @@ ${magenta}###${nc}-------------------------------${magenta}[ ${bwhite}Confirm In revise() { revision="yes" - reset=(xbootloader="" gfxconf="" vendor_slct="" vendor="" packages="" custompkgs="" customservices="" cust_bootopts="" REGDOM="" preset="" autoroot="" autoxboot="" autohome="" autoswap="" vendors="" lowlat="" vendors="" nogsp="") + reset=(xbootloader="" gfxconf="" vendor_slct="" vendor="" packages="" custompkgs="" customservices="" cust_bootopts="" REGDOM="" preset="" autoroot="" autoxboot="" autohome="" autoswap="" vendors="" lowlat="" nogsp="" smartpart="" man_preset="" preset="" presetpart="") export "${reset[@]}" gfxpkgs=() @@ -5110,6 +5137,7 @@ revise() { until boot_entr; do : ; done until wireless_rgd; do : ; done fi + until sys_opt; do : ; done until instl_dsk; do : ; done until ask_crypt; do : ; done if [[ "${swapmode}" == "1" ]]; then @@ -5539,58 +5567,87 @@ ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}Pacs case "${packages}" in 1) # Plasma Desktop: - deskpkgs="${basepkgs[*]} plasma dolphin-plugins konsole" + deskpkgs="${basepkgs[*]} plasma dolphin-plugins konsole xdg-desktop-portal" displaymanager="sddm" bluetooth="bluetooth" - network="NetworkManager" ;; + network="NetworkManager" + shell="bash" + rtkit="rtkit-daemon" ;; 2) # Minimal Plasma + Apps: - deskpkgs="${basepkgs[*]} alsa-firmware alsa-utils arj ark bluedevil breeze-gtk ccache dolphin-plugins exfatprogs fdkaac ffmpegthumbs git glibc-locales gst-libav gst-plugin-libcamera gst-plugin-msdk gst-plugin-opencv gst-plugin-pipewire gst-plugin-qmlgl gst-plugin-va gst-plugin-wpe gst-plugins-ugly gstreamer-vaapi htop icoutils kamera kamoso kate kcalc kde-gtk-config kdegraphics-mobipocket kdegraphics-thumbnailers kdenetwork-filesharing kdeplasma-addons kdesdk-kio kdesdk-thumbnailers kdialog keditbookmarks kget kimageformats kinit kio-admin kio-gdrive kio-zeroconf kompare konsole kscreen kvantum kwrited libappimage libfido2 libktorrent libmms libnfs libva-utils lirc lrzip lua52-socket lzop mac man-db man-pages mesa-demos mesa-utils nano-syntax-highlighting nss-mdns ntfs-3g okular opus-tools p7zip packagekit-qt6 pacman-contrib partitionmanager pbzip2 pigz plasma-browser-integration plasma-desktop plasma-disks plasma-firewall plasma-nm plasma-pa plasma-wayland-protocols power-profiles-daemon powerdevil powerline powerline-fonts print-manager python-pyqt6 python-reportlab qbittorrent qt6-imageformats qt6-scxml qt6-virtualkeyboard realtime-privileges reflector rng-tools sddm-kcm skanlite sox spectacle sshfs terminus-font timidity++ ttf-ubuntu-font-family unarchiver unrar unzip usb_modeswitch usbutils vdpauinfo vlc vorbis-tools wget xdg-desktop-portal xdg-desktop-portal-gtk xdg-desktop-portal-kde zip zsh zsh-autosuggestions zsh-completions zsh-syntax-highlighting ${nrg_plc}" ;; + deskpkgs="${basepkgs[*]} alsa-firmware alsa-utils arj ark bluedevil breeze-gtk ccache dolphin-plugins exfatprogs fdkaac ffmpegthumbs git glibc-locales gst-libav gst-plugin-libcamera gst-plugin-msdk gst-plugin-opencv gst-plugin-pipewire gst-plugin-qmlgl gst-plugin-va gst-plugin-wpe gst-plugins-ugly gstreamer-vaapi htop icoutils kamera kamoso kate kcalc kde-gtk-config kdegraphics-mobipocket kdegraphics-thumbnailers kdenetwork-filesharing kdeplasma-addons kdesdk-kio kdesdk-thumbnailers kdialog keditbookmarks kget kimageformats kinit kio-admin kio-gdrive kio-zeroconf kompare konsole kscreen kvantum kwrited libappimage libfido2 libktorrent libmms libnfs libva-utils lirc lrzip lua52-socket lzop mac man-db man-pages mesa-demos mesa-utils nano-syntax-highlighting okular opus-tools p7zip packagekit-qt6 pacman-contrib partitionmanager plasma-browser-integration plasma-desktop plasma-disks plasma-firewall plasma-nm plasma-pa plasma-wayland-protocols power-profiles-daemon powerdevil powerline powerline-fonts print-manager python-pyqt6 python-reportlab qbittorrent qt6-imageformats qt6-scxml qt6-virtualkeyboard realtime-privileges reflector rng-tools sddm-kcm skanlite sox spectacle sshfs terminus-font timidity++ ttf-ubuntu-font-family unarchiver unrar unzip usb_modeswitch usbutils vdpauinfo vlc vorbis-tools wget xdg-desktop-portal xdg-desktop-portal-gtk xdg-desktop-portal-kde zip zsh zsh-autosuggestions zsh-completions zsh-syntax-highlighting ${nrg_plc}" + displaymanager="sddm" + bluetooth="bluetooth" + network="NetworkManager" + shell="zsh" + randomgen="rngd" + rtkit="rtkit-daemon" ;; 3) # Gnome Desktop: - deskpkgs="${basepkgs[*]} gnome" + deskpkgs="${basepkgs[*]} gnome xdg-desktop-portal" displaymanager="gdm" bluetooth="bluetooth" - network="NetworkManager" ;; + network="NetworkManager" + shell="bash" + rtkit="rtkit-daemon" ;; 4) # Minimal Gnome + Apps: - deskpkgs="${basepkgs[*]} dconf-editor evince file-roller gdm gnome-calculator gnome-clocks gnome-console gnome-control-center gnome-disk-utility gnome-keyring gnome-menus gnome-session gnome-shell-extensions gnome-system-monitor gnome-text-editor gnome-tweaks gvfs gvfs-afc gvfs-mtp loupe nautilus power-profiles-daemon simple-scan sushi xdg-desktop-portal-gnome xdg-user-dirs-gtk alsa-firmware alsa-utils ccache exfatprogs fdkaac git glib2-devel glibc-locales gnome-browser-connector gparted gst-libav gst-plugin-libcamera gst-plugin-msdk gst-plugin-opencv gst-plugin-pipewire gst-plugin-qmlgl gst-plugin-va gst-plugin-wpe gst-plugins-ugly gstreamer-vaapi htop icoutils libfido2 libva-utils lrzip mac man-db man-pages meld mesa-utils nano-syntax-highlighting nss-mdns ntfs-3g p7zip pacman-contrib pbzip2 pigz powerline powerline-fonts qbittorrent realtime-privileges reflector rng-tools sox terminus-font ttf-ubuntu-font-family unrar unzip usb_modeswitch usbutils vdpauinfo vlc wget zip zsh zsh-autosuggestions zsh-completions zsh-syntax-highlighting ${nrg_plc}" ;; + deskpkgs="${basepkgs[*]} dconf-editor evince file-roller gdm gnome-calculator gnome-clocks gnome-console gnome-control-center gnome-disk-utility gnome-keyring gnome-menus gnome-session gnome-shell-extensions gnome-system-monitor gnome-text-editor gnome-tweaks gvfs gvfs-afc gvfs-mtp loupe nautilus power-profiles-daemon simple-scan sushi xdg-desktop-portal-gnome xdg-user-dirs-gtk alsa-firmware alsa-utils ccache exfatprogs fdkaac git glib2-devel glibc-locales gnome-browser-connector gparted gst-libav gst-plugin-libcamera gst-plugin-msdk gst-plugin-opencv gst-plugin-pipewire gst-plugin-qmlgl gst-plugin-va gst-plugin-wpe gst-plugins-ugly gstreamer-vaapi htop icoutils libfido2 libva-utils lrzip mac man-db man-pages meld mesa-utils nano-syntax-highlighting p7zip pacman-contrib powerline powerline-fonts qbittorrent realtime-privileges reflector rng-tools sox terminus-font ttf-ubuntu-font-family unrar unzip usb_modeswitch usbutils vdpauinfo vlc wget zip zsh zsh-autosuggestions zsh-completions zsh-syntax-highlighting ${nrg_plc}" + displaymanager="gdm" + bluetooth="bluetooth" + network="NetworkManager" + shell="zsh" + randomgen="rngd" + rtkit="rtkit-daemon" ;; 5) # Xfce Desktop: - deskpkgs="${basepkgs[*]} xfce4 gvfs lightdm-gtk-greeter network-manager-applet pavucontrol xfce4-screensaver" + deskpkgs="${basepkgs[*]} xfce4 gvfs lightdm-gtk-greeter network-manager-applet pavucontrol xdg-desktop-portal xfce4-screensaver" displaymanager="lightdm" - network="NetworkManager" ;; + network="NetworkManager" + shell="bash" + rtkit="rtkit-daemon" ;; 6) # Cinnamon Desktop: - deskpkgs="${basepkgs[*]} cinnamon blueberry gnome-keyring gvfs lightdm-slick-greeter ${terminal}" + deskpkgs="${basepkgs[*]} cinnamon blueberry gnome-keyring gvfs lightdm-slick-greeter xdg-desktop-portal ${terminal}" displaymanager="lightdm" bluetooth="bluetooth" - network="NetworkManager" ;; + network="NetworkManager" + shell="bash" + rtkit="rtkit-daemon" ;; 7) # Deepin Desktop: - deskpkgs="${basepkgs[*]} deepin deepin-kwin deepin-terminal" + deskpkgs="${basepkgs[*]} deepin deepin-kwin deepin-terminal xdg-desktop-portal" displaymanager="lightdm" - network="NetworkManager" ;; + network="NetworkManager" + shell="bash" + rtkit="rtkit-daemon" ;; 8) # Budgie Desktop: - deskpkgs="${basepkgs[*]} budgie lightdm-gtk-greeter arc-gtk-theme papirus-icon-theme nautilus network-manager-applet ${terminal}" + deskpkgs="${basepkgs[*]} budgie lightdm-gtk-greeter arc-gtk-theme papirus-icon-theme nautilus network-manager-applet xdg-desktop-portal ${terminal}" displaymanager="lightdm" - network="NetworkManager" ;; + network="NetworkManager" + shell="bash" + rtkit="rtkit-daemon" ;; 9) # Lxqt Desktop: - deskpkgs="${basepkgs[*]} lxqt breeze-icons gvfs network-manager-applet sddm xscreensaver" + deskpkgs="${basepkgs[*]} lxqt breeze-icons gvfs network-manager-applet sddm xdg-desktop-portal xscreensaver" displaymanager="sddm" - network="NetworkManager" ;; + network="NetworkManager" + shell="bash" + rtkit="rtkit-daemon" ;; 10) # Mate Desktop: - deskpkgs="${basepkgs[*]} mate mate-terminal mate-media blueman network-manager-applet mate-power-manager lightdm-gtk-greeter" + deskpkgs="${basepkgs[*]} mate mate-terminal mate-media blueman network-manager-applet mate-power-manager lightdm-gtk-greeter xdg-desktop-portal" displaymanager="lightdm" bluetooth="bluetooth" - network="NetworkManager" ;; + network="NetworkManager" + shell="bash" + rtkit="rtkit-daemon" ;; 11) # Base System: deskpkgs="${basepkgs[*]}" - network="NetworkManager" ;; + network="NetworkManager" + shell="bash" ;; 12) # Custom System: custarray=(base sudo "${custompkgs}" "${fstools}" "${kernel}" "${microcode}") @@ -5624,12 +5681,15 @@ ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}Pacs if [[ -n "${web_browser}" ]]; then custarray+=("${web_browser}") fi - deskpkgs="${custarray[*]}" ;; + deskpkgs="${custarray[*]}" + shell="bash" ;; 13) # Cosmic Desktop: - deskpkgs="${basepkgs[*]} cosmic cosmic-player" + deskpkgs="${basepkgs[*]} cosmic cosmic-player xdg-desktop-portal" displaymanager="cosmic-greeter" - network="NetworkManager" ;; + network="NetworkManager" + shell="bash" + rtkit="rtkit-daemon" ;; esac pkg_displ @@ -5743,7 +5803,8 @@ MKINITCPIO 127.0.1.1 ${HOSTNAME}.localdomain ${HOSTNAME} HOSTS echo root:${ROOTPASSWD2} | chpasswd || exit - useradd -m -G wheel -s /bin/bash ${USERNAME} || exit + chsh -s /bin/${shell} || exit + useradd -m -G wheel -s /bin/${shell} ${USERNAME} || exit echo ${USERNAME}:${USERPASSWD2} | chpasswd || exit echo "%wheel ALL=(ALL) ALL" | tee /etc/sudoers.d/sudoersd || exit visudo -c /etc/sudoers.d/sudoersd || exit @@ -5991,7 +6052,7 @@ NOUKI ################################################################################################### var_opts() { - if [[ "${setrescue}" == "y" ]]; then + if [[ ${sb_sign} == "y" && "${setrescue}" == "y" ]]; then local stage_prompt="Rescue Entry Creation" if [[ "${bootloader}" == "1" ]]; then if arch-chroot /mnt <<-RESCUE > /dev/null 2>&1 2> amelia_log.txt ; then @@ -6074,9 +6135,10 @@ SYSTEMD_OOMD fi if [[ "${printer}" == "y" ]]; then - local stage_prompt="Print Services Activation" + local stage_prompt="Print & Scan Services Activation" if arch-chroot /mnt <<-PRINT_CONF > /dev/null 2>&1 2> amelia_log.txt ; then - systemctl enable cups.socket cups-browsed ipp-usb || exit + systemctl enable avahi-daemon.socket cups.socket cups-browsed ipp-usb || exit + 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 PRINT_CONF stage_ok @@ -6084,6 +6146,45 @@ PRINT_CONF stage_fail fi fi + + if [[ -n "${randomgen}" ]]; then + local stage_prompt="Random Generator Service Activation" + if arch-chroot /mnt <<-RANDOMGEN > /dev/null 2>&1 2> amelia_log.txt ; then + systemctl enable rngd || exit +RANDOMGEN + stage_ok + else + stage_fail + fi + fi + + if [[ "${sysopt}" == "y" ]]; then + optimizations + if [[ -n "${rtkit}" ]]; then + local stage_prompt="Rtkit Service Activation" + if arch-chroot /mnt <<-REALTIME > /dev/null 2>&1 2> amelia_log.txt ; then + systemctl enable ${rtkit} || exit +REALTIME + stage_ok + else + stage_fail + fi + fi + if [[ "${hypervisor}" == "none" ]]; then + local stage_prompt="Wpa_Supplicant Configuration" + if arch-chroot /mnt <<-WPA > /dev/null 2>&1 2> amelia_log.txt ; then + cat <<-SUPPLICANT > /etc/wpa_supplicant/wpa_supplicant.conf || exit + country=${REGDOM} + wps_cred_add_sae=1 + pmf=2 +SUPPLICANT +WPA + stage_ok + else + stage_fail + fi + fi + fi } ################################################################################################### secboot_sign() { @@ -6269,6 +6370,134 @@ set_vars() { mkinitcpio_hooks="HOOKS=(${HOOKS[*]})" } ################################################################################################### +optimizations() { + + local stage_prompt="System Optimizations" + if arch-chroot /mnt <<-OPTIMIZE > /dev/null 2>&1 2> amelia_log.txt ; then + pacman -S --noconfirm ntfs-3g pbzip2 pigz || exit + sed -i 's/^#Color/Color\nILoveCandy/' /etc/pacman.conf || exit + update-pciids || exit + cat <<-MKINITCPIO >> /etc/mkinitcpio.conf.d/mkinitcpiod.conf || exit + COMPRESSION="zstd" + COMPRESSION_OPTIONS=(-c -T$(nproc) --auto-threads=logical -) + MODULES_DECOMPRESS="yes" +MKINITCPIO + mkinitcpio -P || exit + cat <<-MAKEPKG > /etc/makepkg.conf.d/makepkgd.conf || exit + #!/hint/bash + 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="-j$(nproc)" + 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 + cat <<-SYSCTL > /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 + vm.max_map_count = 1048576 + kernel.printk = 0 0 0 0 + ${perf_stream} +SYSCTL + cat <<-UDISKS2 > /etc/udisks2/mount_options.conf || exit + [defaults] + ntfs_drivers=ntfs,ntfs3 + ntfs:ntfs_defaults=uid=*,gid=*,iocharset=utf8,windows_names + ntfs:ntfs3_defaults=uid=*,gid=*,iocharset=utf8,windows_names + exfat_defaults=uid=*,gid=*,iocharset=utf8,errors=remount-ro +UDISKS2 + cat <<-POLKIT > /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 = { + // required for udisks1: + "org.freedesktop.udisks.filesystem-mount": YES, + "org.freedesktop.udisks.luks-unlock": YES, + "org.freedesktop.udisks.drive-eject": YES, + "org.freedesktop.udisks.drive-detach": YES, + // required for udisks2: + "org.freedesktop.udisks2.filesystem-mount": YES, + "org.freedesktop.udisks2.encrypted-unlock": YES, + "org.freedesktop.udisks2.eject-media": YES, + "org.freedesktop.udisks2.power-off-drive": YES, + // Dolphin specific: + "org.freedesktop.udisks2.filesystem-mount-system": YES, + // required for udisks2 if using udiskie from another seat (e.g. systemd): + "org.freedesktop.udisks2.filesystem-mount-other-seat": YES, + "org.freedesktop.udisks2.filesystem-unmount-others": YES, + "org.freedesktop.udisks2.encrypted-unlock-other-seat": YES, + "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]; + } + }); +POLKIT + mkdir -p /etc/systemd/journald.conf.d > /dev/null 2>&1 || exit + cat <<-JOURNAL > /etc/systemd/journald.conf.d/00-journald.conf || exit + [Journal] + SystemMaxUse=100M +JOURNAL + mkdir -p /etc/systemd/user.conf.d > /dev/null 2>&1 || exit + cat <<-TIMEOUT > /etc/systemd/user.conf.d/00-timeout.conf || exit + [Manager] + DefaultTimeoutStopSec=5s + DefaultTimeoutAbortSec=5s +TIMEOUT + sed -i "/# set linenumbers/"'s/^#//' /etc/nanorc || exit + sed -i "/# set minibar/"'s/^#//' /etc/nanorc || exit + sed -i "/# set mouse/"'s/^#//' /etc/nanorc || exit + echo " include /usr/share/nano/*.nanorc" | tee -a /etc/nanorc || exit + echo tcp_bbr | tee /etc/modules-load.d/modulesd.conf || exit + usermod -aG realtime ${USERNAME} + cat <<-SUDOERS > /etc/sudoers.d/sudoersd || exit + Defaults pwfeedback + Defaults editor=/usr/bin/nano + %wheel ALL=(ALL) ALL +SUDOERS + visudo -c /etc/sudoers.d/sudoersd || exit +OPTIMIZE + stage_ok + else + stage_fail + fi +} +################################################################################################### chroot_conf() { sleep 0.2 @@ -6277,7 +6506,7 @@ ${magenta}###${nc}--------------------------------${magenta}[ ${bwhite}Chroot & " # 'Vanilla' Setups Configuration: - if [[ "${packages}" =~ ^(1|3|5|6|7|8|9|10|11|13)$ ]]; then + if [[ "${packages}" != "12" ]]; then cnfg main_chroot @@ -6346,17 +6575,6 @@ NETWORK stage_fail fi fi - - btldrcfg - trimcfg - vm_serv - zramcfg - nvidia_hook - mkinitcpio_preset - var_opts - secboot_sign - completion - installation="ok" fi #-------------------------------------------------------------------------------------------------- # 'Custom System' Configuration: @@ -6405,7 +6623,7 @@ CUSTOMSERV stage_fail fi fi - + fi btldrcfg trimcfg vm_serv @@ -6416,176 +6634,6 @@ CUSTOMSERV secboot_sign completion installation="ok" - fi -#-------------------------------------------------------------------------------------------------- - # Minimal Plasma/Gnome Optimized-System Configuration: - if [[ "${packages}" == "2" || "${packages}" == "4" ]]; then - local stage_prompt="Optimized System Configuration" - cnfg - - if [[ "${packages}" == "2" ]]; then - displaymanager="sddm" - elif [[ "${packages}" == "4" ]]; then - displaymanager="gdm" - fi - - if arch-chroot /mnt <<-OPTIMIZED > /dev/null 2>&1 2> amelia_log.txt ; then - sed -i "/^#${SETLOCALE}/s/^#//" /etc/locale.gen || exit - locale-gen || exit - echo LANG=${SETLOCALE} > /etc/locale.conf || exit - export LANG=${SETLOCALE} || exit - echo KEYMAP=${SETKBD} > /etc/vconsole.conf || exit - sed -i 's/^#Color/Color\nILoveCandy/' /etc/pacman.conf || exit - update-pciids || exit - cat <<-MKINITCPIO > /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 - mkinitcpio -P || exit - cat <<-MAKEPKG > /etc/makepkg.conf.d/makepkgd.conf || exit - #!/hint/bash - 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="-j$(nproc)" - 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 - 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} -HOSTS - cat <<-SYSCTL > /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 - vm.max_map_count = 1048576 - kernel.printk = 0 0 0 0 - ${perf_stream} -SYSCTL - cat <<-UDISKS2 > /etc/udisks2/mount_options.conf || exit - [defaults] - ntfs_drivers=ntfs,ntfs3 - ntfs:ntfs_defaults=uid=*,gid=*,iocharset=utf8,windows_names - ntfs:ntfs3_defaults=uid=*,gid=*,iocharset=utf8,windows_names - exfat_defaults=uid=*,gid=*,iocharset=utf8,errors=remount-ro -UDISKS2 - cat <<-POLKIT > /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 = { - // required for udisks1: - "org.freedesktop.udisks.filesystem-mount": YES, - "org.freedesktop.udisks.luks-unlock": YES, - "org.freedesktop.udisks.drive-eject": YES, - "org.freedesktop.udisks.drive-detach": YES, - // required for udisks2: - "org.freedesktop.udisks2.filesystem-mount": YES, - "org.freedesktop.udisks2.encrypted-unlock": YES, - "org.freedesktop.udisks2.eject-media": YES, - "org.freedesktop.udisks2.power-off-drive": YES, - // Dolphin specific: - "org.freedesktop.udisks2.filesystem-mount-system": YES, - // required for udisks2 if using udiskie from another seat (e.g. systemd): - "org.freedesktop.udisks2.filesystem-mount-other-seat": YES, - "org.freedesktop.udisks2.filesystem-unmount-others": YES, - "org.freedesktop.udisks2.encrypted-unlock-other-seat": YES, - "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]; - } - }); -POLKIT - mkdir -p /etc/systemd/journald.conf.d > /dev/null 2>&1 || exit - cat <<-JOURNAL > /etc/systemd/journald.conf.d/00-journald.conf || exit - [Journal] - SystemMaxUse=100M -JOURNAL - mkdir -p /etc/systemd/user.conf.d > /dev/null 2>&1 || exit - cat <<-TIMEOUT > /etc/systemd/user.conf.d/00-timeout.conf || exit - [Manager] - DefaultTimeoutStopSec=5s - DefaultTimeoutAbortSec=5s -TIMEOUT - sed -i 's|^hosts.*|hosts: mymachines mdns_minimal resolve [!UNAVAIL=return] files myhostname dns|g' /etc/nsswitch.conf || exit - sed -i "/# set linenumbers/"'s/^#//' /etc/nanorc || exit - sed -i "/# set minibar/"'s/^#//' /etc/nanorc || exit - sed -i "/# set mouse/"'s/^#//' /etc/nanorc || exit - echo " include /usr/share/nano/*.nanorc" | tee -a /etc/nanorc || exit - echo tcp_bbr | tee /etc/modules-load.d/modulesd.conf || exit - cat <<-SUPPLICANT > /etc/wpa_supplicant/wpa_supplicant.conf || exit - country=${REGDOM} - wps_cred_add_sae=1 - pmf=2 -SUPPLICANT - 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 > /etc/sudoers.d/sudoersd || exit - Defaults pwfeedback - Defaults editor=/usr/bin/nano - %wheel ALL=(ALL) ALL -SUDOERS - visudo -c /etc/sudoers.d/sudoersd || exit - systemctl enable avahi-daemon bluetooth NetworkManager rngd rtkit-daemon ${displaymanager} ${trim} ${vm_services} || exit -OPTIMIZED - stage_ok - else - stage_fail - fi - - btldrcfg - zramcfg - nvidia_hook - mkinitcpio_preset - var_opts - secboot_sign - completion - installation="ok" - fi umount -R /mnt reboot exit @@ -6597,7 +6645,7 @@ OPTIMIZED tty="$(tty)" disks="$(lsblk --nodeps --paths --noheadings --output=name,size,model | cat --number)" trg="" - vars=(LOCALESET="" SETLOCALE="" lcl_slct="" USERNAME="" kernelnmbr="" fs="" gfxcount="" gfxcard="" intelcount="" intelcards="" nvidiacount="" nvidiacards="" amdcount="" amdcards="" gfxconf="" gfx_conf="" gfx_setup="" vendor="" vendor1="" vendor2="" vendor3="" vendor_slct="" packages="" efi_entr_del="" wrlss_rgd="" sanity="" install="" bootldr_pkgs="" devel="" REGDOM="" gfx_bootopts="" btrfs_bootopts="" trim="" swapmode="" homecrypt="" greeter="" revision="" greeternmbr="" cust_bootopts="" bluetooth="" vmpkgs="" vm_services="" perf_stream="" displaymanager="" wireless_reg="" bitness="" bootloader="" gfx_slct="" espsize="" autoroot="" autoesp="" autoxboot="" autohome="" autoswap="" rootprt="" espprt="" xbootprt="" homeprt="" swapprt="" partok="" use_manpreset="" instl_drive="" sgdsk_nmbr="" part_mode="" preset="" capacity="" cap_gib="" rootsize="" sgdrive="" cgdrive="" smartpart="" presetpart="" prcnt="" roottype="" stage_prompt="" zram="" zram_bootopts="" xbootloader="" multibooting="" hypervisor="" mkinitcpio_mods="" uki="" ukify="" slct_autoprt="" cng_espmnt="" sep_home="" encr_swap_bootopts="" uefimode="" luks_encrypt="" nrg_plc="" multilib="" nvname="" nogsp="" luks_root="" luks_swap="" luks_home="" installation="" kill_watchdog="" oomd="" setrescue="" lowlat="" vendors="" printer="" print_pkgs="" web="" web_browser="") + vars=(LOCALESET="" SETLOCALE="" lcl_slct="" USERNAME="" kernelnmbr="" fs="" gfxcount="" gfxcard="" intelcount="" intelcards="" nvidiacount="" nvidiacards="" amdcount="" amdcards="" gfxconf="" gfx_conf="" gfx_setup="" vendor="" vendor1="" vendor2="" vendor3="" vendor_slct="" packages="" efi_entr_del="" wrlss_rgd="" sanity="" install="" bootldr_pkgs="" devel="" REGDOM="" gfx_bootopts="" btrfs_bootopts="" trim="" swapmode="" homecrypt="" greeter="" revision="" greeternmbr="" cust_bootopts="" bluetooth="" vmpkgs="" vm_services="" perf_stream="" displaymanager="" wireless_reg="" bitness="" bootloader="" gfx_slct="" espsize="" autoroot="" autoesp="" autoxboot="" autohome="" autoswap="" rootprt="" espprt="" xbootprt="" homeprt="" swapprt="" partok="" use_manpreset="" instl_drive="" sgdsk_nmbr="" part_mode="" preset="" capacity="" cap_gib="" rootsize="" sgdrive="" cgdrive="" smartpart="" presetpart="" prcnt="" roottype="" stage_prompt="" zram="" zram_bootopts="" xbootloader="" multibooting="" hypervisor="" mkinitcpio_mods="" uki="" ukify="" slct_autoprt="" cng_espmnt="" sep_home="" encr_swap_bootopts="" uefimode="" luks_encrypt="" nrg_plc="" multilib="" nvname="" nogsp="" luks_root="" luks_swap="" luks_home="" installation="" kill_watchdog="" oomd="" setrescue="" lowlat="" vendors="" printer="" print_pkgs="" web="" web_browser="" shell="" randomgen="" rtkit="" sysopt="") export "${vars[@]}" clear first_check @@ -6624,5 +6672,5 @@ OPTIMIZED uefi_check connection_check upd_clock - until machine_dtct; do : ; done + machine_dtct until main_menu; do : ; done