Add: A package validation check (Arch repos & AUR) has been implemented, to ensure that the packages to be installed are valid (exist) before installation starts.

If not, the installer exits and logs the error.
Add: 'Intel Graphics' > A new package has been added.
This commit is contained in:
Jane Doe
2025-11-25 00:10:40 +02:00
parent e9512cbf3c
commit 058b85253e
+56 -20
View File
@@ -2,7 +2,7 @@
# Amelia Installer
# Source: https://gitlab.com/prism7/archery
# Version: 1.0.14
# Version: 1.1.0
set -euo pipefail
###################################################################################################
@@ -61,14 +61,6 @@ alternatives() {
--> [${green}Providing alternatives..${nc}] "
}
pkg_displ() {
sleep 0.2
YELLOWL "
Packages to be installed${nc}:
${deskpkgs}"
}
deskname() {
sleep 0.2
YELLOW "
@@ -222,10 +214,10 @@ stage_fail() {
sleep 0.2
RED "
>> ${bwhite}${stage_prompt} ${nc}${red}FAILED${cyan}
>> ${bwhite}${stage_prompt} ${nc}${red}FAILED${cyan}
>> ${nc}Check ${yellowl}Amelia.log ${nc}for errors
>> ${nc}Check ${yellowl}Amelia.log ${nc}for errors
"
failure
@@ -289,7 +281,7 @@ keypress() {
NC "
${bwhite}Press any key to continue${nc}
${bwhite}Press any key to continue${nc}
"
@@ -1198,6 +1190,7 @@ Enter [y/N]: "
if [[ "${sb_sign}" == "y" ]]; then
local prompt="Secure Boot 'Setup' Mode Verification"
validpkgs+=(sbctl)
SB_Status="$(bootctl status 2> "${void}" | grep -E 'Secure Boot' | awk "{print \$4}")"
if [[ "${SB_Status}" == "(setup)" ]]; then
ok
@@ -1978,7 +1971,7 @@ gfxpkgs_set() {
if [[ "${vendor}" == "Intel" || "${vendors}" =~ "Intel" ]]; then
# /etc/sysctl.d/99-sysctld.conf
perf_stream="dev.i915.perf_stream_paranoid = 0"
gfxpkgs+=(intel-compute-runtime intel-media-driver intel-media-sdk libva-intel-driver libva-utils libvpl opencl-headers vpl-gpu-rt vkd3d vulkan-intel vulkan-mesa-layers)
gfxpkgs+=(igsc intel-compute-runtime intel-media-driver intel-media-sdk libva-intel-driver libva-utils libvpl opencl-headers vpl-gpu-rt vkd3d vulkan-intel vulkan-mesa-layers)
fi
# AMD Graphics
@@ -2352,6 +2345,7 @@ Enter [y/N]: "
case "${dev}" in
y)
devel="base-devel"
validpkgs+=(base-devel)
YELLOW "
### The 'base-devel' meta-package will be installed
@@ -2473,7 +2467,8 @@ Enter a number ${bwhite}(empty to skip)${blue}: "
keypress
fi
if [[ "${web}" =~ ^(1|2|3|4|5|6|7|8)$ ]]; then
[[ "${web}" =~ ^(4|5|6|7|8|9)$ ]] && validpkgs+=("base-devel" "git")
if [[ "${web}" =~ ^(1|2|3|4|5|6|7|8|9)$ ]]; then
local prompt="${web_name}"
web_slct="yes"
ok
@@ -2882,6 +2877,7 @@ Enter [v/y/N]: "
case "${genoptm}" in
y)
validpkgs+=("ccache" "ntfs-3g" "pbzip2" "pigz")
YELLOW "
### System Optimizations will be set
@@ -3037,6 +3033,7 @@ Enter [y/N]: "
irqbalance="${irqbalance,,}"
if [[ "${irqbalance}" == "y" ]]; then
validpkgs+=(irqbalance)
YELLOW "
### 'irqbalance' service will be enabled
@@ -3082,6 +3079,7 @@ Enter [y/N]: "
thermald="${thermald,,}"
if [[ "${thermald}" == "y" ]]; then
validpkgs+=(thermald)
YELLOW "
### 'thermald' service will be enabled
@@ -3127,6 +3125,7 @@ Enter [y/N]: "
rngd="${rngd,,}"
if [[ "${rngd}" == "y" ]]; then
validpkgs+=(rng-tools)
YELLOW "
### 'rngd' service will be enabled
@@ -3172,6 +3171,7 @@ Enter [y/N]: "
rtkit="${rtkit,,}"
if [[ "${rtkit}" == "y" ]]; then
validpkgs+=("realtime-privileges" "rtkit")
YELLOW "
### 'rtkit' service will be enabled
@@ -3217,6 +3217,7 @@ Enter [y/N]: "
tlp="${tlp,,}"
if [[ "${tlp}" == "y" ]]; then
validpkgs+=(tlp)
YELLOW "
### 'tlp' service will be enabled
@@ -6208,6 +6209,39 @@ Enter [y/N]: "
ok
}
###################################################################################################
pkg_validation() {
local prompt="Arch Packages Validation"
local stage_prompt="Arch Packages Validation"
sleep 0.2
YELLOWL "
-------------------------------------------
### ${bwhite}Validating installation packages: ${yellowl}###
-------------------------------------------
"
validpkgs+=("${deskpkgs}")
echo "${validpkgs[*]} ${web_aur}"
valids="${validpkgs[*]}"
line2
if pacman -Syy > "${void}" 2>&1 2> "${log}" && pacman -Spd ${valids} > "${void}" 2>&1 2> "${log}"; then
ok
if [[ -n "${web_aur}" ]]; then
local prompt="AUR Package Validation"
local stage_prompt="AUR Package Validation"
if pacman -S git --noconfirm > "${void}" 2>&1 2> "${log}" && git clone --branch "${web_aur}" --single-branch https://github.com/archlinux/aur.git "${web_aur}" > "${void}" 2>&1 2> "${log}" && rm -R "${web_aur}"; then
ok
else
stage_fail
fi
fi
else
stage_fail
fi
keypress
}
###################################################################################################
pacstrap_system() {
sleep 0.2
@@ -6224,10 +6258,11 @@ ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}Pacs
[[ "${fs}" == "2" ]] && bootldr_pkgs="grub-btrfs inotify-tools os-prober"
fi
basepkgs=(base efibootmgr nano networkmanager pkgstats sudo vim "${bootldr_pkgs}" "${fstools}" "${kernel}" "${microcode}" "${shell_pkgs}")
basepkgs=(base efibootmgr nano networkmanager pkgstats sudo vim "${fstools}" "${kernel}" "${microcode}" "${shell_pkgs}")
[[ -n "${shell}" ]] && basepkgs+=("${shell}")
[[ -n "${nrg_plc}" ]] && basepkgs+=("${nrg_plc}")
[[ -n "${bootldr_pkgs}" ]] && basepkgs+=("${bootldr_pkgs}")
[[ -n "${ukify}" ]] && basepkgs+=("${ukify}")
[[ -n "${zram}" ]] && basepkgs+=("${zram}")
[[ -n "${gfxpkgs[*]}" ]] && basepkgs+=("${gfxpkgs[*]}")
@@ -6287,9 +6322,10 @@ ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}Pacs
deskpkgs="${basepkgs[*]}" ;;
12) # Custom System:
custarray=(base sudo "${bootldr_pkgs}" "${custompkgs}" "${fstools}" "${kernel}" "${microcode}")
custarray=(base sudo "${custompkgs}" "${fstools}" "${kernel}" "${microcode}")
[[ -n "${shell}" ]] && custarray+=("${shell}")
[[ -n "${bootldr_pkgs}" ]] && custarray+=("${bootldr_pkgs}")
[[ -n "${ukify}" ]] && custarray+=("${ukify}")
[[ -n "${zram}" ]] && custarray+=("${zram}")
[[ -n "${gfxpkgs[*]}" ]] && custarray+=("${gfxpkgs[*]}")
@@ -6307,15 +6343,14 @@ ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}Pacs
displaymanager="cosmic-greeter" ;;
esac
pkg_displ
echo
keypress
pkg_validation
if pacstrap -K /mnt ${deskpkgs} 2> "${log}" ; then
local prompt="Pacstrap System"
local stage_prompt="Pacstrap System"
ok
else
failure
stage_fail
fi
if [[ "${fs}" == "2" ]]; then
@@ -7467,6 +7502,7 @@ CUSTOM_SRVC
trg=""
vars=(LOCALESET="" SETLOCALE="" lcl_slct="" USERNAME="" kernelnmbr="" fs="" gfxcount="" gfxcard="" intelcount="" intelcards="" nvidiacount="" nvidiacards="" amdcount="" amdcards="" vendor="" vendors="" desktop="" terminal="" efi_entr_del="" sanity="" install="" bootldr_pkgs="" devel="" REGDOM="" gfx_bootopts="" btrfs_bootopts="" trim="" swapmode="" greeter="" greeternmbr="" cust_bootopts="" vmpkgs="" vm_services="" perf_stream="" displaymanager="" wireless_reg="" bitness="" bootloader="" gfx_slct="" espsize="" autoroot="" autoesp="" autoxboot="" autohome="" autoswap="" rootprt="" espprt="" xbootprt="" homeprt="" swapprt="" partok="" instl_drive="" sgdsk_nmbr="" part_mode="" preset="" capacity="" cap_gib="" rootsize="" sgdrive="" cgdrive="" smartpart="" presetpart="" prcnt="" roottype="" stage_prompt="" zram="" xbootloader="" multibooting="" hypervisor="" mkinitcpio_mods="" mkinitcpio_bins="" uki="" ukify="" cng_espmnt="" sep_home="" encr_swap_bootopts="" encr_home_bootopts="" uefimode="" luks_encrypt="" nrg_plc="" multilib="" nvname="" nogsp="" luks_root="" luks_swap="" luks_home="" installation="" kill_watchdog="" oomd="" setrescue="" lowlat="" dev="" web="" web_pkg="" web_aur="" web_slct="" printer="" print_pkgs="" shellnmbr="" shell="" shellname="" shellname2="" shell_pkgs="" genoptm="" set_optm="" ask_param="" desk_setup="" irqbalance="" thermald="" rngd="" rtkit="" tlp="" CRYPTPASS="" CRYPTPASS2="" askoptm="" gptslct="" gptok="" gptabort="" nvdprop="" nowarning="" efiname="" path="" hometype="" homeform="" LuksParts="")
export "${vars[@]}"
validpkgs=()
sleep 0.2
CYANBG "************************************************************************************************* "
CYANBG " "