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