|
|
@ -30,6 +30,7 @@ |
|
|
|
|
|
|
|
|
# DONE |
|
|
# DONE |
|
|
# Added enabling E10M20-T1, M2D20 and M2D18 for DS1821+, DS1621+ and DS1520+. |
|
|
# Added enabling E10M20-T1, M2D20 and M2D18 for DS1821+, DS1621+ and DS1520+. |
|
|
|
|
|
# Added enabling M2D18 for RS822RP+, RS822+, RS1221RP+ and RS1221+ with older DSM version. |
|
|
# |
|
|
# |
|
|
# Fixed enabling E10M20-T1, M2D20 and M2D18 cards in models that don't officially support them. |
|
|
# Fixed enabling E10M20-T1, M2D20 and M2D18 cards in models that don't officially support them. |
|
|
# |
|
|
# |
|
|
@ -37,6 +38,8 @@ |
|
|
# - If last memory socket was empty an invalid unit of bytes could be used. Issue #106 |
|
|
# - If last memory socket was empty an invalid unit of bytes could be used. Issue #106 |
|
|
# - When dmidecode returned MB for one ram module and GB for another ram module. Issue #107 |
|
|
# - When dmidecode returned MB for one ram module and GB for another ram module. Issue #107 |
|
|
# |
|
|
# |
|
|
|
|
|
# Fixed bug displaying the max memory setting if total installed memory was less than the max memory. Issue #107 |
|
|
|
|
|
# |
|
|
# |
|
|
# |
|
|
# Minor bug fix for checking amount of installed memory. |
|
|
# Minor bug fix for checking amount of installed memory. |
|
|
# |
|
|
# |
|
|
@ -971,14 +974,12 @@ backupdb(){ |
|
|
for i in "${!db1list[@]}"; do |
|
|
for i in "${!db1list[@]}"; do |
|
|
backupdb "${db1list[i]}" ||{ |
|
|
backupdb "${db1list[i]}" ||{ |
|
|
ding |
|
|
ding |
|
|
echo -e "${Error}ERROR 5${Off} Failed to backup $(basename -- "${db1list[i]}")!" |
|
|
|
|
|
exit 5 |
|
|
exit 5 |
|
|
} |
|
|
} |
|
|
done |
|
|
done |
|
|
for i in "${!db2list[@]}"; do |
|
|
for i in "${!db2list[@]}"; do |
|
|
backupdb "${db2list[i]}" ||{ |
|
|
backupdb "${db2list[i]}" ||{ |
|
|
ding |
|
|
ding |
|
|
echo -e "${Error}ERROR 5${Off} Failed to backup $(basename -- "${db2list[i]}")!" |
|
|
|
|
|
exit 5 # maybe don't exit for .db.new file |
|
|
exit 5 # maybe don't exit for .db.new file |
|
|
} |
|
|
} |
|
|
done |
|
|
done |
|
|
@ -1153,6 +1154,8 @@ done |
|
|
|
|
|
|
|
|
# DS1821+, DS1621+ and DS1520+ also need edited device tree blob file |
|
|
# DS1821+, DS1621+ and DS1520+ also need edited device tree blob file |
|
|
# /etc.defaults/model.dtb |
|
|
# /etc.defaults/model.dtb |
|
|
|
|
|
# RS822RP+, RS822+, RS1221RP+ and RS1221+ with DSM older than 7.2 need |
|
|
|
|
|
# device tree blob file from DSM 7.2 to support M2D18 |
|
|
|
|
|
|
|
|
enable_card(){ |
|
|
enable_card(){ |
|
|
# $1 is the file |
|
|
# $1 is the file |
|
|
@ -1170,7 +1173,7 @@ enable_card(){ |
|
|
if set_section_key_value "$1" "$2" "$modelname" yes; then |
|
|
if set_section_key_value "$1" "$2" "$modelname" yes; then |
|
|
echo -e "Enabled ${Yellow}$3${Off} for ${Cyan}$modelname${Off}" >&2 |
|
|
echo -e "Enabled ${Yellow}$3${Off} for ${Cyan}$modelname${Off}" >&2 |
|
|
else |
|
|
else |
|
|
echo -e "${Error}ERROR 5${Off} Failed to enable $3 for ${modelname}!" >&2 |
|
|
echo -e "${Error}ERROR 9${Off} Failed to enable $3 for ${modelname}!" >&2 |
|
|
fi |
|
|
fi |
|
|
else |
|
|
else |
|
|
echo -e "${Yellow}$3${Off} already enabled for ${Cyan}$modelname${Off}" >&2 |
|
|
echo -e "${Yellow}$3${Off} already enabled for ${Cyan}$modelname${Off}" >&2 |
|
|
@ -1182,9 +1185,10 @@ check_modeldtb(){ |
|
|
# $1 is E10M20-T1 or M2D20 or M2D18 or M2D17 |
|
|
# $1 is E10M20-T1 or M2D20 or M2D18 or M2D17 |
|
|
if [[ -f /etc.defaults/model.dtb ]]; then |
|
|
if [[ -f /etc.defaults/model.dtb ]]; then |
|
|
if ! grep --text "$1" /etc.defaults/model.dtb >/dev/null; then |
|
|
if ! grep --text "$1" /etc.defaults/model.dtb >/dev/null; then |
|
|
if [[ $modelname == "DS1821+" ]] ||\ |
|
|
if [[ $modelname == "DS1821+" ]] || [[ $modelname == "DS1621+" ]] ||\ |
|
|
[[ $modelname == "DS1621+" ]] ||\ |
|
|
[[ $modelname == "DS1520+" ]] || [[ $modelname == "RS822RP+" ]] ||\ |
|
|
[[ $modelname == "DS1520+" ]]; |
|
|
[[ $modelname == "RS822+" ]] || [[ $modelname == "RS1221RP+" ]] ||\ |
|
|
|
|
|
[[ $modelname == "RS1221+" ]]; |
|
|
then |
|
|
then |
|
|
echo "" >&2 |
|
|
echo "" >&2 |
|
|
if [[ -f ./dtb/${modelname}_model.dtb ]]; then |
|
|
if [[ -f ./dtb/${modelname}_model.dtb ]]; then |
|
|
@ -1376,6 +1380,7 @@ if [[ $dsm -gt "6" ]]; then # DSM 6 as has no /proc/meminfo |
|
|
fi |
|
|
fi |
|
|
# Set mem_max_mb to the amount of installed memory |
|
|
# Set mem_max_mb to the amount of installed memory |
|
|
setting="$(get_key_value $synoinfo mem_max_mb)" |
|
|
setting="$(get_key_value $synoinfo mem_max_mb)" |
|
|
|
|
|
settingbak="$(get_key_value ${synoinfo}.bak mem_max_mb)" # GitHub issue #107 |
|
|
if [[ $ramtotal =~ ^[0-9]+$ ]]; then # Check $ramtotal is numeric |
|
|
if [[ $ramtotal =~ ^[0-9]+$ ]]; then # Check $ramtotal is numeric |
|
|
if [[ $ramtotal -gt "$setting" ]]; then |
|
|
if [[ $ramtotal -gt "$setting" ]]; then |
|
|
synosetkeyvalue "$synoinfo" mem_max_mb "$ramtotal" |
|
|
synosetkeyvalue "$synoinfo" mem_max_mb "$ramtotal" |
|
|
@ -1388,6 +1393,21 @@ if [[ $dsm -gt "6" ]]; then # DSM 6 as has no /proc/meminfo |
|
|
else |
|
|
else |
|
|
echo -e "\n${Error}ERROR${Off} Failed to change max memory!" |
|
|
echo -e "\n${Error}ERROR${Off} Failed to change max memory!" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
elif [[ $setting -gt "$ramtotal" ]] && [[ $setting -gt "$settingbak" ]]; # GitHub issue #107 |
|
|
|
|
|
then |
|
|
|
|
|
# Fix setting is greater than both ramtotal and default in syninfo.conf.bak |
|
|
|
|
|
synosetkeyvalue "$synoinfo" mem_max_mb "$settingbak" |
|
|
|
|
|
# Check we restored mem_max_mb |
|
|
|
|
|
setting="$(get_key_value $synoinfo mem_max_mb)" |
|
|
|
|
|
if [[ $settingbak == "$setting" ]]; then |
|
|
|
|
|
#echo -e "\nSet max memory to $ramtotal MB." |
|
|
|
|
|
ramgb=$((ramtotal / 1024)) |
|
|
|
|
|
echo -e "\nRestored max memory to $ramtotal GB." |
|
|
|
|
|
else |
|
|
|
|
|
echo -e "\n${Error}ERROR${Off} Failed to restore max memory!" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
elif [[ $ramtotal == "$setting" ]]; then |
|
|
elif [[ $ramtotal == "$setting" ]]; then |
|
|
#echo -e "\nMax memory already set to $ramtotal MB." |
|
|
#echo -e "\nMax memory already set to $ramtotal MB." |
|
|
ramgb=$((ramtotal / 1024)) |
|
|
ramgb=$((ramtotal / 1024)) |
|
|
|