From 9d88cf0cd52c71d6dc8721812f3e0ae1003dc0bc Mon Sep 17 00:00:00 2001 From: Adel Kara Slimane Date: Wed, 2 Jun 2021 11:02:06 +0200 Subject: [PATCH] prepare: handle properly optiprofile from `customization.cfg` (#254) Signed-off-by: Adel KARA SLIMANE --- linux-tkg-config/prepare | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/linux-tkg-config/prepare b/linux-tkg-config/prepare index 5d3d315..88dfb1c 100644 --- a/linux-tkg-config/prepare +++ b/linux-tkg-config/prepare @@ -238,15 +238,16 @@ _tkg_initscript() { cp "$_where"/linux-tkg-config/${_basekernel}/* "$_path" fi - if [ -z "$_OPTIPROFILE" ]; then + if [[ -z "$_OPTIPROFILE" || ! "$_OPTIPROFILE" =~ ^(1|2|3)$ ]]; then # Prompt about optimized configurations. Available variable values will overwrite customization.cfg/external config ones. plain "Do you want to use a predefined optimized profile?" _default_index="0" _prompt_from_array "Custom" "Ryzen Desktop (Performance)" "Other Desktop (Performance)" + _OPTIPROFILE=$((${_selected_index}+1)) fi - if [ "$_selected_index" = "1" ]; then + if [ "$_OPTIPROFILE" = "2" ]; then source "$_where"/linux-tkg-config/ryzen-desktop-profile.cfg && msg2 "Ryzen Desktop (Performance) profile will be used." && msg2 "" - elif [ "$_selected_index" = "2" ]; then + elif [ "$_OPTIPROFILE" = "3" ]; then source "$_where"/linux-tkg-config/generic-desktop-profile.cfg && msg2 "Generic Desktop (Performance) profile will be used." && msg2 "" fi