diff --git a/Amelia.sh b/Amelia.sh index 06259dc..0fb8332 100644 --- a/Amelia.sh +++ b/Amelia.sh @@ -1,7 +1,7 @@ #!/bin/bash # Amelia Installer -# Version: 4.5 +# Version: 4.6 set -euo pipefail trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR @@ -205,8 +205,9 @@ stage_ok (){ sleep 0.5 NC " -==> [${green}${stage_prompt} configuration OK${nc}] " - sleep 3 +==> [${green}${stage_prompt} configuration OK${nc}] + " + sleep 1 } #---------------------------------------------------------- stage_fail (){ @@ -214,7 +215,7 @@ stage_fail (){ RED " [!] ${stage_prompt} configuration failed " - sleep 4 + sleep 2 abort } #---------------------------------------------------------- @@ -498,7 +499,7 @@ ${purple}###${nc} Locale Selection ${purple}###${nc} > Select your Locale (e.g. ${nc}en_US.UTF-8${yellow}) - ### [Hit ${nc}'l'${yellow} to list locales, then ${nc}'down'${yellow} to search or ${nc}'q'${yellow} to quit] " + ### [Hit ${nc}'l'${yellow} to list locales, then ${nc}'enter'${yellow} to search or ${nc}'q'${yellow} to quit] " BLUE " @@ -546,7 +547,7 @@ ${purple}###${nc} Keyboard Layout Selection ${purple}###${nc} > Select your Keyboard Layout - ### [Hit ${nc}'l'${yellow} to list layouts, then ${nc}'down'${yellow} to search or ${nc}'q'${yellow} to quit] " + ### [Hit ${nc}'l'${yellow} to list layouts, then ${nc}'enter'${yellow} to search or ${nc}'q'${yellow} to quit] " BLUE " @@ -808,19 +809,19 @@ Enter a number: " case "${kernelnmbr}" in 1) kernel="linux" - kernelname="'Linux'" + kernelname="Linux" entrname="Arch Linux" ;; 2) kernel="linux-lts" - kernelname="'Linux LTS'" + kernelname="Linux LTS" entrname="Arch Linux LTS" ;; 3) kernel="linux-hardened" - kernelname="'Linux Hardened'" + kernelname="Linux Hardened" entrname="Arch Linux Hardened" ;; 4) kernel="linux-zen" - kernelname="'Linux Zen'" + kernelname="Linux Zen" entrname="Arch Linux Zen" ;; "") sleep 0.5 @@ -877,13 +878,13 @@ Enter a number: " sleep 0.5 YELLOW " - ### 'Systemd-boot' has been selected + ### Systemd-boot has been selected " ;; 2) sleep 0.5 YELLOW " - ### 'Grub' has been selected + ### Grub has been selected " ;; "") sleep 0.5 @@ -1091,50 +1092,49 @@ ${purple}###${nc} Graphics Setup ${purple}###${nc} nvidiacards="$(lspci | grep -E 'VGA|Display|3D' | grep -E 'NVIDIA Corporation'| sed 's/.*Corporation //g' | cat --number | sed 's/.[0-9]//')" hypervisor="$(systemd-detect-virt)" - if [[ "${vgacount}" == "1" ]]; then - - if [[ "${intelcount}" -ge "1" ]]; then - vendor="Intel" - sourcetype="Open-source" - perf_stream="dev.i915.perf_stream_paranoid = 0" - vgapkgs="intel-media-driver intel-media-sdk libva-intel-driver vpl-gpu-rt vulkan-intel vulkan-mesa-layers" - elif [[ "${amdcount}" -ge "1" ]]; then - vendor="AMD" - sourcetype="Open-source" - vgapkgs="libva-mesa-driver mesa-vdpau vulkan-mesa-layers vulkan-radeon" - elif [[ "${nvidiacount}" -ge "1" ]]; then - vendor="Nvidia" - sourcetype="Proprietary" - elif [[ "${hypervisor}" != "none" ]]; then - vendor="Virtual Machine" - case "${hypervisor}" in - kvm) - vmpkgs="spice spice-vdagent spice-protocol spice-gtk qemu-guest-agent" - vm_services="qemu-guest-agent" ;; - vmware) - vmpkgs="open-vm-tools" - vm_services="vmtoolsd vmware-vmblock-fuse" ;; - oracle) - vmpkgs="virtualbox-guest-utils" - vm_services="vboxservice" ;; - microsoft) - vmpkgs="hyperv" - vm_services="hv_fcopy_daemon hv_kvp_daemon hv_vss_daemon" ;; - esac - fi + if [[ "${vgacount}" == "1" ]]; then + if [[ "${intelcount}" -ge "1" ]]; then + vendor="Intel" + sourcetype="Open-source" + perf_stream="dev.i915.perf_stream_paranoid = 0" + vgapkgs="intel-media-driver intel-media-sdk libva-intel-driver vpl-gpu-rt vulkan-intel vulkan-mesa-layers" + elif [[ "${amdcount}" -ge "1" ]]; then + vendor="AMD" + sourcetype="Open-source" + vgapkgs="libva-mesa-driver mesa-vdpau vulkan-mesa-layers vulkan-radeon" + elif [[ "${nvidiacount}" -ge "1" ]]; then + vendor="Nvidia" + sourcetype="Proprietary" + elif [[ "${hypervisor}" != "none" ]]; then + vendor="Virtual Machine" + case "${hypervisor}" in + kvm) + vmpkgs="spice spice-vdagent spice-protocol spice-gtk qemu-guest-agent" + vm_services="qemu-guest-agent" ;; + vmware) + vmpkgs="open-vm-tools" + vm_services="vmtoolsd vmware-vmblock-fuse" ;; + oracle) + vmpkgs="virtualbox-guest-utils" + vm_services="vboxservice" ;; + microsoft) + vmpkgs="hyperv" + vm_services="hv_fcopy_daemon hv_kvp_daemon hv_vss_daemon" ;; + esac + fi sleep 0.5 YELLOW " ### ${vendor} Graphics detected : ${nc}${vgacard}" - if [[ "${vendor}" == "Virtual Machine" ]]; then - vgaconf="n" - echo - skip - ok - return 0 - fi + if [[ "${vendor}" == "Virtual Machine" ]]; then + vgaconf="n" + echo + skip + ok + return 0 + fi YELLOW " ### ${sourcetype} drivers will be used @@ -1147,7 +1147,7 @@ ${purple}###${nc} Graphics Setup ${purple}###${nc} [!] Supported architectures: NV110 (Maxwell) Graphics or newer " fi -BLUE " + BLUE " Enter [y/n]: " @@ -1155,7 +1155,6 @@ Enter [y/n]: " ==> " vgaconf if [[ "${vgaconf}" == "y" ]]; then - if [[ "${vendor}" == "AMD" ]]; then sleep 0.5 YELLOW " @@ -1193,7 +1192,6 @@ Enter a number ${bwhite}(empty to skip)${blue}: " fi elif [[ "${vendor}" == "Nvidia" ]]; then - sleep 0.5 YELLOW " > Select Nvidia architecture: " @@ -1252,11 +1250,9 @@ Enter a number: " fi if [[ "${kernelnmbr}" == "1" ]]; then - if [[ "${family}" == "1" ]]; then vgapkgs="libva-nvidia-driver libvdpau-va-gl nvidia nvidia-settings nvidia-utils opencl-nvidia" 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" @@ -1266,13 +1262,10 @@ Enter a number: " 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" 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" @@ -1281,12 +1274,9 @@ Enter a number: " nvname="nvidia-lts" fi fi - else - if [[ "${family}" == "1" ]]; then 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" @@ -1299,7 +1289,7 @@ Enter a number: " sleep 0.5 YELLOW " - ### ""${vendor}"" Graphics will be automatically configured + ### ${vendor} Graphics will be automatically configured " elif [[ "${vgaconf}" == "n" ]]; then vgapkgs="" @@ -1310,11 +1300,11 @@ Enter a number: " return 1 fi else - if [[ "${vgacount}" == "2" ]]; then - vendor="Dual" - elif [[ "${vgacount}" == "3" ]]; then - vendor="Triple" - fi + if [[ "${vgacount}" == "2" ]]; then + vendor="Dual" + elif [[ "${vgacount}" == "3" ]]; then + vendor="Triple" + fi sleep 0.5 YELLOW " @@ -1354,6 +1344,11 @@ ${nvidiacards} > Please configure the graphics subsystem after installation has finished " + vgaconf="n" + echo + skip + ok + return 0 fi ok } @@ -1405,17 +1400,17 @@ Enter a number: " case "${packages}" in 1) - desktopname="'Plasma'" ;; + desktopname="Plasma" ;; 2) - desktopname="'Custom Plasma (System Optimized)'" ;; + desktopname="Custom Plasma (System Optimized)" ;; 3) - desktopname="'Gnome'" ;; + desktopname="Gnome" ;; 4) - desktopname="'Custom Gnome (System Optimized)'" ;; + desktopname="Custom Gnome (System Optimized)" ;; 5) - desktopname="'Xfce'" ;; + desktopname="Xfce" ;; 6) - desktopname="'Cinnamon'" + desktopname="Cinnamon" sleep 0.5 YELLOW " @@ -1456,9 +1451,9 @@ Enter [y/n]: " esac ;; 7) - desktopname="'Deepin'" ;; + desktopname="Deepin" ;; 8) - desktopname="'Budgie'" + desktopname="Budgie" sleep 0.5 YELLOW " @@ -1499,13 +1494,13 @@ Enter [y/n]: " esac ;; 9) - desktopname="'Lxqt'" ;; + desktopname="Lxqt" ;; 10) - desktopname="'Mate'" ;; + desktopname="Mate" ;; 11) - desktopname="'Basic Arch Linux'" ;; + desktopname="Basic Arch Linux" ;; 12) - desktopname="'Custom Arch Linux'" + desktopname="Custom Arch Linux" until cust_sys; do :; done return 0 ;; "") @@ -1653,7 +1648,6 @@ Enter a number: " ==> " greeternmbr case "${greeternmbr}" in - 1) greeter="lightdm-gtk-greeter" sleep 0.5 @@ -1743,12 +1737,25 @@ boot_entr (){ local prompt="Boot Entries" efi_entr_del="1" + hypervisor="$(systemd-detect-virt)" sleep 0.5 NC " _________________________________ ${purple}###${nc} EFI Boot Entries Deletion ${purple}###${nc} " + if [[ "${hypervisor}" != "none" ]]; then + sleep 0.5 + YELLOW " + + ### Virtual Machine detected + " + skip + ok + echo + return 0 + fi + YELLOW " > Select an EFI Boot Entry to Delete ${red}[!] (CAUTION) [!]${yellow} @@ -1804,18 +1811,18 @@ ________________________________________ ${purple}###${nc} Wireless Regulatory Domain Setup ${purple}###${nc} " - if [[ "${hypervisor}" != "none" ]]; then + if [[ "${hypervisor}" != "none" ]]; then sleep 0.5 YELLOW " ### Virtual Machine detected " - skip - ok - echo - return 0 - fi - + skip + ok + echo + return 0 + fi + BLUE " Enter your Country Code, ie:${nc} ${cyan}US ${bwhite}(empty to skip)${blue}: " @@ -2517,7 +2524,6 @@ instl (){ if [[ -n "${REGDOM}" ]]; then until wireless_regdom; do : ; done fi - chroot_conf fi } @@ -3326,9 +3332,7 @@ ${purple}###${nc} Confirm Installation Status ${purple}###${nc} if [[ -n "${REGDOM}" ]]; then until wireless_regdom; do : ; done fi - chroot_conf - elif [[ "${agree}" == "no" ]]; then reload sleep 0.5 @@ -3348,9 +3352,7 @@ ${purple}###${nc} Unmount Filesystems ${purple}###${nc} [!] Unmounting failed " abort fi - revise - else sleep 0.5 RED " @@ -3657,7 +3659,7 @@ ${purple}###${nc} Optimize PacMan ${purple}###${nc} > Select a Country for your Arch Mirrors: - ### [Hit ${nc}'l'${yellow} to list Countries, then ${nc}'down'${yellow} to search or ${nc}'q'${yellow} to quit] " + ### [Hit ${nc}'l'${yellow} to list Countries, then ${nc}'enter'${yellow} to search or ${nc}'q'${yellow} to quit] " BLUE " @@ -3739,14 +3741,12 @@ Enter a number: " elif [[ "${parallel}" == "n" ]]; then skip - elif [[ -z "${parallel}" ]]; then sleep 0.5 RED " [!] Please make a selection to continue " reload return 1 - else invalid return 1 @@ -3888,10 +3888,10 @@ ${purple}###${nc} Swapfile Activation ${purple}###${nc} if arch-chroot /mnt <<-SWAP ; then mkswap -U clear --size ${swapsize}G --file /swapfile SWAP - if cat >> /mnt/etc/fstab <<-FSTAB ; then - /swapfile none swap defaults 0 0 + if cat >> /mnt/etc/fstab <<-FSTAB ; then + /swapfile none swap defaults 0 0 FSTAB - ok + ok else sleep 0.5 RED " @@ -3915,16 +3915,16 @@ ${purple}###${nc} Btrfs Swapfile Activation ${purple}###${nc} if arch-chroot /mnt <<-SWAP ; then btrfs filesystem mkswapfile --size ${swapsize}g --uuid clear /swap/swapfile SWAP - if cat >> /mnt/etc/fstab <<-FSTAB ; then - /swap/swapfile none swap defaults 0 0 + if cat >> /mnt/etc/fstab <<-FSTAB ; then + /swap/swapfile none swap defaults 0 0 FSTAB - ok - else - sleep 0.5 - RED " + ok + else + sleep 0.5 + RED " [!] Populating the 'fstab' file has failed " - abort - fi + abort + fi else err_swapfile fi @@ -3962,11 +3962,10 @@ ${purple}###${nc} Chroot & Configure System ${purple}###${nc} [[ "${kernelnmbr}" == "3" ]] && swapmode="3" if [[ "${encrypt}" == "yes" ]]; then - encr_root_dev="/dev/mapper/${ENCROOT}" encr_root_opts="rd.luks.name=$(blkid -s UUID -o value "${root_dev}")=${ENCROOT}" encr_root_bootopts="root=${encr_root_dev} ${encr_root_opts}" - + if [[ "${swapmode}" == "1" ]]; then encr_swap_opts="rd.luks.name=$(blkid -s UUID -o value "${swap_dev}")=swap" encr_swap_bootopts="resume=/dev/mapper/swap ${encr_swap_opts}" @@ -4000,10 +3999,8 @@ ${purple}###${nc} Chroot & Configure System ${purple}###${nc} vga_bootopts="amdgpu.dc=1" fi fi - elif [[ "${vgaconf}" == "n" ]]; then mkinitcpio_hooks="HOOKS=(systemd keyboard autodetect microcode modconf kms keymap consolefont block sd-encrypt filesystems fsck)" - if [[ "${vendor}" == "Nvidia" ]]; then mkinitcpio_mods="MODULES=(${fs_mod} nouveau)" else