Skip to content

Commit fa8ef41

Browse files
committed
v2.3.53
- Added GSP firmware modprobe option for 555 serie. Dedicated option in basic.conf is GSP_firm=0/1. Default: enabled. - Added backup_prev option to basic.conf file allowing user to enable or disable driver backup process during install time. Default: enabled.
1 parent 14f7b96 commit fa8ef41

File tree

1 file changed

+52
-34
lines changed

1 file changed

+52
-34
lines changed

zenvidia

+52-34
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,7 @@ nv_open_switch(){ # NVIDIA MODULE SWITCH. #
11961196
fi
11971197
}
11981198
blacklist_and_grub_set(){ # Perform blacklist and grub config. #
1199+
local serie mod short option message
11991200
## font display differently if install process in on.
12001201
if [ $from_install = 1 ]; then
12011202
fonts="${j}($n%)${end}${ge}${sf}"
@@ -1265,25 +1266,39 @@ blacklist_and_grub_set(){ # Perform blacklist and grub config. #
12651266
fi
12661267
## blacklist nouveau
12671268
[ -e /etc/modprobe.d/blacklist-nouveau.conf ] || echo "blacklist nouveau" > /etc/modprobe.d/blacklist-nouveau.conf
1268-
## NOTE : This part is unsure, usualy nvidia driver prefer modeset config in grub,
1269-
## this filter could be remove in near future.
1270-
if [ $(chk_family) -ge 535 ]; then
1271-
drm_conf_file=/etc/modprobe.d/nvidia-drm.conf
1272-
grep "modeset=$drm_modset" $drm_conf_file &>/dev/null
1273-
if [ $? -gt 0 ]; then
1274-
if [ "$timeout" != '' ];then
1275-
echo $"# Update modprobe nvidia-drm option for $drm_msg."; sleep 2
1276-
else
1277-
echo $"# ${fonts} * Update modprobe nvidia-drm option for $drm_msg.${end}${end}"; sleep 2
1278-
fi
1279-
echo "options nvidia_drm modeset=$drm_modset" > $drm_conf_file
1280-
if [ "$timeout" != '' ];then
1281-
echo $"# Modprobe $drm_msg nvidia-drm option already set."; sleep 2
1269+
## modprobe options.
1270+
## NOTE : Usualy nvidia driver prefer mod options config in grub,
1271+
## modprobe conf are set, for some of them, for session and mods reload.
1272+
opt_mod_list=(
1273+
"535,nvidia_drm,drm,modeset=$drm_modset,nvidia-drm"
1274+
"555,nvidia,gsp,NVreg_EnableGpuFirmware=$GSP_firm,GSP firmware"
1275+
)
1276+
for option_set in "${opt_mod_list[@]}"; do
1277+
#local serie mod short option message
1278+
serie=$(cut -d',' -f1 <<< $option_set )
1279+
if [ $(chk_family) -ge ${serie} ]; then
1280+
mod=$(cut -d',' -f2 <<< $option_set )
1281+
short=$(cut -d',' -f3 <<< $option_set )
1282+
option=$(cut -d',' -f4 <<< $option_set )
1283+
message=$(cut -d',' -f5 <<< $option_set )
1284+
conf_file=/etc/modprobe.d/nvidia-${short}.conf
1285+
grep "${option}" $conf_file &>/dev/null
1286+
if [ $? -gt 0 ]; then
1287+
if [ "$timeout" != '' ]; then
1288+
echo $"# Update modprobe ${message} option for $drm_msg."; sleep 2
1289+
else
1290+
echo $"# ${fonts} * Update modprobe ${message} option for $drm_msg.${end}${end}"; sleep 2
1291+
fi
1292+
echo "options ${mod} ${option}" > $conf_file
12821293
else
1283-
echo $"# ${fonts} * Modprobe $drm_msg nvidia-drm option already set.${end}${end}"; sleep 2
1294+
if [ "$timeout" != '' ]; then
1295+
echo $"# Modprobe ${drm_msg} ${message} option already set."; sleep 2
1296+
else
1297+
echo $"# ${fonts} * Modprobe ${drm_msg} ${message} option already set.${end}${end}"; sleep 2
1298+
fi
12841299
fi
12851300
fi
1286-
fi
1301+
done
12871302
}
12881303
## OPTIMUS SETUP
12891304
# let xorg_conf configure the xorg config file, then ask for prime or optimus if detected.
@@ -3119,27 +3134,28 @@ INSTALL_DRIVER(){ #
31193134
echo "$n"
31203135
## at install only, nvidia-installer is located in temp rep.
31213136
install_bin="./nvidia-installer"
3122-
echo $"# ${v}${j}($n%)${end} - Backing up old driver version, if any${end}"; sleep 2
3123-
#
3124-
# backup driver repository (shits happens!)
3125-
unset report_log
3126-
if [ -d $nv_root/nvidia.$(old_version) ]; then
3127-
bak_version=$(old_version)
3128-
if [[ -s $nvbackup/nvidia.$bak_version.tar$zip_ex ]]; then
3129-
echo $"# ${y}${j}($n%)${end} - Driver already backed up. Skipped.${end}"; sleep 1
3130-
report_log+=($"${vB}Previous version:\t\t${end}${gB} passed\t${end}> ${y}previously backed up${end}\n")
3137+
if [ ${backup_prev} = 1 ]; then
3138+
echo $"# ${v}${j}($n%)${end} - Backing up old driver version, if any${end}"; sleep 2
3139+
#
3140+
# backup driver repository (shits happens!)
3141+
unset report_log
3142+
if [ -d $nv_root/nvidia.$(old_version) ]; then
3143+
bak_version=$(old_version)
3144+
if [[ -s $nvbackup/nvidia.$bak_version.tar$zip_ex ]]; then
3145+
echo $"# ${y}${j}($n%)${end} - Driver already backed up. Skipped.${end}"; sleep 1
3146+
report_log+=($"${vB}Previous version:\t\t${end}${gB} passed\t${end}> ${y}previously backed up${end}\n")
3147+
else
3148+
y_text=$"Backup : $bak_version backup archive creation"
3149+
pulse=1; log=0; hold=0 ; hide_txt=0
3150+
{ timeout=30; {
3151+
backup_old_version; } & eval lpid=$!; y_pulse; } | win_yad_progress
3152+
report_log+=($"${vB}Previous version:\t\t${end}${gB} success\t${end}> ${y}$bak_version normal backup process${end}\n")
3153+
log=1
3154+
fi
31313155
else
3132-
y_text=$"Backup : $bak_version backup archive creation"
3133-
pulse=1; log=0; hold=0 ; hide_txt=0
3134-
{ timeout=30; {
3135-
backup_old_version; } & eval lpid=$!; y_pulse; } | win_yad_progress
3136-
report_log+=($"${vB}Previous version:\t\t${end}${gB} success\t${end}> ${y}$bak_version normal backup process${end}\n")
3137-
log=1
3156+
report_log+=($"${vB}Previous version:\t\t${end}${jB} warning\t${end}> ${y}no directory to archive.${end}\n")
31383157
fi
3139-
else
3140-
report_log+=($"${vB}Previous version:\t\t${end}${jB} warning\t${end}> ${y}no directory to archive.${end}\n")
31413158
fi
3142-
31433159
n=$[ $n+5 ] ; echo "$n"
31443160
## temp value to n
31453161
p=$n
@@ -6619,9 +6635,11 @@ default_sets(){
66196635
## default main set value.
66206636
temp_ramfs=${temp_ramfs:-1}
66216637
backup_to_user_dir=${backup_to_user_dir:-0}
6638+
backup_prev=${backup_prev:-1}
66226639
distro_warn=${distro_warn:-0}
66236640
use_drm=${use_drm:-1}
66246641
drm_modset=${drm_modset:-1}
6642+
GSP_firm=${GSP_firm:-1}
66256643
opti_preset=${opti_preset:-0}
66266644
from_install=${from_install:-0}
66276645
rem_extract=${rem_extract:-1}

0 commit comments

Comments
 (0)