Change: 'Microcode Detection' stage has been renamed to 'Machine Detection' stage,

where now the installer shows the pc-system vendor, model, platform {desktop/laptop/vm} and cpu microcode to be installed
Add: Ext4 filesystem speedup by setting the 'fast_commit' option as default
This commit is contained in:
Jane Doe 2024-11-02 11:38:34 +00:00
parent adb0181715
commit 5c3e60e184

View file

@ -2,7 +2,7 @@
# Amelia Installer
# https://gitlab.com/prism7/archery
# Version: 8.0.6
# Version: 8.0.7
set -euo pipefail
###################################################################################################
@ -429,29 +429,49 @@ ${magenta}###${nc}-----------------------------------${magenta}[ ${bwhite}System
ok
}
###################################################################################################
dtct_microcode() {
machine_dtct() {
local prompt="Microcode"
local prompt="Machine Detection"
sleep 0.2
NC "
${magenta}###${nc}-----------------------------------${magenta}[ ${bwhite}Microcode Detection${nc} ${magenta}]${nc}-----------------------------------${magenta}###
${magenta}###${nc}------------------------------------${magenta}[ ${bwhite}Machine Detection${nc} ${magenta}]${nc}------------------------------------${magenta}###
"
CPU="$(grep -E 'vendor_id' /proc/cpuinfo)"
hardw_model="$(hostnamectl | grep -E 'Hardware Model:'|sed 's| Hardware Model: ||')"
hardw_model_vend="$(hostnamectl | grep -E 'Hardware Model:'|sed 's| Hardware Model: ||' | awk "{print \$1}")"
hardw_vendor="$(hostnamectl | grep -E 'Hardware Vendor' | awk "{print \$3}")"
machine="$(hostnamectl | grep -E 'Chassis' | awk "{print \$2}")"
if [[ "${CPU}" == *"GenuineIntel"* ]]; then
microcode="intel-ucode"
nrg_plc="x86_energy_perf_policy"
microname="Intel"
cpu_name="Intel"
else
microcode="amd-ucode"
microname="AMD"
cpu_name="AMD"
fi
if [[ "${hardw_model_vend}" == "${hardw_vendor}" ]]; then
sleep 0.2
YELLOW "
### Detection completed, the ${microname} microcode will be installed
### This system is a(n) ${nc}${hardw_model} ${yellow}${machine}
### The ${nc}${cpu_name} ${yellow}cpu microcode will be installed
"
else
sleep 0.2
YELLOW "
### This system is a(n) ${nc}${hardw_model} ${yellow}${hardw_vendor} ${machine}
### The ${nc}${cpu_name} ${yellow}cpu microcode will be installed
"
fi
ok
}
###################################################################################################
@ -3947,6 +3967,7 @@ ${magenta}###${nc}----------------------------------------${magenta}[ ${bwhite}A
if [[ "${fs}" == "1" ]]; then
if mkfs.ext4 -F -L Root "${root_dev}" > /dev/null 2>&1 ; then
tune2fs -O fast_commit "${root_dev}" > /dev/null 2>&1 || err_abort
mount "${root_dev}" /mnt > /dev/null 2>&1 || err_abort
sleep 0.2
NC "
@ -4071,6 +4092,7 @@ ${magenta}###${nc}----------------------------------------${magenta}[ ${bwhite}A
if [[ "${homeform}" == "y" ]]; then
if mkfs.ext4 -F -L Home "${home_dev}" > /dev/null 2>&1 ; then
tune2fs -O fast_commit "${home_dev}" > /dev/null 2>&1 || err_abort
mount --mkdir "${home_dev}" /mnt/home > /dev/null 2>&1 || err_abort
sleep 0.2
NC "
@ -4275,6 +4297,7 @@ Enter a partition number ${bwhite}(empty to skip and proceed)${blue}: "
#--------------------------------------------------------------------------------------------------
if [[ "${fs}" == "1" ]]; then
if mkfs.ext4 -F "${rootpart}" > /dev/null 2>&1 ; then
tune2fs -O fast_commit "${rootpart}" > /dev/null 2>&1 || err_abort
sleep 0.2
NC "
@ -4388,6 +4411,7 @@ ask_homepart_form() {
if [[ "${homeform}" == "y" ]]; then
if mkfs.ext4 -F -L Home "${home_dev}" > /dev/null 2>&1 ; then
tune2fs -O fast_commit "${home_dev}" > /dev/null 2>&1 || err_abort
mount --mkdir "${home_dev}" /mnt/home > /dev/null 2>&1 || err_abort
sleep 0.2
NC "
@ -4442,6 +4466,7 @@ Enter a partition number ${bwhite}(empty to skip and proceed)${blue}: "
homepart="$(echo "${volumes}" | awk "\$1 == ${form_home_nmbr} {print \$2}")"
if [[ -e "${homepart}" ]]; then
if mkfs.ext4 -F "${homepart}" > /dev/null 2>&1 ; then
tune2fs -O fast_commit "${homepart}" > /dev/null 2>&1 || err_abort
sleep 0.2
NC "
@ -4864,6 +4889,7 @@ ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}LUKS
#------------------------------------------------------------------------------------------
if [[ "${fs}" == "1" ]]; then
mkfs.ext4 -F -L Root /dev/mapper/"${ENCROOT}" > /dev/null 2>&1 || err_abort
tune2fs -O fast_commit /dev/mapper/"${ENCROOT}" > /dev/null 2>&1 || err_abort
mount /dev/mapper/"${ENCROOT}" /mnt > /dev/null 2>&1 || err_abort
sleep 0.2
NC "
@ -4934,6 +4960,7 @@ ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}LUKS
cryptsetup luksOpen "${home_dev}" "${ENCRHOME}" || err_abort
fi
mkfs.ext4 -F -L Home /dev/mapper/"${ENCRHOME}" > /dev/null 2>&1 || err_abort
tune2fs -O fast_commit /dev/mapper/"${ENCRHOME}" > /dev/null 2>&1 || err_abort
mount --mkdir /dev/mapper/"${ENCRHOME}" /mnt/home > /dev/null 2>&1 || err_abort
sleep 0.2
NC "
@ -4960,6 +4987,7 @@ ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}LUKS
if [[ "${homeform}" == "y" ]]; then
if mkfs.ext4 -F -L Home "${home_dev}" > /dev/null 2>&1 ; then
tune2fs -O fast_commit "${home_dev}" > /dev/null 2>&1 || err_abort
mount --mkdir "${home_dev}" /mnt/home > /dev/null 2>&1 || err_abort
sleep 0.2
NC "
@ -6150,5 +6178,5 @@ OPTIMIZED
uefi_check
connection_check
upd_clock
dtct_microcode
machine_dtct
until main_menu; do : ; done