From 5e99f1da50c4600aa2e204b0a6b7610cd2aa94b2 Mon Sep 17 00:00:00 2001 From: Jessie Hildebrandt Date: Fri, 2 Jun 2023 13:20:46 -0400 Subject: [PATCH] Add x86-64-v3 support detection to personalizer --- opensuse-personalizer.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/opensuse-personalizer.sh b/opensuse-personalizer.sh index 1cc19e9..50b4b5f 100755 --- a/opensuse-personalizer.sh +++ b/opensuse-personalizer.sh @@ -161,13 +161,6 @@ until prompt_chassis_type; do : ; done echo "Setting chassis type to ${system_chassis}" sudo hostnamectl chassis "${system_chassis}" -# Add "mobile" package pattern for mobile chassis types -case "${system_chassis}" in - "latop"|"convertible"|"tablet") - PATTERNS+=('patterns-desktop-mobile') - ;; -esac - ######################################## # Prompt for system name @@ -262,7 +255,20 @@ until prompt_optional_additions; do : ; done # ################################################################################ -detected_features=() +# Mobile system detection +case "${system_chassis}" in + "latop"|"convertible"|"tablet") + PATTERNS+=('patterns-desktop-mobile') + ;; +esac + +# x86-64-v3 CPU support detection +CPU_FLAGS=$(cat /proc/cpuinfo | grep flags | head -n 1 | cut -d: -f2) +if + echo CPU_FLAGS | awk '/avx/&&/avx2/&&/bmi1/&&/bmi2/&&/f16c/&&/fma/&&/abm/&&/movbe/&&/xsave/ {found=1} END {exit !found}' +then + PATTERNS+=('patterns-glibc-hwcaps-x86_64_v3') +fi # Touchpad detection if