"EFI Boot Entries Deletion" stage is now ommited if a VM is detected.

If Dual/Triple graphics setup is detected, graphics configuration defaults to 'no'.
Minor aesthetic corrections.
This commit is contained in:
Jane Doe 2024-05-18 20:30:02 +00:00
parent 4446db1023
commit 4e37543116

213
Amelia.sh
View file

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