Browse Source

Merge pull request #273 from 007revad/develop

Develop
pull/283/head v3.5.88
Dave Russell 2 years ago
committed by GitHub
parent
commit
b102ac087e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 46
      syno_hdd_db.sh

46
syno_hdd_db.sh

@ -16,6 +16,8 @@
#--------------------------------------------------------------------------------------------------
# CHANGES
# Changed disabling memory compatibility for older models. Issue #272
#
# Hard coded /usr/syno/bin/<command> for Synology commands (to prevent $PATH issues).
#
# Now enables creating storage pools in Storage Manager for M.2 drives in PCIe adaptor cards.
@ -35,7 +37,7 @@
# /var/packages/StorageManager/target/ui/storage_panel.js
scriptver="v3.4.87"
scriptver="v3.5.88"
script=Synology_HDD_db
repo="007revad/Synology_HDD_db"
scriptname=syno_hdd_db
@ -1620,10 +1622,40 @@ else
fi
# Optionally disable "support_memory_compatibility" (not for DVA models)
if [[ ${model:0:3} != "dva" ]]; then
# Optionally disable memory compatibility warnings
smc=support_memory_compatibility
setting="$(/usr/syno/bin/synogetkeyvalue $synoinfo $smc)"
settingbak="$(/usr/syno/bin/synogetkeyvalue $synoinfo.bak $smc)"
if [[ -z $settingbak ]] || [[ -z $setting ]]; then
# For older models that don't use "support_memory_compatibility"
memcheck="/usr/lib/systemd/system/SynoMemCheck.service"
memcheck_value="$(/usr/syno/bin/synosetkeyvalue "$memcheck" ExecStart)"
if [[ $ram == "yes" ]]; then
if [[ $memcheck_value == "/usr/syno/bin/syno_mem_check" ]]; then
# Disable SynoMemCheck.service
/usr/syno/bin/synosetkeyvalue "$memcheck" ExecStart /bin/true
memcheck_value="$(/usr/syno/bin/synosetkeyvalue "$memcheck" ExecStart)"
if [[ $memcheck_value == "/bin/true" ]]; then
echo -e "\nDisabled SynoMemCheck memory compatibility."
fi
elif [[ $memcheck_value == "/bin/true" ]]; then
echo -e "\nSynoMemCheck memory compatibility already disabled."
fi
else
if [[ $memcheck_value == "/bin/true" ]]; then
# Enable SynoMemCheck.service
/usr/syno/bin/synosetkeyvalue "$memcheck" ExecStart /usr/syno/bin/syno_mem_check
memcheck_value="$(/usr/syno/bin/synosetkeyvalue "$memcheck" ExecStart)"
if [[ $memcheck_value == "/usr/syno/bin/syno_mem_check" ]]; then
echo -e "\nRe-enabled SynoMemCheck memory compatibility."
fi
elif [[ $memcheck_value == "/usr/syno/bin/syno_mem_check" ]]; then
echo -e "\nSynoMemCheck memory compatibility already enabled."
fi
fi
else
# Disable "support_memory_compatibility" (not for older models)
if [[ $ram == "yes" ]]; then
if [[ $setting == "yes" ]]; then
# Disable support_memory_compatibility
@ -1649,14 +1681,6 @@ if [[ ${model:0:3} != "dva" ]]; then
fi
fi
# Disable SynoMemCheck.service for DVA models
if [[ ${model:0:3} == "dva" ]]; then
memcheck="/usr/lib/systemd/system/SynoMemCheck.service"
if [[ $(/usr/syno/bin/synogetkeyvalue "$memcheck" ExecStart) == "/usr/syno/bin/syno_mem_check" ]]; then
/usr/syno/bin/synosetkeyvalue "$memcheck" ExecStart /bin/true
fi
fi
# Optionally set mem_max_mb to the amount of installed memory
if [[ $dsm -gt "6" ]]; then # DSM 6 as has no dmidecode
if [[ $ram == "yes" ]] && [[ -f /usr/sbin/dmidecode ]]; then

Loading…
Cancel
Save