@@ -1196,6 +1196,7 @@ nv_open_switch(){ # NVIDIA MODULE SWITCH. #
1196
1196
fi
1197
1197
}
1198
1198
blacklist_and_grub_set (){ # Perform blacklist and grub config. #
1199
+ local serie mod short option message
1199
1200
# # font display differently if install process in on.
1200
1201
if [ $from_install = 1 ]; then
1201
1202
fonts=" ${j} ($n %)${end}${ge}${sf} "
@@ -1265,25 +1266,39 @@ blacklist_and_grub_set(){ # Perform blacklist and grub config. #
1265
1266
fi
1266
1267
# # blacklist nouveau
1267
1268
[ -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
1282
1293
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
1284
1299
fi
1285
1300
fi
1286
- fi
1301
+ done
1287
1302
}
1288
1303
# # OPTIMUS SETUP
1289
1304
# let xorg_conf configure the xorg config file, then ask for prime or optimus if detected.
@@ -3119,27 +3134,28 @@ INSTALL_DRIVER(){ #
3119
3134
echo "$n "
3120
3135
## at install only, nvidia-installer is located in temp rep.
3121
3136
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
3131
3155
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")
3138
3157
fi
3139
- else
3140
- report_log+=($"${vB} Previous version:\t\t${end}${jB} warning\t${end} > ${y} no directory to archive.${end} \n")
3141
3158
fi
3142
-
3143
3159
n=$[ $n +5 ] ; echo "$n "
3144
3160
## temp value to n
3145
3161
p=$n
@@ -6619,9 +6635,11 @@ default_sets(){
6619
6635
## default main set value.
6620
6636
temp_ramfs=${temp_ramfs:- 1}
6621
6637
backup_to_user_dir=${backup_to_user_dir:- 0}
6638
+ backup_prev=${backup_prev:- 1}
6622
6639
distro_warn=${distro_warn:- 0}
6623
6640
use_drm=${use_drm:- 1}
6624
6641
drm_modset=${drm_modset:- 1}
6642
+ GSP_firm=${GSP_firm:- 1}
6625
6643
opti_preset=${opti_preset:- 0}
6626
6644
from_install=${from_install:- 0}
6627
6645
rem_extract=${rem_extract:- 1}
0 commit comments