Skip to content

Commit

Permalink
Merge pull request #273 from 007revad/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
007revad authored Apr 3, 2024
2 parents d97cb2f + 39d3362 commit b102ac0
Showing 1 changed file with 37 additions and 13 deletions.
50 changes: 37 additions & 13 deletions syno_hdd_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -1620,10 +1622,40 @@ else
fi


# Optionally disable "support_memory_compatibility" (not for DVA models)
if [[ ${model:0:3} != "dva" ]]; then
smc=support_memory_compatibility
setting="$(/usr/syno/bin/synogetkeyvalue $synoinfo $smc)"
# 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
Expand All @@ -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
Expand Down

0 comments on commit b102ac0

Please sign in to comment.