Skip to content

Commit

Permalink
Merge pull request #18 from 007revad/develop
Browse files Browse the repository at this point in the history
Added disable support memory compatibility option
  • Loading branch information
007revad committed Mar 20, 2023
2 parents 8f2799e + 8ea7928 commit 79159da
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v1.2.17
- Added disable support memory compatibility option --ram or -r

v1.2.16
- Changed to show the script version, Synology model and DSM version on each run to make it easier to debug any user's issues.

Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The script works in DSM 7 and DSM 6.
* Adds any missing drives to the Synology's compatible-drive database.
* Prevents DSM auto updating the drive database.
* Optionally disable DSM's "support_disk_compatibility".
* Optionally disable DSM's "support_memory_compatibility".
* Checks that M.2 volume support is enabled (on supported models).
* Makes DSM recheck disk compatibility so rebooting is not needed (DSM 7 only).
* Reminds you that you may need to reboot the Synology after running the script (DSM 6 only).
Expand All @@ -38,11 +39,13 @@ You would need to re-run the script after a DSM update. If you have DSM set to a

### Options when running the script

There are 3 optional flags you can use when running the script:
* -showedits or -s to show you the changes it made to the Synology's compatible-drive database.
* -force or -f to disable "support_disk_compatibility". This should be needed if any of your drives weren't detected.
* If you run the script without -force or -f it will re-eanble "support_disk_compatibility".
* -m2 or -m to prevent processing M.2 drives.
There are 4 optional flags you can use when running the script:
* --showedits or -s to show you the changes it made to the Synology's compatible-drive database.
* --force or -f to disable "support_disk_compatibility". This should only be needed if any of your drives weren't detected.
* If you run the script without --force or -f it will re-eanble "support_disk_compatibility".
* --ram or -r to disable "support_memory_compatibility".
* If you run the script without --ram or -r it will re-eanble "support_memory_compatibility".
* --m2 or -m to prevent processing M.2 drives.

### Scheduling the script in Synology's Task Scheduler

Expand Down Expand Up @@ -75,3 +78,4 @@ sudo /path-to-script/syno_hdd_db.sh -showedits
- The idea for this script came from a comment made by Empyrealist on the Synology subreddit.
- Thanks for the assistance from Alex_of_Chaos on the Synology subreddit.
- Thanks to dwabraxus and aferende for help detecting connected expansion units.
- Thanks to bartoque on the Synology subreddit for the tip on making the script download the latest release from github.
29 changes: 26 additions & 3 deletions syno_hdd_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
# Optionally disable "support_disk_compatibility".


scriptver="v1.2.16"
scriptver="v1.2.17"
script=Synology_HDD_db
repo="007revad/Synology_HDD_db"

Expand Down Expand Up @@ -150,8 +150,7 @@ if options="$(getopt -o abcdefghijklmnopqrstuvwxyz0123456789 -a \
force=yes
;;
-r|--ram) # Include memory compatibility
# shellcheck disable=SC2034
ram=yes # for future use
ram=yes
;;
-h|--help) # Show usage options
usage
Expand Down Expand Up @@ -688,6 +687,30 @@ else
fi


# Optionally disable "support_memory_compatibility"
smc=support_memory_compatibility
setting="$(get_key_value $synoinfo $smc)"
if [[ $ram == "yes" ]]; then
if [[ $setting == "yes" ]]; then
# Disable support_memory_compatibility
sed -i "s/${smc}=\"yes\"/${smc}=\"no\"/" "$synoinfo"
setting="$(get_key_value "$synoinfo" $smc)"
if [[ $setting == "no" ]]; then
echo -e "\nDisabled support memory compatibility."
fi
fi
else
if [[ $setting == "no" ]]; then
# Enable support_memory_compatibility
sed -i "s/${smc}=\"no\"/${smc}=\"yes\"/" "$synoinfo"
setting="$(get_key_value "$synoinfo" $smc)"
if [[ $setting == "yes" ]]; then
echo -e "\nRe-enabled support memory compatibility."
fi
fi
fi


# Enable m2 volume support
if [[ $m2 != "no" ]]; then
if [[ $m2exists == "yes" ]]; then
Expand Down

0 comments on commit 79159da

Please sign in to comment.