From 42b84ca99c83566e8b4c8f218530fdc9c3b24586 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Wed, 22 Mar 2023 23:12:14 +1100 Subject: [PATCH 01/74] Update syno_hdd_db.sh Minor change to check new version --- syno_hdd_db.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 2c6aa12..d26892e 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -84,7 +84,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v1.2.18" +scriptver="v1.2.19" script=Synology_HDD_db repo="007revad/Synology_HDD_db" @@ -227,7 +227,7 @@ get_latest_release() { sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value } -tag=$(get_latest_release "007revad/Synology_HDD_db") +tag=$(get_latest_release "$repo") shorttag="${tag:1}" if [[ $HOME =~ /var/services/* ]]; then From 340320df5d00187601ce18e9c0c7cb2ab6406ca9 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Wed, 22 Mar 2023 23:14:39 +1100 Subject: [PATCH 02/74] Update CHANGES.txt --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index d3d9f99..3cb5748 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +v2.1.19 +- Minor change to check new version code. + v2.2.18 - Minor shell output formatting fix. From 76a30667f9ff77da94225eb5dbd67d2ddae96c09 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 23 Mar 2023 09:23:17 +1100 Subject: [PATCH 03/74] Update syno_hdd_db.sh Added a timeouts when checking for newer script version in case github is down or slow. --- syno_hdd_db.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index d26892e..38c580b 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -29,6 +29,8 @@ # It's also parsed and checked and probably in some cases it could be more critical to patch that one instead. # DONE +# Added a timeouts when checking for newer script version in case github is down or slow. +# # Added option to disable incompatible memory notifications. # # Now finds your expansion units' model numbers and adds your drives to their db files. @@ -84,7 +86,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v1.2.19" +scriptver="v1.2.20" script=Synology_HDD_db repo="007revad/Synology_HDD_db" @@ -204,7 +206,6 @@ productversion=$(get_key_value /etc.defaults/VERSION productversion) buildphase=$(get_key_value /etc.defaults/VERSION buildphase) if [[ $buildphase == GM ]]; then buildphase=""; fi echo "$model DSM $productversion $buildphase" -echo "" # Convert model to lower case @@ -213,16 +214,22 @@ model=${model,,} # Check for dodgy characters after model number if [[ $model =~ 'pv10-j'$ ]]; then # GitHub issue #10 model=${model%??????}+ # replace last 6 chars with + + echo "Using model: $model" elif [[ $model =~ '-j'$ ]]; then # GitHub issue #2 model=${model%??} # remove last 2 chars + echo "Using model: $model" fi +echo "" # To keep output readable + #------------------------------------------------------------------------------ # Check latest release with GitHub API get_latest_release() { - curl --silent "https://api.github.com/repos/$1/releases/latest" | + # Curl timeout options: + # https://unix.stackexchange.com/questions/94604/does-curl-have-a-timeout + curl --silent -m 10 --connect-timeout 5 "https://api.github.com/repos/$1/releases/latest" | grep '"tag_name":' | # Get tag line sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value } @@ -252,7 +259,8 @@ if ! printf "%s\n%s\n" "$tag" "$scriptver" | echo -e "${Cyan}Do you want to download $tag now?${Off} {y/n]" read -r -t 30 reply if [[ ${reply,,} == "y" ]]; then - if ! curl -LJO "https://github.com/$repo/archive/refs/tags/$tag.tar.gz"; then + if ! curl -LJO -m 30 --connect-timeout 5 "https://github.com/$repo/archive/refs/tags/$tag.tar.gz"; + then echo -e "${Error}ERROR ${Off} Failed to download $script-$shorttag.tar.gz!" else if [[ -f $HOME/$script-$shorttag.tar.gz ]]; then From 49a9a95e0a56f7ec30974a706c3cc0268377e391 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 23 Mar 2023 09:26:23 +1100 Subject: [PATCH 04/74] Update CHANGES.txt Added a timeouts when checking for newer script version in case github is down or slow. --- CHANGES.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 3cb5748..b123cd2 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,7 +1,11 @@ -v2.1.19 +v1.2.20 +- Added a timeouts when checking for newer script version in case github is down or slow. +- Fixed change log (v1.2.19 and v1.2.18 were listed as v2.2.19 and v2.2.19). + +v1.2.19 - Minor change to check new version code. -v2.2.18 +v1.2.18 - Minor shell output formatting fix. v1.2.17 From 7fff233367bddfea96824e0cee891cb5466f7b91 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 23 Mar 2023 10:21:08 +1100 Subject: [PATCH 05/74] Update syno_hdd_db.sh Reinstated removing brand from start of drive model. --- syno_hdd_db.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 38c580b..99fffe7 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -86,7 +86,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v1.2.20" +scriptver="v1.2.21" script=Synology_HDD_db repo="007revad/Synology_HDD_db" @@ -296,6 +296,20 @@ fixdrivemodel(){ if [[ $1 =~ MZ.*" 00Y" ]]; then hdmodel=$(printf "%s" "$1" | sed 's/ 00Y.*//') fi + + # Brands that return "BRAND " and need "BRAND " removed. + if [[ $1 =~ ^[A-Za-z]{1,7}" ".* ]]; then + #see Smartmontools database in /var/lib/smartmontools/drivedb.db + hdmodel=${hdmodel#"WDC "} # Remove "WDC " from start of model name + hdmodel=${hdmodel#"HGST "} # Remove "HGST " from start of model name + hdmodel=${hdmodel#"TOSHIBA "} # Remove "TOSHIBA " from start of model name + + # Old drive brands + hdmodel=${hdmodel#"Hitachi "} # Remove "Hitachi " from start of model name + hdmodel=${hdmodel#"SAMSUNG "} # Remove "SAMSUNG " from start of model name + hdmodel=${hdmodel#"FUJISTU "} # Remove "FUJISTU " from start of model name + hdmodel=${hdmodel#"APPLE HDD "} # Remove "APPLE HDD " from start of model name + fi } getdriveinfo() { From 73ffe4db422e7423be53daacd87e3ca0dd7e90f0 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 23 Mar 2023 10:23:20 +1100 Subject: [PATCH 06/74] Update CHANGES.txt --- CHANGES.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index b123cd2..36569d1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,8 @@ +v1.2.21 +- Reinstated removing brand from start of drive model to fix issue #24. + v1.2.20 -- Added a timeouts when checking for newer script version in case github is down or slow. +- Added a timeouts when checking for newer script version in case github is down or slow to fix issue #25. - Fixed change log (v1.2.19 and v1.2.18 were listed as v2.2.19 and v2.2.19). v1.2.19 From 300ec1b46302911ccdd82665f48d88c940264f0c Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 23 Mar 2023 14:14:39 +1100 Subject: [PATCH 07/74] Update syno_hdd_db.sh Changed 'latest version check' to download to /tmp and extract files to the script's location. --- syno_hdd_db.sh | 69 +++++++++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 99fffe7..e981ed4 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -29,6 +29,8 @@ # It's also parsed and checked and probably in some cases it could be more critical to patch that one instead. # DONE +# Changed latest version check to download to /tmp and extract files to the script's location. +# # Added a timeouts when checking for newer script version in case github is down or slow. # # Added option to disable incompatible memory notifications. @@ -86,7 +88,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v1.2.21" +scriptver="v1.2.22" script=Synology_HDD_db repo="007revad/Synology_HDD_db" @@ -229,57 +231,66 @@ echo "" # To keep output readable get_latest_release() { # Curl timeout options: # https://unix.stackexchange.com/questions/94604/does-curl-have-a-timeout - curl --silent -m 10 --connect-timeout 5 "https://api.github.com/repos/$1/releases/latest" | + curl --silent -m 10 --connect-timeout 5 \ + "https://api.github.com/repos/$1/releases/latest" | grep '"tag_name":' | # Get tag line sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value } tag=$(get_latest_release "$repo") shorttag="${tag:1}" - -if [[ $HOME =~ /var/services/* ]]; then - shorthome=${HOME:14} -else - shorthome="$HOME" -fi +scriptpath=$(dirname -- "$0") if ! printf "%s\n%s\n" "$tag" "$scriptver" | sort --check --version-sort &> /dev/null ; then echo -e "${Cyan}There is a newer version of this script available.${Off}" echo -e "Current version: ${scriptver}\nLatest version: $tag" - if [[ ! -d $HOME ]]; then - # Can't download to home + if [[ -f $scriptpath/$script-$shorttag.tar.gz ]]; then + # They have the latest version tar.gz downloaded but are using older version echo "https://github.com/$repo/releases/latest" sleep 10 - elif [[ -f $HOME/$script-$shorttag.tar.gz ]]; then - # Latest version tar.gz in home but they're using older version + elif [[ -d $scriptpath/$script-$shorttag ]]; then + # They have the latest version extracted but are using older version echo "https://github.com/$repo/releases/latest" sleep 10 else echo -e "${Cyan}Do you want to download $tag now?${Off} {y/n]" read -r -t 30 reply if [[ ${reply,,} == "y" ]]; then - if ! curl -LJO -m 30 --connect-timeout 5 "https://github.com/$repo/archive/refs/tags/$tag.tar.gz"; - then - echo -e "${Error}ERROR ${Off} Failed to download $script-$shorttag.tar.gz!" - else - if [[ -f $HOME/$script-$shorttag.tar.gz ]]; then - if ! tar -xf "$HOME/$script-$shorttag.tar.gz"; then - echo -e "${Error}ERROR ${Off} Failed to extract $script-$shorttag.tar.gz!" - else - if ! rm "$HOME/$script-$shorttag.tar.gz"; then - echo -e "${Error}ERROR ${Off} Failed to delete downloaded $script-$shorttag.tar.gz!" + if cd /tmp; then + url="https://github.com/$repo/archive/refs/tags/$tag.tar.gz" + if ! curl -LJO -m 30 --connect-timeout 5 "$url"; + then + echo -e "${Error}ERROR ${Off} Failed to download"\ + "$script-$shorttag.tar.gz!" + else + if [[ -f /tmp/$script-$shorttag.tar.gz ]]; then + # Extract tar file to script location + if ! tar -xf "/tmp/$script-$shorttag.tar.gz" -C "$scriptpath"; + then + echo -e "${Error}ERROR ${Off} Failed to"\ + "extract $script-$shorttag.tar.gz!" else - echo -e "\n$tag and changes.txt are in ${Cyan}$shorthome/$script-$shorttag${Off}" - echo -e "${Cyan}Do you want to stop this script so you can run the new one?${Off} {y/n]" - read -r -t 30 reply - if [[ ${reply,,} == "y" ]]; then exit; fi + if ! rm "/tmp/$script-$shorttag.tar.gz"; then + echo -e "${Error}ERROR ${Off} Failed to delete"\ + "downloaded $script-$shorttag.tar.gz!" + else + echo -e "\n$tag and changes.txt are in "\ + "${Cyan}$scriptpath/$script-$shorttag${Off}" + echo -e "${Cyan}Do you want to stop this script"\ + "so you can run the new one?${Off} {y/n]" + read -r -t 30 reply + if [[ ${reply,,} == "y" ]]; then exit; fi + fi fi + else + echo -e "${Error}ERROR ${Off}"\ + "/tmp/$script-$shorttag.tar.gz not found!" + #ls /tmp | grep "$script" # debug fi - else - echo -e "${Error}ERROR ${Off} $shorthome/$script-$shorttag.tar.gz not found!" - #ls $HOME/ | grep "$script" # debug fi + else + echo -e "${Error}ERROR ${Off} Failed to cd to /tmp!" fi fi fi From 351598e30345d8d101532f82431ae702d05b97aa Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 23 Mar 2023 14:16:04 +1100 Subject: [PATCH 08/74] Update CHANGES.txt --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 36569d1..1d695dd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +v1.2.22 +- Changed 'latest version check' to download to /tmp and extract files to the script's location to fix issue #27. + v1.2.21 - Reinstated removing brand from start of drive model to fix issue #24. From fa0d7ca129e1c6f273dac7f286c542790ec9d8e0 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 23 Mar 2023 15:08:04 +1100 Subject: [PATCH 09/74] Update syno_hdd_db.sh Changed to show if no M.2 cards were found, if M.2 drives were found. --- syno_hdd_db.sh | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index e981ed4..4a92dd1 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -29,6 +29,8 @@ # It's also parsed and checked and probably in some cases it could be more critical to patch that one instead. # DONE +# Changed to show if no M.2 cards were found, if M.2 drives were found. +# # Changed latest version check to download to /tmp and extract files to the script's location. # # Added a timeouts when checking for newer script version in case github is down or slow. @@ -57,7 +59,6 @@ # # Fixed bug where "M.2 volume support already enabled" message appeared when NAS had no M.2 drives. # -# # Added check that M.2 volume support is enabled (on supported models). # # Added support for M.2 SATA drives. @@ -88,7 +89,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v1.2.22" +scriptver="v1.2.23" script=Synology_HDD_db repo="007revad/Synology_HDD_db" @@ -114,7 +115,7 @@ $script $scriptver - by 007revad Usage: $(basename "$0") [options] Options: - -s, --showedits Show the edits made to host db file(s) + -s, --showedits Show edits made to _host db and db.new file(s) -n, --noupdate Prevent DSM updating the compatible drive databases -m, --m2 Don't process M.2 drives -f, --force Force DSM to not check drive compatibility @@ -474,14 +475,18 @@ if [[ ${#m2cardlist[@]} -gt "0" ]]; then fi # Check m2cards array isn't empty -if [[ ${#m2cards[@]} -gt "0" ]]; then - echo "M.2 card models found: ${#m2cards[@]}" - num="0" - while [[ $num -lt "${#m2cards[@]}" ]]; do - echo "${m2cards[num]}" - num=$((num +1)) - done - echo +if [[ $m2 != "no" ]]; then + if [[ ${#m2cards[@]} -eq "0" ]]; then + echo -e "No M.2 cards found\n" + else + echo "M.2 card models found: ${#m2cards[@]}" + num="0" + while [[ $num -lt "${#m2cards[@]}" ]]; do + echo "${m2cards[num]}" + num=$((num +1)) + done + echo + fi fi From 2666434273271d6a872b54f210fa4ce3c4ac0073 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 23 Mar 2023 15:09:23 +1100 Subject: [PATCH 10/74] Update CHANGES.txt --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 1d695dd..2fa4acd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +v1.2.23 +- Changed to show if no M.2 cards were found, if M.2 drives were found. + v1.2.22 - Changed 'latest version check' to download to /tmp and extract files to the script's location to fix issue #27. From da31e50358aa467c7cb76d6a5c154c43dac832b4 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 23 Mar 2023 22:55:13 +1100 Subject: [PATCH 11/74] Add files via upload --- images/ram_wanring.png | Bin 0 -> 9041 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 images/ram_wanring.png diff --git a/images/ram_wanring.png b/images/ram_wanring.png new file mode 100644 index 0000000000000000000000000000000000000000..49781773af231260847bfb15203d07eeb0cd85b2 GIT binary patch literal 9041 zcmbt)XH=6xxF!k+h|&c$kWiE&O++cuG!U@Ri`0M`0Tl=Y0#bt@N+)8W7-~>J1!9z9 zLQ^S0dISRqp#>rI5^5l@@t*y&dv^ESd-umz=FFLycfR@F=Y8gxH__VC?D)~sM>#k+ zj$glKV#~pC2+DpR;jkfRg0?}9C$SU-W_gsnJ?g) za}WoIK-0hL5Xryv9tVf)^mUV~_Mz^Jxji341{_Ga>qbH*LJG1veRw%NTSXmS9mLc% z#k5$R*>6IO(bC`R5s&HLc8 zH?FF|dwCFgV zOpEBh?qB?KDiw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d7c122efbb9d5ba9b00bdf19efbce9fd6e8480 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 23 Mar 2023 23:02:34 +1100 Subject: [PATCH 12/74] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bd4c6aa..ce1d305 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ #### What the script does: * 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". +* Optionally disable DSM's "support_memory_compatibility" to prevent non-Synology memory notifications. * 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). From 8a188e6b7745b575c95e5b2878d9cb4a991d03a5 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Fri, 24 Mar 2023 21:02:54 +1100 Subject: [PATCH 13/74] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ce1d305..e1687c5 100644 --- a/README.md +++ b/README.md @@ -58,10 +58,10 @@ ### Scheduling the script in Synology's Task Scheduler ### Running the script via SSH -You run the script in a shell with sudo or as root. +You run the script in a shell with sudo i or as root. ```YAML -sudo /path-to-script/syno_hdd_db.sh +sudo i /path-to-script/syno_hdd_db.sh ``` **Note:** Replace /path-to-script/ with the actual path to the script on your Synology. @@ -71,7 +71,7 @@ ### Running the script via SSH If you run the script with the -showedits flag it will show you the changes it made to the Synology's compatible-drive database. Obviously this is only useful if you run the script in a shell. ```YAML -sudo /path-to-script/syno_hdd_db.sh -showedits +sudo i /path-to-script/syno_hdd_db.sh -showedits ``` **Note:** Replace /path-to-script/ with the actual path to the script on your Synology. From e81d39ebc795a08adc3030eb7c519460949d01ec Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Sat, 25 Mar 2023 09:18:25 +1100 Subject: [PATCH 14/74] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e1687c5..094313e 100644 --- a/README.md +++ b/README.md @@ -58,10 +58,10 @@ ### Scheduling the script in Synology's Task Scheduler ### Running the script via SSH -You run the script in a shell with sudo i or as root. +You run the script in a shell with sudo -i or as root. ```YAML -sudo i /path-to-script/syno_hdd_db.sh +sudo -i /path-to-script/syno_hdd_db.sh ``` **Note:** Replace /path-to-script/ with the actual path to the script on your Synology. @@ -71,7 +71,7 @@ ### Running the script via SSH If you run the script with the -showedits flag it will show you the changes it made to the Synology's compatible-drive database. Obviously this is only useful if you run the script in a shell. ```YAML -sudo i /path-to-script/syno_hdd_db.sh -showedits +sudo -i /path-to-script/syno_hdd_db.sh -showedits ``` **Note:** Replace /path-to-script/ with the actual path to the script on your Synology. From 657e0ed3a14ef95dedc40bd90d0a1f6306e6e686 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Sat, 25 Mar 2023 11:59:53 +1100 Subject: [PATCH 15/74] Update syno_hdd_db.sh Fixed skipping removable drives in DSM 7 on RS2421rp+ to fix issue #23. --- syno_hdd_db.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 4a92dd1..e880c95 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -326,8 +326,8 @@ fixdrivemodel(){ getdriveinfo() { # Skip removable drives (USB drives) - removable=$(cat "$1/removable") - if [[ $removable == "0" ]]; then + removable=$(cat "$1/removable") # Some DSM 7 RS models return 1 for internal drives! + if [[ $removable == "0" ]] || [[ $dsm -gt "6" ]]; then # Get drive model and firmware version hdmodel=$(cat "$1/device/model") hdmodel=$(printf "%s" "$hdmodel" | xargs) # trim leading and trailing white space From 0c782c575ef555c255ac60ba9112f7fb95fe7b8e Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Sat, 25 Mar 2023 12:02:40 +1100 Subject: [PATCH 16/74] Update CHANGES.txt --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 2fa4acd..0e20863 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +v1.2.24 +- Bug fix. Ignoring removable drives was ignoring all drives in DSM 7 on a RS2421rp+. Fix issue #23. + v1.2.23 - Changed to show if no M.2 cards were found, if M.2 drives were found. From a938c5171c37e358d5ffee045403750c16344f32 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Sat, 25 Mar 2023 12:04:26 +1100 Subject: [PATCH 17/74] Update syno_hdd_db.sh --- syno_hdd_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index e880c95..d1b880a 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -89,7 +89,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v1.2.23" +scriptver="v1.2.24" script=Synology_HDD_db repo="007revad/Synology_HDD_db" From d1f36c71f980cf3cc4e688333e59fb303fc900df Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Sun, 26 Mar 2023 06:26:50 +1100 Subject: [PATCH 18/74] Update syno_hdd_db.sh --- syno_hdd_db.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index d1b880a..5c027d0 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -89,7 +89,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v1.2.24" +scriptver="v1.2.25" script=Synology_HDD_db repo="007revad/Synology_HDD_db" @@ -276,11 +276,11 @@ if ! printf "%s\n%s\n" "$tag" "$scriptver" | echo -e "${Error}ERROR ${Off} Failed to delete"\ "downloaded $script-$shorttag.tar.gz!" else - echo -e "\n$tag and changes.txt are in "\ - "${Cyan}$scriptpath/$script-$shorttag${Off}" + echo -e "\n$tag and changes.txt downloaded to:"\ + "$scriptpath" echo -e "${Cyan}Do you want to stop this script"\ "so you can run the new one?${Off} {y/n]" - read -r -t 30 reply + read -r reply if [[ ${reply,,} == "y" ]]; then exit; fi fi fi From b6c435dd6e2e8dcca8006ba592b69a40a03e78d7 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Sun, 26 Mar 2023 06:28:27 +1100 Subject: [PATCH 19/74] Update CHANGES.txt --- CHANGES.txt | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 0e20863..2d49648 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +v1.2.25 +- Minor bug fix. + v1.2.24 - Bug fix. Ignoring removable drives was ignoring all drives in DSM 7 on a RS2421rp+. Fix issue #23. @@ -71,16 +74,16 @@ v1.1.8 - If run without -f or -force "support_disk_compatibility" is re-enabled. v1.0.7 -Added message if newer script version is available. +- Added message if newer script version is available. v1.0.6 -Added 2nd method of disabling disk compatibility to solve issue #1 and #4 for the few people where the original method didn't work. +- Added 2nd method of disabling disk compatibility to solve issue #1 and #4 for the few people where the original method didn't work. v1.0.5 -Changed to avoid issue #2 +- Changed to avoid issue #2 v1.0.4 -Now backs up the database file if there is no backup already. +- Now backs up the database file if there is no backup already. v1.0.3 Changed to avoid avoid error messages from previous change to search for sda and sata# drives in DSM 6 and DSM 7. @@ -88,13 +91,13 @@ Changed to avoid avoid error messages from previous change to search for sda and - /dev/sd*: No such file or directory v1.0.2 -Improved formatting when listing found drives. +- Improved formatting when listing found drives. v1.0.1 -Fixed issue where drives weren't detected if: -- NAS had been updated from DSM 6 to DSM 7 and still used sda, sdb etc. -- Models like the DVA3219 that use sata# even in DSM 6. +- Fixed issue where drives weren't detected if: + - NAS had been updated from DSM 6 to DSM 7 and still used sda, sdb etc. + - Models like the DVA3219 that use sata# even in DSM 6. v1.0.0 -Initial release. +- Initial release. From 7be9e99b58ee50762fa553cf60455c16c1557200 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Sun, 26 Mar 2023 07:52:57 +1100 Subject: [PATCH 20/74] Update CHANGES.txt --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 2d49648..7ea3d09 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +v1.2.26 +- Added -ff option to pvcreate to prevent issues. + v1.2.25 - Minor bug fix. From 2de44fbae62dc608f24a635596fd4a08138e7bd0 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Sun, 26 Mar 2023 07:55:23 +1100 Subject: [PATCH 21/74] Update CHANGES.txt --- CHANGES.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 7ea3d09..2d49648 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,3 @@ -v1.2.26 -- Added -ff option to pvcreate to prevent issues. - v1.2.25 - Minor bug fix. From a943707d3eb20ee91019441b18021eb77bd0da04 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Sun, 26 Mar 2023 11:17:56 +1100 Subject: [PATCH 22/74] Update syno_hdd_db.sh --- syno_hdd_db.sh | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 5c027d0..8ebbec4 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -31,7 +31,8 @@ # DONE # Changed to show if no M.2 cards were found, if M.2 drives were found. # -# Changed latest version check to download to /tmp and extract files to the script's location. +# Changed latest version check to download to /tmp and extract files to the script's location, +# replacing the existing .sh and readme.txt files. # # Added a timeouts when checking for newer script version in case github is down or slow. # @@ -89,7 +90,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v1.2.25" +scriptver="v1.2.26" script=Synology_HDD_db repo="007revad/Synology_HDD_db" @@ -121,10 +122,10 @@ Options: -f, --force Force DSM to not check drive compatibility -r, --ram Disable memory compatibility checking -h, --help Show this help message - -v, --version Show the version + -v, --version Show the script version EOF -exit 0 + exit 0 } @@ -134,13 +135,13 @@ $script $scriptver - by 007revad See https://github.com/$repo EOF -exit 0 + exit 0 } # Check for flags with getopt if options="$(getopt -o abcdefghijklmnopqrstuvwxyz0123456789 -a \ - -l showedits,noupdate,m2,force,ram,help,version -- "$@")"; then + -l showedits,noupdate,m2,force,ram,help,version,debug -- "$@")"; then eval set -- "$options" while true; do case "${1,,}" in @@ -165,6 +166,9 @@ if options="$(getopt -o abcdefghijklmnopqrstuvwxyz0123456789 -a \ -v|--version) # Show script version scriptversion ;; + --debug) # Show and log debug info + debug=yes + ;; --) shift break @@ -201,14 +205,15 @@ model=$(cat /proc/sys/kernel/syno_hw_version) # Show script version +#echo -e "$script $scriptver\ngithub.com/$repo\n" echo "$script $scriptver" -#echo "github.com/$repo" -# Show NAS info +# Show DSM full version productversion=$(get_key_value /etc.defaults/VERSION productversion) buildphase=$(get_key_value /etc.defaults/VERSION buildphase) +buildnumber=$(get_key_value /etc.defaults/VERSION buildnumber) if [[ $buildphase == GM ]]; then buildphase=""; fi -echo "$model DSM $productversion $buildphase" +echo "$model DSM $productversion-$buildnumber $buildphase" # Convert model to lower case @@ -255,7 +260,7 @@ if ! printf "%s\n%s\n" "$tag" "$scriptver" | echo "https://github.com/$repo/releases/latest" sleep 10 else - echo -e "${Cyan}Do you want to download $tag now?${Off} {y/n]" + echo -e "${Cyan}Do you want to download $tag now?${Off} [y/n]" read -r -t 30 reply if [[ ${reply,,} == "y" ]]; then if cd /tmp; then @@ -267,19 +272,32 @@ if ! printf "%s\n%s\n" "$tag" "$scriptver" | else if [[ -f /tmp/$script-$shorttag.tar.gz ]]; then # Extract tar file to script location - if ! tar -xf "/tmp/$script-$shorttag.tar.gz" -C "$scriptpath"; + if ! tar -xf "/tmp/$script-$shorttag.tar.gz" -C "/tmp"; then echo -e "${Error}ERROR ${Off} Failed to"\ "extract $script-$shorttag.tar.gz!" else + # Copy new files to script location + cp "/tmp/$script-$shorttag/CHANGES.txt" "$scriptpath" + cp "/tmp/$script-$shorttag/"*.sh "$scriptpath" + + # Delete downloaded .tar.gz file if ! rm "/tmp/$script-$shorttag.tar.gz"; then + delerr=1 echo -e "${Error}ERROR ${Off} Failed to delete"\ - "downloaded $script-$shorttag.tar.gz!" - else + "download /tmp/$script-$shorttag.tar.gz!" + fi + # Delete extracted tmp files + if ! rm -r "/tmp/$script-$shorttag"; then + delerr=1 + echo -e "${Error}ERROR ${Off} Failed to delete"\ + "download /tmp/$script-$shorttag!" + fi + if [[ $delerr != 1 ]]; then echo -e "\n$tag and changes.txt downloaded to:"\ "$scriptpath" echo -e "${Cyan}Do you want to stop this script"\ - "so you can run the new one?${Off} {y/n]" + "so you can run the new one?${Off} [y/n]" read -r reply if [[ ${reply,,} == "y" ]]; then exit; fi fi From 2c0295bce6323384b31b43920d14fe9aed252a7c Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Sun, 26 Mar 2023 11:31:03 +1100 Subject: [PATCH 23/74] Update CHANGES.txt --- CHANGES.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 2d49648..76ae8d4 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,7 @@ +v1.2.26 +- Changed 'latest version check' to download and extract to /tmp then copy only the syno_hdd_db.sh and readme.txt files to the currrently running script's location. +- Minor tweaks to the shell output. + v1.2.25 - Minor bug fix. From bae39ac7bbb93b7dac7bc64e4c7b8911937da896 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Sun, 26 Mar 2023 11:38:39 +1100 Subject: [PATCH 24/74] Update CHANGES.txt --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 76ae8d4..7863959 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -v1.2.26 +v1.2.27 - Changed 'latest version check' to download and extract to /tmp then copy only the syno_hdd_db.sh and readme.txt files to the currrently running script's location. - Minor tweaks to the shell output. From b6b864a173c67c6e7dfc82f490e0c3bbe2b3a841 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Sun, 26 Mar 2023 11:39:00 +1100 Subject: [PATCH 25/74] Update syno_hdd_db.sh --- syno_hdd_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 8ebbec4..8282112 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -90,7 +90,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v1.2.26" +scriptver="v1.2.27" script=Synology_HDD_db repo="007revad/Synology_HDD_db" From 310846207480e9b7bd89ba4fe6057a4a55d4289f Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Mon, 27 Mar 2023 06:08:58 +1100 Subject: [PATCH 26/74] Update syno_hdd_db.sh Fixed bug in getting the M.2 card model. --- syno_hdd_db.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 8282112..88cc470 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -413,7 +413,7 @@ for d in /sys/block/*; do if [[ $m2 != "no" ]]; then getm2info "$d" "nvme" # Get M.2 card model if in M.2 card - getcardmodel "/dev/$d" + getcardmodel "/dev/$(basename -- "${d}")" fi fi ;; @@ -423,7 +423,7 @@ for d in /sys/block/*; do if [[ $m2 != "no" ]]; then getm2info "$d" "nvc" # Get M.2 card model if in M.2 card - getcardmodel "/dev/$d" + getcardmodel "/dev/$(basename -- "${d}")" fi fi ;; From d0924ca152488f33831241e3292cfc4283676cee Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Mon, 27 Mar 2023 06:10:19 +1100 Subject: [PATCH 27/74] Update CHANGES.txt --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 7863959..5394a52 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +v1.2.28 +- Fixed bug in getting the M.2 card model. + v1.2.27 - Changed 'latest version check' to download and extract to /tmp then copy only the syno_hdd_db.sh and readme.txt files to the currrently running script's location. - Minor tweaks to the shell output. From ab8db7450ac8c51db2fc141057276a3bf14fdb11 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:42:48 +1100 Subject: [PATCH 28/74] Update syno_hdd_db.sh v1.2.28 had v1.2.27 in .sh file --- syno_hdd_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 88cc470..e434ba8 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -90,7 +90,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v1.2.27" +scriptver="v1.2.29" script=Synology_HDD_db repo="007revad/Synology_HDD_db" From cdef297b235a0f3e3e334ae10ffb61c990a743eb Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:44:50 +1100 Subject: [PATCH 29/74] Update CHANGES.txt --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 5394a52..1b84ad5 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +v1.2.29 +- Bug fix. v1.2.28 had v1.2.27 in the sh file so it always wanted to update! + v1.2.28 - Fixed bug in getting the M.2 card model. From 76683103f465d2504f5be41e78b2190fbc3a4be4 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Mon, 27 Mar 2023 13:00:22 +1100 Subject: [PATCH 30/74] Update syno_hdd_db.sh Fixed "download new version" failing if script was run via symlink or ./ --- syno_hdd_db.sh | 69 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 57 insertions(+), 12 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index e434ba8..24d9cf0 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -29,6 +29,8 @@ # It's also parsed and checked and probably in some cases it could be more critical to patch that one instead. # DONE +# Fixed "download new version" failing if script was run via symlink or ./ +# # Changed to show if no M.2 cards were found, if M.2 drives were found. # # Changed latest version check to download to /tmp and extract files to the script's location, @@ -90,7 +92,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v1.2.29" +scriptver="v1.2.30" script=Synology_HDD_db repo="007revad/Synology_HDD_db" @@ -166,7 +168,7 @@ if options="$(getopt -o abcdefghijklmnopqrstuvwxyz0123456789 -a \ -v|--version) # Show script version scriptversion ;; - --debug) # Show and log debug info + -d|--debug) # Show and log debug info debug=yes ;; --) @@ -245,7 +247,20 @@ get_latest_release() { tag=$(get_latest_release "$repo") shorttag="${tag:1}" -scriptpath=$(dirname -- "$0") +#scriptpath=$(dirname -- "$0") + +# Get script location +source=${BASH_SOURCE[0]} +while [ -L "$source" ]; do # Resolve $source until the file is no longer a symlink + scriptpath=$( cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd ) + source=$(readlink "$source") + # If $source was a relative symlink, we need to resolve it + # relative to the path where the symlink file was located + [[ $source != /* ]] && source=$scriptpath/$source +done +scriptpath=$( cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd ) +#echo "Script location: $scriptpath" # debug + if ! printf "%s\n%s\n" "$tag" "$scriptver" | sort --check --version-sort &> /dev/null ; then @@ -271,29 +286,55 @@ if ! printf "%s\n%s\n" "$tag" "$scriptver" | "$script-$shorttag.tar.gz!" else if [[ -f /tmp/$script-$shorttag.tar.gz ]]; then - # Extract tar file to script location - if ! tar -xf "/tmp/$script-$shorttag.tar.gz" -C "/tmp"; - then + # Extract tar file to /tmp/ + if ! tar -xf "/tmp/$script-$shorttag.tar.gz" -C "/tmp"; then echo -e "${Error}ERROR ${Off} Failed to"\ "extract $script-$shorttag.tar.gz!" else - # Copy new files to script location - cp "/tmp/$script-$shorttag/CHANGES.txt" "$scriptpath" - cp "/tmp/$script-$shorttag/"*.sh "$scriptpath" + # Copy new script sh files to script location + if ! cp -p "/tmp/$script-$shorttag/"*.sh "$scriptpath"; then + copyerr=1 + echo -e "${Error}ERROR ${Off} Failed to copy"\ + "$script-$shorttag .sh file(s) to:\n $scriptpath" + else + # Set permsissions on CHANGES.txt + if ! chmod 744 "$scriptpath/"*.sh ; then + permerr=1 + echo -e "${Error}ERROR ${Off} Failed to set permissions on:" + echo "$scriptpath *.sh file(s)" + fi + fi + + # Copy new CHANGES.txt file to script location + if ! cp -p "/tmp/$script-$shorttag/CHANGES.txt" "$scriptpath"; then + copyerr=1 + echo -e "${Error}ERROR ${Off} Failed to copy"\ + "$script-$shorttag/CHANGES.txt to:\n $scriptpath" + else + # Set permsissions on CHANGES.txt + if ! chmod 744 "$scriptpath/CHANGES.txt"; then + permerr=1 + echo -e "${Error}ERROR ${Off} Failed to set permissions on:" + echo "$scriptpath/CHANGES.txt" + fi + fi # Delete downloaded .tar.gz file if ! rm "/tmp/$script-$shorttag.tar.gz"; then delerr=1 echo -e "${Error}ERROR ${Off} Failed to delete"\ - "download /tmp/$script-$shorttag.tar.gz!" + "downloaded /tmp/$script-$shorttag.tar.gz!" fi + # Delete extracted tmp files if ! rm -r "/tmp/$script-$shorttag"; then delerr=1 echo -e "${Error}ERROR ${Off} Failed to delete"\ - "download /tmp/$script-$shorttag!" + "downloaded /tmp/$script-$shorttag!" fi - if [[ $delerr != 1 ]]; then + + # Notify of success (if there were no errors) + if [[ $copyerr != 1 ]] && [[ $permerr != 1 ]]; then echo -e "\n$tag and changes.txt downloaded to:"\ "$scriptpath" echo -e "${Cyan}Do you want to stop this script"\ @@ -344,6 +385,7 @@ fixdrivemodel(){ getdriveinfo() { # Skip removable drives (USB drives) + # $1 is /sys/block/sata1 etc removable=$(cat "$1/removable") # Some DSM 7 RS models return 1 for internal drives! if [[ $removable == "0" ]] || [[ $dsm -gt "6" ]]; then # Get drive model and firmware version @@ -363,6 +405,7 @@ getdriveinfo() { } getm2info() { + # $1 is /sys/block/nvme0n1 etc nvmemodel=$(cat "$1/device/model") nvmemodel=$(printf "%s" "$nvmemodel" | xargs) # trim leading and trailing white space if [[ $2 == "nvme" ]]; then @@ -379,6 +422,7 @@ getm2info() { getcardmodel() { # Get M.2 card model (if M.2 drives found) + # $1 is /dev/nvme0n1 etc if [[ ${#nvmelist[@]} -gt "0" ]]; then cardmodel=$(synodisk --m2-card-model-get "$1") if [[ $cardmodel =~ M2D[0-9][0-9] ]]; then @@ -395,6 +439,7 @@ getcardmodel() { for d in /sys/block/*; do + # $d is /sys/block/sata1 etc case "$(basename -- "${d}")" in sd*|hd*) if [[ $d =~ [hs]d[a-z][a-z]?$ ]]; then From 5b9296868bab347b4cdb8e8f8dc1894f02121b0e Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Mon, 27 Mar 2023 13:01:12 +1100 Subject: [PATCH 31/74] Update CHANGES.txt --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 1b84ad5..069f4c5 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +v1.2.30 +- Fixed "download new version" failing if script was run via symlink or ./ + v1.2.29 - Bug fix. v1.2.28 had v1.2.27 in the sh file so it always wanted to update! From f005e5371ce1f01d60c71805f22bcad101fb4545 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:11:56 +1100 Subject: [PATCH 32/74] Add files via upload --- images/ram_warning.png | Bin 0 -> 9041 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 images/ram_warning.png diff --git a/images/ram_warning.png b/images/ram_warning.png new file mode 100644 index 0000000000000000000000000000000000000000..49781773af231260847bfb15203d07eeb0cd85b2 GIT binary patch literal 9041 zcmbt)XH=6xxF!k+h|&c$kWiE&O++cuG!U@Ri`0M`0Tl=Y0#bt@N+)8W7-~>J1!9z9 zLQ^S0dISRqp#>rI5^5l@@t*y&dv^ESd-umz=FFLycfR@F=Y8gxH__VC?D)~sM>#k+ zj$glKV#~pC2+DpR;jkfRg0?}9C$SU-W_gsnJ?g) za}WoIK-0hL5Xryv9tVf)^mUV~_Mz^Jxji341{_Ga>qbH*LJG1veRw%NTSXmS9mLc% z#k5$R*>6IO(bC`R5s&HLc8 zH?FF|dwCFgV zOpEBh?qB?KDiwS4U**OBXQd1g6us6rJ6&W|e85^I#R-8Wxw?-1nXQ5#jTNSz3xThJ za4Txq4uG0W+=9aWQj$0sV#zBLx4n82k|_i}GNF;gt~vGtCI$ubo{A$W661s}@S<&y zd@}chfJJl>aGSKgDfw*N^Q)mL*qgjEPgedj4fV?D`zzGh>GFYMO!UqqlCc%7Lyi0^ z_^W3nTupG}6G$d*1gsx&nq0qgpSXjI&V}#KqDwHDs0d=%gkuRteUIH{C*R7bY2F$* zHxp85ux`vNQ^Si+m7q$0J=j6_b&at`k&Kx}ed^xN9=Pb7aV^2%X{J!%@akXyyVvDt z3>>%*Cz53gf5(LsvPJ}V$W$C6r;me44+EgR@!%*?{^t)fO|>a2pt4r|+Ppk*_t zu@}UojxP@6ndgU3^E~qg(KaK(Sa&vAKX&_u3-)tV@X|mO$8JuZUZ{Qkd%6mr*q>?tEL|nGOJz;iSA)h@n zj>ltnd-C()4cp4r_O)05vx}AP(L~$&yi(x0sKO!Wjfk9K&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$i7n&{BU3O$U+(q$ZwV0lSsc ziPHqrVE>A1l;7JKPZa5WrN>EN-T{K2IrQ+?(`f45lBF3sTRS zEas=panMRR;svGjd%nkfYf{~PBuEt6d);frpPV9!Xg-vJX!Ee?`<@X?e46FmmYgQK zotfi~6ztAl>+=xJiGGP`FIm9NWVq8d%wg{~@Ihx!qM;_pms!7Sy6qcLc@K>|Qo+#O zHjqRa?NxNxr?bSCc;aF={w)H0%=UJ0H0R|=e3{|i14ada#W8VspLXb@V2E##;Jm)+ zgO}0Jr#ue)CU9klzGSD!6Yb4jGd}5dhf{)odz-Dh$Wx(yMN!=3>#OHL4*96;!(C?s z?(e?>eUWb&vpuqg3o48ZH*svO6`^I5UJ|Zp_-+uELl-V!0SP}aaTjkNJbul5#a!$8 zRUOrNm-#igue?3Okl+FLh>LoM=s4~x)!>w;wLmFex240ysven)2KhCKLB<%aw( gi6dH=;sYN3htQ+pjqY#RX)qkuA(kc;;M=kP0|Zj&h5!Hn literal 0 HcmV?d00001 From bf4f26bbdd00e9a3a11bb5e44ca7d528b16366b0 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:12:27 +1100 Subject: [PATCH 33/74] Delete ram_wanring.png --- images/ram_wanring.png | Bin 9041 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 images/ram_wanring.png diff --git a/images/ram_wanring.png b/images/ram_wanring.png deleted file mode 100644 index 49781773af231260847bfb15203d07eeb0cd85b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9041 zcmbt)XH=6xxF!k+h|&c$kWiE&O++cuG!U@Ri`0M`0Tl=Y0#bt@N+)8W7-~>J1!9z9 zLQ^S0dISRqp#>rI5^5l@@t*y&dv^ESd-umz=FFLycfR@F=Y8gxH__VC?D)~sM>#k+ zj$glKV#~pC2+DpR;jkfRg0?}9C$SU-W_gsnJ?g) za}WoIK-0hL5Xryv9tVf)^mUV~_M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LmFex240ysven)2KhCKLB<%aw( gi6dH=;sYN3htQ+pjqY#RX)qkuA(kc;;M=kP0|Zj&h5!Hn From 4fdc905bb72e45b3e63434ac222f960549bd6e93 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 30 Mar 2023 05:51:13 +1100 Subject: [PATCH 34/74] Update syno_hdd_db.sh --- syno_hdd_db.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 24d9cf0..77f53fb 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -143,14 +143,14 @@ EOF # Check for flags with getopt if options="$(getopt -o abcdefghijklmnopqrstuvwxyz0123456789 -a \ - -l showedits,noupdate,m2,force,ram,help,version,debug -- "$@")"; then + -l showedits,noupdate,nodbupdate,m2,force,ram,help,version,debug -- "$@")"; then eval set -- "$options" while true; do case "${1,,}" in -s|--showedits) # Show edits done to host db file showedits=yes ;; - -n|--nodbupdate) # Disable disk compatibility db updates + -n|--nodbupdate|--noupdate) # Disable disk compatibility db updates nodbupdate=yes ;; -m|--m2) # Don't add M.2 drives to db files From 072c01326934892bbe58c796e1bc96894e8a0de2 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 30 Mar 2023 05:51:27 +1100 Subject: [PATCH 35/74] Update syno_hdd_db.sh --- syno_hdd_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 77f53fb..7d004d0 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -92,7 +92,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v1.2.30" +scriptver="v1.2.31" script=Synology_HDD_db repo="007revad/Synology_HDD_db" From 5c2256ffabd43b76f911fbf46f4be1f1cd0ce58f Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 30 Mar 2023 05:52:56 +1100 Subject: [PATCH 36/74] Update CHANGES.txt --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 069f4c5..2194683 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +v1.2.31 +- Bug fix. The --noupdate option was coded as --nodbupdate. Now either will work. + v1.2.30 - Fixed "download new version" failing if script was run via symlink or ./ From e67aa1657ba84132cebfa8b3cab65868c82d5f82 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 30 Mar 2023 19:03:43 +1100 Subject: [PATCH 37/74] Update syno_hdd_db.sh Fixed bug in re-enable drive db updates --- syno_hdd_db.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 7d004d0..a168df4 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -29,6 +29,8 @@ # It's also parsed and checked and probably in some cases it could be more critical to patch that one instead. # DONE +# Fixed bug in re-enable drive db updates +# # Fixed "download new version" failing if script was run via symlink or ./ # # Changed to show if no M.2 cards were found, if M.2 drives were found. @@ -250,6 +252,7 @@ shorttag="${tag:1}" #scriptpath=$(dirname -- "$0") # Get script location +# https://stackoverflow.com/questions/59895/ source=${BASH_SOURCE[0]} while [ -L "$source" ]; do # Resolve $source until the file is no longer a symlink scriptpath=$( cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd ) @@ -871,18 +874,23 @@ if [[ $nodbupdate == "yes" ]]; then else echo -e "\n${Error}ERROR${Off} Failed to disable drive db auto updates!" fi + else + echo -e "\nDrive db auto updates already disabled." fi else # Re-enable drive db updates - if [[ $url == "127.0.0.1" ]]; then - # Edit drive_db_test_url= - sed -z "s/drive_db_test_url=\"127\.0\.0\.1\"\n//" "$synoinfo" >/dev/null - #sed -i "s/drive_db_test_url=\"127\.0\.0\.1\"//" "$synoinfo" # works but leaves line feed + #if [[ $url == "127.0.0.1" ]]; then + if [[ $url ]]; then + # Delete "drive_db_test_url=127.0.0.1" line (inc. line break) + #sed -i "/drive_db_test_url=\"127.0.0.1\"/d" "/etc.defaults/synoinfo.conf" + sed -i "/drive_db_test_url=*/d" "/etc.defaults/synoinfo.conf" # Check if we re-enabled drive db auto updates url="$(get_key_value $synoinfo drive_db_test_url)" if [[ $url != "127.0.0.1" ]]; then echo -e "\nRe-enabled drive db auto updates." + else + echo -e "\n${Error}ERROR${Off} Failed to enable drive db auto updates!" fi else echo -e "\nDrive db auto updates already enabled." From 55b55807bf977124e4ebc6014e635733660e9f0f Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 30 Mar 2023 19:04:51 +1100 Subject: [PATCH 38/74] Update CHANGES.txt --- CHANGES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.txt b/CHANGES.txt index 2194683..5eb71cd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,6 @@ v1.2.31 - Bug fix. The --noupdate option was coded as --nodbupdate. Now either will work. +- Bug fix. Re-enable drive db updates wasn't working in some instances. v1.2.30 - Fixed "download new version" failing if script was run via symlink or ./ From c51ad0942a9deb11a5530e0bf2fd32f1bd6c18e9 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Tue, 4 Apr 2023 14:15:24 +1000 Subject: [PATCH 39/74] Update CHANGES.txt --- CHANGES.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 5eb71cd..fb15a7a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,9 @@ +v1.3.32 +- Changed to add drives' firmware version to the db files (to support data deduplication). + - See https://github.com/007revad/Synology_enable_Deduplication +- Changed to be able to edit existing drive entries in the db files to add the firmware version. +- Now supports editing db files that don't currently have any drives listed. + v1.2.31 - Bug fix. The --noupdate option was coded as --nodbupdate. Now either will work. - Bug fix. Re-enable drive db updates wasn't working in some instances. From 81fef1b6bb32d46e01517f810dd289906e1f2917 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Tue, 4 Apr 2023 14:21:48 +1000 Subject: [PATCH 40/74] Update syno_hdd_db.sh - Changed to add drives' firmware version to the db files (to support data deduplication). - See https://github.com/007revad/Synology_enable_Deduplication - Changed to be able to edit existing drive entries in the db files to add the firmware version. - Now supports editing db files that don't currently have any drives listed. --- syno_hdd_db.sh | 88 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 72 insertions(+), 16 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index a168df4..33c7363 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -29,6 +29,15 @@ # It's also parsed and checked and probably in some cases it could be more critical to patch that one instead. # DONE +# Changed to add drives' firmware version to the db files (to support data deduplication). +# See https://github.com/007revad/Synology_enable_Deduplication +# +# Changed to be able to edit existing drive entries in the db files to add the firmware version. +# +# Now supports editing db files that don't currently have any drives listed. +# +# Fixed bug where the --noupdate option was coded as --nodbupdate. Now either will work. +# # Fixed bug in re-enable drive db updates # # Fixed "download new version" failing if script was run via symlink or ./ @@ -94,7 +103,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v1.2.31" +scriptver="v1.3.32" script=Synology_HDD_db repo="007revad/Synology_HDD_db" @@ -212,12 +221,16 @@ model=$(cat /proc/sys/kernel/syno_hw_version) #echo -e "$script $scriptver\ngithub.com/$repo\n" echo "$script $scriptver" -# Show DSM full version +# Get DSM full version productversion=$(get_key_value /etc.defaults/VERSION productversion) buildphase=$(get_key_value /etc.defaults/VERSION buildphase) buildnumber=$(get_key_value /etc.defaults/VERSION buildnumber) +smallfixnumber=$(get_key_value /etc.defaults/VERSION smallfixnumber) + +# Show DSM full version and model if [[ $buildphase == GM ]]; then buildphase=""; fi -echo "$model DSM $productversion-$buildnumber $buildphase" +if [[ $smallfixnumber -gt "0" ]]; then smallfix="-$smallfixnumber"; fi +echo -e "$model DSM $productversion-$buildnumber$smallfix $buildphase\n" # Convert model to lower case @@ -640,6 +653,48 @@ backupdb "$db1" || exit 5 #------------------------------------------------------------------------------ # Edit db files +editcount(){ + # Count drives added to host db files + if [[ $1 == "$db1" ]]; then + db1Edits=$((db1Edits +1)) + elif [[ $1 == "$db2" ]]; then + db2Edits=$((db2Edits +1)) + fi +} + + +editdb7(){ + if [[ $1 == "append" ]]; then # model not in db file + if sed -i "s/}}}/}},\"$hdmodel\":{$fwstrng$default/" "$2"; then # append + echo -e "Added ${Yellow}$hdmodel${Off} to ${Cyan}$(basename -- "$2")${Off}" + editcount "$2" + else + echo -e "\n${Error}ERROR 6a${Off} Failed to update $(basename -- "$2")${Off}" + #exit 6 + fi + + elif [[ $1 == "insert" ]]; then # model and default exists + if sed -i "s/\"$hdmodel\":{/\"$hdmodel\":{$fwstrng/" "$2"; then # insert firmware + echo -e "Updated ${Yellow}$hdmodel${Off} to ${Cyan}$(basename -- "$2")${Off}" + #editcount "$2" + else + echo -e "\n${Error}ERROR 6b${Off} Failed to update $(basename -- "$2")${Off}" + #exit 6 + fi + + elif [[ $1 == "empty" ]]; then # db file only contains {} + if sed -i "s/{}/{\"$hdmodel\":{$fwstrng${default}}/" "$2"; then # empty + echo -e "Added ${Yellow}$hdmodel${Off} to ${Cyan}$(basename -- "$2")${Off}" + editcount "$2" + else + echo -e "\n${Error}ERROR 6c${Off} Failed to update $(basename -- "$2")${Off}" + #exit 6 + fi + + fi +} + + updatedb() { hdmodel=$(printf "%s" "$1" | cut -d"," -f 1) fwrev=$(printf "%s" "$1" | cut -d"," -f 2) @@ -649,13 +704,13 @@ updatedb() { #echo hdmodel "$hdmodel" >&2 # debug #echo fwrev "$fwrev" >&2 # debug - if grep "$hdmodel" "$2" >/dev/null; then + if grep "$hdmodel"'":{"'"$fwrev" "$2" >/dev/null; then echo -e "${Yellow}$hdmodel${Off} already exists in ${Cyan}$(basename -- "$2")${Off}" >&2 else # Check if db file is new or old style getdbtype "$2" - if [[ $dbtype -gt "6" ]];then + if [[ $dbtype -gt "6" ]]; then # Don't need to add firmware version? fwstrng=\"$fwrev\" fwstrng="$fwstrng":{\"compatibility_interval\":[{\"compatibility\":\"support\",\"not_yet_rolling_status\" @@ -665,21 +720,22 @@ updatedb() { default="$default":{\"compatibility_interval\":[{\"compatibility\":\"support\",\"not_yet_rolling_status\" default="$default":\"support\",\"fw_dsm_update_status_notify\":false,\"barebone_installable\":true}]}}} - #if sed -i "s/}}}/}},\"$hdmodel\":{$fwstrng$default/" "$2"; then # Don't need to add firmware version? - if sed -i "s/}}}/}},\"$hdmodel\":{$default/" "$2"; then - echo -e "Added ${Yellow}$hdmodel${Off} to ${Cyan}$(basename -- "$2")${Off}" + if grep '"disk_compatbility_info":{}' "$2" >/dev/null; then + # Replace "disk_compatbility_info":{} with "disk_compatbility_info":{"WD40PURX-64GVNY0":{"80.00A80":{ ... }}},"default":{ ... }}}} + echo "Edit empty db file" + editdb7 "empty" "$2" - # Count drives added to host db files - if [[ $2 == "$db1" ]]; then - db1Edits=$((db1Edits +1)) - elif [[ $2 == "$db2" ]]; then - db2Edits=$((db2Edits +1)) - fi + elif grep '"WD40PURX-64GVNY0"' "$2" >/dev/null; then + # Replace "WD40PURX-64GVNY0":{ with "WD40PURX-64GVNY0":{"80.00A80":{ ... }}}, + echo "Insert firmware version" + editdb7 "insert" "$2" else - echo -e "\n${Error}ERROR 6${Off} Failed to update v7 $(basename -- "$2")${Off}" - exit 6 + # Add "WD40PURX-64GVNY0":{"80.00A80":{ ... }}},"default":{ ... }}} + echo "Append drive and firmware" + editdb7 "append" "$2" fi + elif [[ $dbtype -eq "6" ]];then # example: # {"model":"WD60EFRX-68MYMN1","firmware":"82.00A82","rec_intvl":[1]}, From bcbe11b3bd6c10dacb63e9354b9a1e5195e12f49 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Tue, 4 Apr 2023 14:53:35 +1000 Subject: [PATCH 41/74] Update syno_hdd_db.sh --- syno_hdd_db.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 33c7363..992338e 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -230,7 +230,7 @@ smallfixnumber=$(get_key_value /etc.defaults/VERSION smallfixnumber) # Show DSM full version and model if [[ $buildphase == GM ]]; then buildphase=""; fi if [[ $smallfixnumber -gt "0" ]]; then smallfix="-$smallfixnumber"; fi -echo -e "$model DSM $productversion-$buildnumber$smallfix $buildphase\n" +echo "$model DSM $productversion-$buildnumber$smallfix $buildphase" # Convert model to lower case @@ -239,13 +239,13 @@ model=${model,,} # Check for dodgy characters after model number if [[ $model =~ 'pv10-j'$ ]]; then # GitHub issue #10 model=${model%??????}+ # replace last 6 chars with + - echo "Using model: $model" + echo -e "\nUsing model: $model" elif [[ $model =~ '-j'$ ]]; then # GitHub issue #2 model=${model%??} # remove last 2 chars - echo "Using model: $model" + echo -e "\nUsing model: $model" fi -echo "" # To keep output readable +#echo "" # To keep output readable #------------------------------------------------------------------------------ @@ -280,7 +280,7 @@ scriptpath=$( cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd ) if ! printf "%s\n%s\n" "$tag" "$scriptver" | sort --check --version-sort &> /dev/null ; then - echo -e "${Cyan}There is a newer version of this script available.${Off}" + echo -e "\n${Cyan}There is a newer version of this script available.${Off}" echo -e "Current version: ${scriptver}\nLatest version: $tag" if [[ -f $scriptpath/$script-$shorttag.tar.gz ]]; then # They have the latest version tar.gz downloaded but are using older version @@ -501,9 +501,9 @@ fi # Check hdds array isn't empty if [[ ${#hdds[@]} -eq "0" ]]; then - echo -e "${Error}ERROR${Off} No drives found!" && exit 2 + echo -e "\n${Error}ERROR${Off} No drives found!" && exit 2 else - echo "HDD/SSD models found: ${#hdds[@]}" + echo -e "\nHDD/SSD models found: ${#hdds[@]}" num="0" while [[ $num -lt "${#hdds[@]}" ]]; do echo "${hdds[num]}" @@ -962,7 +962,8 @@ if [[ ${showedits,,} == "yes" ]]; then getdbtype "$db1" if [[ $dbtype -gt "6" ]];then # Show last 12 lines per drive + 4 - lines=$(((db1Edits *12) +4)) + #lines=$(((db1Edits *12) +4)) # without firmware version + lines=$(((db1Edits *21) +4)) # with firmware version if [[ $db1Edits -gt "0" ]]; then echo -e "\nChanges to ${Cyan}$(basename -- "$db1")${Off}" jq . "$db1" | tail -n "$lines" From 72484f8b99a03caf1edf5975205510e6f3982555 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Tue, 4 Apr 2023 14:55:16 +1000 Subject: [PATCH 42/74] Update README.md --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 094313e..0f080d4 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,6 @@ #### What the script does: * Checks if there is a newer version of this script and offers to download it for you. * The new version available messages time out so they don't prevent the script running if it is scheduled to run unattended. -**Planned updates:** -* Allow unsupported M.2 drives for use as volumes in DSM 7.2 (for models that supported M.2 volumes). - ### Download the script See How to download the script for the easiest way to download the script. From a5148a1e3fa547a67e4be4d2de708ee44c07cfbf Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Wed, 5 Apr 2023 12:09:36 +1000 Subject: [PATCH 43/74] Update syno_hdd_db.sh - Fixed bug inserting firmware version for already existing model. --- syno_hdd_db.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 992338e..07ccaf6 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -29,6 +29,8 @@ # It's also parsed and checked and probably in some cases it could be more critical to patch that one instead. # DONE +# Fixed bug inserting firmware version for already existing model. +# # Changed to add drives' firmware version to the db files (to support data deduplication). # See https://github.com/007revad/Synology_enable_Deduplication # @@ -103,7 +105,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v1.3.32" +scriptver="v1.3.33" script=Synology_HDD_db repo="007revad/Synology_HDD_db" @@ -725,7 +727,7 @@ updatedb() { echo "Edit empty db file" editdb7 "empty" "$2" - elif grep '"WD40PURX-64GVNY0"' "$2" >/dev/null; then + elif grep '"'"$hdmodel"'":' "$2" >/dev/null; then # Replace "WD40PURX-64GVNY0":{ with "WD40PURX-64GVNY0":{"80.00A80":{ ... }}}, echo "Insert firmware version" editdb7 "insert" "$2" From ae0997540c6b7ad630222461eba8b9a1a9a5e098 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Wed, 5 Apr 2023 12:10:06 +1000 Subject: [PATCH 44/74] Update CHANGES.txt - Fixed bug inserting firmware version for already existing model. --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index fb15a7a..d6f4708 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +v1.3.33 +- Fixed bug inserting firmware version for already existing model. + v1.3.32 - Changed to add drives' firmware version to the db files (to support data deduplication). - See https://github.com/007revad/Synology_enable_Deduplication From 12ff74216303defcf7b446be4e2778f172ba5864 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 6 Apr 2023 14:22:20 +1000 Subject: [PATCH 45/74] Update syno_hdd_db.sh - Now always shows your drive entries in the host db file if -s or --showedits used instead of only db file was edited during that run. - Changed to show usage if invalid long option used instead of continuing. --- syno_hdd_db.sh | 61 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 07ccaf6..091cdce 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -23,12 +23,18 @@ #-------------------------------------------------------------------------------------------------- # TODO -# Bypass M.2 volume lock for unsupported M.2 drives. +# Bypass M.2 volume lock for unsupported M.2 drives. +# See https://github.com/007revad/Synology_enable_M2_volume # # Maybe also edit the other disk compatibility db in synoboot, used during boot time. # It's also parsed and checked and probably in some cases it could be more critical to patch that one instead. # DONE +# Now always shows your drive entries in the host db file if -s or --showedits used, +# instead of only db file was edited during that run. +# +# Changed to show usage if invalid long option used instead of continuing. +# # Fixed bug inserting firmware version for already existing model. # # Changed to add drives' firmware version to the db files (to support data deduplication). @@ -105,7 +111,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v1.3.33" +scriptver="v1.3.34" script=Synology_HDD_db repo="007revad/Synology_HDD_db" @@ -189,12 +195,15 @@ if options="$(getopt -o abcdefghijklmnopqrstuvwxyz0123456789 -a \ break ;; *) # Show usage options - echo "Invalid option '$1'" + echo -e "Invalid option '$1'\n" usage "$1" ;; esac shift done +else + echo + usage fi @@ -963,27 +972,35 @@ fi if [[ ${showedits,,} == "yes" ]]; then getdbtype "$db1" if [[ $dbtype -gt "6" ]];then - # Show last 12 lines per drive + 4 - #lines=$(((db1Edits *12) +4)) # without firmware version - lines=$(((db1Edits *21) +4)) # with firmware version - if [[ $db1Edits -gt "0" ]]; then - echo -e "\nChanges to ${Cyan}$(basename -- "$db1")${Off}" - jq . "$db1" | tail -n "$lines" - elif [[ $db2Edits -gt "0" ]]; then - echo -e "\nChanges to ${Cyan}$(basename -- "$db2")${Off}" - jq . "$db2" | tail -n "$lines" - fi + # Show 11 lines after hdmodel line + lines=11 elif [[ $dbtype -eq "6" ]];then - # Show first 8 lines per drive + 2 - lines=$(((db1Edits *8) +2)) - if [[ $db1Edits -gt "0" ]]; then - echo -e "\nChanges to ${Cyan}$(basename -- "$db1")${Off}" - jq . "$db1" | head -n "$lines" - elif [[ $db2Edits -gt "0" ]]; then - echo -e "\nChanges to ${Cyan}$(basename -- "$db2")${Off}" - jq . "$db2" | head -n "$lines" - fi + # Show 2 lines after hdmodel line + lines=2 + fi + + # HDDs/SSDs + if [[ ${#hdds[@]} -gt "0" ]]; then + num="0" + while [[ $num -lt "${#hdds[@]}" ]]; do + hdmodel=$(printf "%s" "${hdds[$num]}" | cut -d"," -f 1) + echo + jq . "$db1" | grep -A "$lines" "$hdmodel" + num=$((num +1)) + done fi + + # NVMe drives + if [[ ${#nvmes[@]} -gt "0" ]]; then + num="0" + while [[ $num -lt "${#nvmes[@]}" ]]; do + nvmemodel=$(printf "%s" "${nvmes[$num]}" | cut -d"," -f 1) + echo + jq . "$db1" | grep -A "$lines" "$nvmemodel" + num=$((num +1)) + done + fi + fi From dfdf34935759afc770cf2656b50ab2d95beee6b6 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 6 Apr 2023 14:24:04 +1000 Subject: [PATCH 46/74] Update CHANGES.txt --- CHANGES.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index d6f4708..cd06f9e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,7 @@ +v1.3.34 +- Now always shows your drive entries in the host db file if -s or --showedits used instead of only db file was edited during that run. +- Changed to show usage if invalid long option used instead of continuing. + v1.3.33 - Fixed bug inserting firmware version for already existing model. From fad6f747789304b15f593293ae143da5e9e48d66 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 6 Apr 2023 14:25:15 +1000 Subject: [PATCH 47/74] Update CHANGES.txt --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index cd06f9e..7205c2a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -v1.3.34 +v1.3.34 - Now always shows your drive entries in the host db file if -s or --showedits used instead of only db file was edited during that run. - Changed to show usage if invalid long option used instead of continuing. From f1206aedb404c17a4a5e71600da1fba4f762d5b7 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 6 Apr 2023 14:25:22 +1000 Subject: [PATCH 48/74] Update CHANGES.txt --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 7205c2a..cd06f9e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -v1.3.34 +v1.3.34 - Now always shows your drive entries in the host db file if -s or --showedits used instead of only db file was edited during that run. - Changed to show usage if invalid long option used instead of continuing. From 64b19a910ff7b8ad0799c877ae95a7a5c47bd1ec Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 6 Apr 2023 20:38:10 +1000 Subject: [PATCH 49/74] Update CHANGES.txt --- CHANGES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.txt b/CHANGES.txt index cd06f9e..4822502 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,4 @@ + v1.3.34 - Now always shows your drive entries in the host db file if -s or --showedits used instead of only db file was edited during that run. - Changed to show usage if invalid long option used instead of continuing. From 7ee154e858d9afc4cd12bc6c8f97db4bb5f486b0 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 6 Apr 2023 20:40:03 +1000 Subject: [PATCH 50/74] Update CHANGES.txt --- CHANGES.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 4822502..cd06f9e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,3 @@ - v1.3.34 - Now always shows your drive entries in the host db file if -s or --showedits used instead of only db file was edited during that run. - Changed to show usage if invalid long option used instead of continuing. From 362cdcd53405d9df6e32fbea07b38cfcf5ddaf97 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Sat, 8 Apr 2023 17:26:03 +1000 Subject: [PATCH 51/74] Update syno_hdd_db.sh - Now allows creating M.2 storage pool and volume all from Storage Manager --- syno_hdd_db.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 091cdce..69f1ac5 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -30,6 +30,8 @@ # It's also parsed and checked and probably in some cases it could be more critical to patch that one instead. # DONE +# Now allows creating M.2 storage pool and volume all from Storage Manager +# # Now always shows your drive entries in the host db file if -s or --showedits used, # instead of only db file was edited during that run. # @@ -111,7 +113,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v1.3.34" +scriptver="v2.0.35" script=Synology_HDD_db repo="007revad/Synology_HDD_db" @@ -486,6 +488,9 @@ for d in /sys/block/*; do getm2info "$d" "nvme" # Get M.2 card model if in M.2 card getcardmodel "/dev/$(basename -- "${d}")" + + # Enable creating M.2 storage pool and volume in Storage Manager + echo 1 > /run/synostorage/disks/$(basename -- "$d")/m2_pool_support fi fi ;; @@ -496,6 +501,9 @@ for d in /sys/block/*; do getm2info "$d" "nvc" # Get M.2 card model if in M.2 card getcardmodel "/dev/$(basename -- "${d}")" + + # Enable creating M.2 storage pool and volume in Storage Manager + echo 1 > /run/synostorage/disks/$(basename -- "$d")/m2_pool_support fi fi ;; From aa944b7a659a0013bcac24e91f781e8023e8f041 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Sat, 8 Apr 2023 17:28:07 +1000 Subject: [PATCH 52/74] Update CHANGES.txt - Now allows creating M.2 storage pool and volume all from Storage Manager --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index cd06f9e..cc2ef45 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +v2.0.35 +- Now allows creating M.2 storage pool and volume all from Storage Manager + v1.3.34 - Now always shows your drive entries in the host db file if -s or --showedits used instead of only db file was edited during that run. - Changed to show usage if invalid long option used instead of continuing. From f5062ea9da0c840266f8ee30f9e4d399197f6550 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Sat, 8 Apr 2023 17:48:30 +1000 Subject: [PATCH 53/74] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0f080d4..6d5af1d 100644 --- a/README.md +++ b/README.md @@ -81,3 +81,4 @@ ### Running the script via SSH - 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. +- Thanks to nicolerenee for pointing out the easiest way to enable creating M.2 storage pools and volumes in Storage Manager. From e3dc26b2dce9570ca213e525b4b897263e4464da Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Sat, 8 Apr 2023 17:51:15 +1000 Subject: [PATCH 54/74] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d5af1d..491ad33 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,8 @@ #### What the script does: * Prevents DSM auto updating the drive database. * Optionally disable DSM's "support_disk_compatibility". * Optionally disable DSM's "support_memory_compatibility" to prevent non-Synology memory notifications. -* Checks that M.2 volume support is enabled (on supported models). +* Checks that M.2 volume support is enabled (on models that have M.2 slots or PCIe slots). +* Enables creating M.2 storage pools and volumes from within Storage Manager. * 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). * Checks if there is a newer version of this script and offers to download it for you. From 4606b88e9373ef2d831175a7eb154e4906c22fe4 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Sat, 8 Apr 2023 17:53:21 +1000 Subject: [PATCH 55/74] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 491ad33..e496eec 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ ### Running the script via SSH You run the script in a shell with sudo -i or as root. ```YAML -sudo -i /path-to-script/syno_hdd_db.sh +sudo -i /path-to-script/syno_hdd_db.sh -nr ``` **Note:** Replace /path-to-script/ with the actual path to the script on your Synology. @@ -69,7 +69,7 @@ ### Running the script via SSH If you run the script with the -showedits flag it will show you the changes it made to the Synology's compatible-drive database. Obviously this is only useful if you run the script in a shell. ```YAML -sudo -i /path-to-script/syno_hdd_db.sh -showedits +sudo -i /path-to-script/syno_hdd_db.sh -nr -showedits ``` **Note:** Replace /path-to-script/ with the actual path to the script on your Synology. From c82cefd2ccd93f4dd71e7fc3a4107a507261446d Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Sat, 8 Apr 2023 17:55:52 +1000 Subject: [PATCH 56/74] Update CHANGES.txt --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index cc2ef45..ba0ff1d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,5 @@ v2.0.35 -- Now allows creating M.2 storage pool and volume all from Storage Manager +- Now allows creating M.2 storage pool and volume all from Storage Manager. v1.3.34 - Now always shows your drive entries in the host db file if -s or --showedits used instead of only db file was edited during that run. From 0e9ef7ccc1b7e4c5f1ad191e1e8dec4f844e97e6 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sun, 9 Apr 2023 19:02:36 +1000 Subject: [PATCH 57/74] Update syno_hdd_db.sh - Show the options used --- syno_hdd_db.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 69f1ac5..45a1d38 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -162,6 +162,10 @@ EOF } +# Save options used +args="$@" + + # Check for flags with getopt if options="$(getopt -o abcdefghijklmnopqrstuvwxyz0123456789 -a \ -l showedits,noupdate,nodbupdate,m2,force,ram,help,version,debug -- "$@")"; then @@ -258,6 +262,9 @@ elif [[ $model =~ '-j'$ ]]; then # GitHub issue #2 echo -e "\nUsing model: $model" fi +# Show options used +echo "Using options: $args" + #echo "" # To keep output readable From d170f7a226b90bad6816e89efd51e84fbb2eff25 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sun, 9 Apr 2023 19:03:04 +1000 Subject: [PATCH 58/74] Update syno_hdd_db.sh - Show the options used --- syno_hdd_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 45a1d38..0cee4ee 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -113,7 +113,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v2.0.35" +scriptver="v2.1.36" script=Synology_HDD_db repo="007revad/Synology_HDD_db" From f9dd66e8925d7083a218259d059ed6b757ce3da3 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sun, 9 Apr 2023 19:03:37 +1000 Subject: [PATCH 59/74] Update CHANGES.txt --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index ba0ff1d..80eff16 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +v2.1.36 +- Show the options used. + v2.0.35 - Now allows creating M.2 storage pool and volume all from Storage Manager. From c59a34aa0c92a7a7fbf43fb641e7dced2c600fa6 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sun, 9 Apr 2023 19:25:35 +1000 Subject: [PATCH 60/74] Update CHANGES.txt --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 80eff16..0a67c40 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -v2.1.36 +v2.0.36 - Show the options used. v2.0.35 From 2c347aa8239087eab39cd24f473945db81d556ad Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sun, 9 Apr 2023 19:25:59 +1000 Subject: [PATCH 61/74] Update syno_hdd_db.sh --- syno_hdd_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 0cee4ee..31c9502 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -113,7 +113,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v2.1.36" +scriptver="v2.0.36" script=Synology_HDD_db repo="007revad/Synology_HDD_db" From bcea0136f44a9bd38b766f2af4d329ae8f95ecb3 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Mon, 10 Apr 2023 11:36:24 +1000 Subject: [PATCH 62/74] Update README.md - Added Donators section --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index e496eec..1b04984 100644 --- a/README.md +++ b/README.md @@ -83,3 +83,8 @@ ### Running the script via SSH - 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. - Thanks to nicolerenee for pointing out the easiest way to enable creating M.2 storage pools and volumes in Storage Manager. + +**Donators** + +- A big thank you to Gummibando on reddit for their donation. + From 19bdaf256bb298316be483774ca9ad160ff29216 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Mon, 10 Apr 2023 11:36:54 +1000 Subject: [PATCH 63/74] Update CHANGES.txt --- CHANGES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.txt b/CHANGES.txt index 0a67c40..2471413 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,6 @@ v2.0.36 - Show the options used. +- A big thank you to Gummibando on reddit for their donation. v2.0.35 - Now allows creating M.2 storage pool and volume all from Storage Manager. From 632c0e14eed4b35f8b1bc381e56a10630242e5e2 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Mon, 10 Apr 2023 11:37:19 +1000 Subject: [PATCH 64/74] Update CHANGES.txt --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 2471413..3906040 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,6 @@ v2.0.36 - Show the options used. -- A big thank you to Gummibando on reddit for their donation. +- Thank you to Gummibando on reddit for their donation. v2.0.35 - Now allows creating M.2 storage pool and volume all from Storage Manager. From 20f41e7f4912c8221ef7d0f37fe14d9433dd0596 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Mon, 10 Apr 2023 12:29:08 +1000 Subject: [PATCH 65/74] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1b04984..2f41fbb 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ # Synology HDD db +[![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/007revad) ### Description From 3bd5a082f844ef8ccd6fb9f3821d657f8f80e43c Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sun, 16 Apr 2023 16:04:45 +1000 Subject: [PATCH 66/74] Update syno_hdd_db.sh - Now edits max supported memory to match the amount of memory installed, if greater than the current max memory setting. - Minor improvements. --- syno_hdd_db.sh | 67 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 53 insertions(+), 14 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 31c9502..088cf97 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -30,6 +30,8 @@ # It's also parsed and checked and probably in some cases it could be more critical to patch that one instead. # DONE +# Now edits max supported memory to match the amount of memory installed, if greater than the current max memory setting. +# # Now allows creating M.2 storage pool and volume all from Storage Manager # # Now always shows your drive entries in the host db file if -s or --showedits used, @@ -113,7 +115,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v2.0.36" +scriptver="v2.1.36" script=Synology_HDD_db repo="007revad/Synology_HDD_db" @@ -213,6 +215,12 @@ else fi +if [[ $debug == "yes" ]]; then + # set -x + export PS4='`[[ $? == 0 ]] || echo "\e[1;31;40m($?)\e[m\n "`:.$LINENO:' +fi + + # Check script is running as root if [[ $( whoami ) != "root" ]]; then echo -e "${Error}ERROR${Off} This script must be run as root or sudo!" @@ -762,7 +770,7 @@ updatedb() { editdb7 "append" "$2" fi - elif [[ $dbtype -eq "6" ]];then + elif [[ $dbtype -eq "6" ]]; then # example: # {"model":"WD60EFRX-68MYMN1","firmware":"82.00A82","rec_intvl":[1]}, # Don't need to add firmware version? @@ -808,7 +816,7 @@ while [[ $num -lt "${#hdds[@]}" ]]; do num2="0" while [[ $num2 -lt "${#eunits[@]}" ]]; do eudb="${dbpath}${eunits[$num2],,}${version}.db" - if [[ -f "$eudb" ]];then + if [[ -f "$eudb" ]]; then backupdb "$eudb" &&\ updatedb "${hdds[$num]}" "$eudb" else @@ -833,7 +841,7 @@ while [[ $num -lt "${#nvmes[@]}" ]]; do # M.2 adaptor cards num2="0" while [[ $num2 -lt "${#m2carddbs[@]}" ]]; do - if [[ -f "${dbpath}${m2carddbs[$num2]}" ]];then + if [[ -f "${dbpath}${m2carddbs[$num2]}" ]]; then backupdb "${dbpath}${m2carddbs[$num2]}" &&\ updatedb "${nvmes[$num]}" "${dbpath}${m2carddbs[$num2]}" else @@ -859,7 +867,8 @@ setting="$(get_key_value $synoinfo $sdc)" if [[ $force == "yes" ]]; then if [[ $setting == "yes" ]]; then # Disable support_disk_compatibility - sed -i "s/${sdc}=\"yes\"/${sdc}=\"no\"/" "$synoinfo" + #sed -i "s/${sdc}=\"yes\"/${sdc}=\"no\"/" "$synoinfo" + synosetkeyvalue "$synoinfo" "$sdc" "no" setting="$(get_key_value "$synoinfo" $sdc)" if [[ $setting == "no" ]]; then echo -e "\nDisabled support disk compatibility." @@ -868,7 +877,8 @@ if [[ $force == "yes" ]]; then else if [[ $setting == "no" ]]; then # Enable support_disk_compatibility - sed -i "s/${sdc}=\"no\"/${sdc}=\"yes\"/" "$synoinfo" + #sed -i "s/${sdc}=\"no\"/${sdc}=\"yes\"/" "$synoinfo" + synosetkeyvalue "$synoinfo" "$sdc" "yes" setting="$(get_key_value "$synoinfo" $sdc)" if [[ $setting == "yes" ]]; then echo -e "\nRe-enabled support disk compatibility." @@ -883,7 +893,8 @@ 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" + #sed -i "s/${smc}=\"yes\"/${smc}=\"no\"/" "$synoinfo" + synosetkeyvalue "$synoinfo" "$smc" "no" setting="$(get_key_value "$synoinfo" $smc)" if [[ $setting == "no" ]]; then echo -e "\nDisabled support memory compatibility." @@ -892,7 +903,8 @@ if [[ $ram == "yes" ]]; then else if [[ $setting == "no" ]]; then # Enable support_memory_compatibility - sed -i "s/${smc}=\"no\"/${smc}=\"yes\"/" "$synoinfo" + #sed -i "s/${smc}=\"no\"/${smc}=\"yes\"/" "$synoinfo" + synosetkeyvalue "$synoinfo" "$smc" "yes" setting="$(get_key_value "$synoinfo" $smc)" if [[ $setting == "yes" ]]; then echo -e "\nRe-enabled support memory compatibility." @@ -900,6 +912,31 @@ else fi fi +# Get total amount of installed memory +if [[ $ram == "yes" ]]; then + IFS=$'\n' read -r -d '' -a array < <(dmidecode -t memory | grep -i 'size') + if [[ ${#array[@]} -gt "0" ]]; then + num="0" + while [[ $num -lt "${#array[@]}" ]]; do + ramsize=$(printf %s "${array[num]}" | cut -d" " -f2) + if [[ $ramtotal ]]; then + ramtotal=$((ramtotal +ramsize)) + else + ramtotal="$ramsize" + fi + num=$((num +1)) + done + fi + setting="$(get_key_value $synoinfo mem_max_mb)" + if [[ $ramtotal -gt $setting ]]; then + synosetkeyvalue "$synoinfo" mem_max_mb "$ramtotal" + setting="$(get_key_value $synoinfo mem_max_mb)" + if [[ $setting == "$ramtotal" ]]; then + echo -e "\nSet max memory to $ramtotal MB." + fi + fi +fi + # Enable m2 volume support if [[ $m2 != "no" ]]; then @@ -909,12 +946,13 @@ if [[ $m2 != "no" ]]; then setting="$(get_key_value $synoinfo ${smp})" enabled="" if [[ ! $setting ]]; then - # Add support_m2_pool"yes" + # Add support_m2_pool="yes" echo 'support_m2_pool="yes"' >> "$synoinfo" enabled="yes" elif [[ $setting == "no" ]]; then - # Change support_m2_pool"no" to "yes" - sed -i "s/${smp}=\"no\"/${smp}=\"yes\"/" "$synoinfo" + # Change support_m2_pool="no" to "yes" + #sed -i "s/${smp}=\"no\"/${smp}=\"yes\"/" "$synoinfo" + synosetkeyvalue "$synoinfo" "$smp" "yes" enabled="yes" elif [[ $setting == "yes" ]]; then echo -e "\nM.2 volume support already enabled." @@ -944,7 +982,8 @@ if [[ $nodbupdate == "yes" ]]; then disabled="yes" elif [[ $url != "127.0.0.1" ]]; then # Edit drive_db_test_url= - sed -i "s/drive_db_test_url=.*/drive_db_test_url=\"127.0.0.1\"/" "$synoinfo" >/dev/null + #sed -i "s/drive_db_test_url=.*/drive_db_test_url=\"127.0.0.1\"/" "$synoinfo" >/dev/null + synosetkeyvalue "$synoinfo" "$dtu" "127.0.0.1" disabled="yes" fi @@ -986,10 +1025,10 @@ fi # Show the changes if [[ ${showedits,,} == "yes" ]]; then getdbtype "$db1" - if [[ $dbtype -gt "6" ]];then + if [[ $dbtype -gt "6" ]]; then # Show 11 lines after hdmodel line lines=11 - elif [[ $dbtype -eq "6" ]];then + elif [[ $dbtype -eq "6" ]]; then # Show 2 lines after hdmodel line lines=2 fi From 5dea995983f9610e6be88bcbb5f22d863ac837f3 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sun, 16 Apr 2023 16:05:19 +1000 Subject: [PATCH 67/74] Update CHANGES.txt --- CHANGES.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 3906040..fdac968 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,7 @@ +v2.1.37 +- Now edits max supported memory to match the amount of memory installed, if greater than the current max memory setting. +- Minor improvements. + v2.0.36 - Show the options used. - Thank you to Gummibando on reddit for their donation. From edcb9cfa9397f6f4b824aa84ec8b4b02f05ce87b Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sun, 16 Apr 2023 16:05:39 +1000 Subject: [PATCH 68/74] Update syno_hdd_db.sh --- syno_hdd_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 088cf97..ec9f6fd 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -115,7 +115,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v2.1.36" +scriptver="v2.1.37" script=Synology_HDD_db repo="007revad/Synology_HDD_db" From 60a710bfc7c60979ee71e9cb918f9ad78e7c6327 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sun, 16 Apr 2023 16:09:02 +1000 Subject: [PATCH 69/74] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2f41fbb..9f2a5fc 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ #### What the script does: * Prevents DSM auto updating the drive database. * Optionally disable DSM's "support_disk_compatibility". * Optionally disable DSM's "support_memory_compatibility" to prevent non-Synology memory notifications. +* Optionally edits max supported memory to match the amount of memory installed, if installed memory is greater than the current max memory setting. +- Minor improvements. * Checks that M.2 volume support is enabled (on models that have M.2 slots or PCIe slots). * Enables creating M.2 storage pools and volumes from within Storage Manager. * Makes DSM recheck disk compatibility so rebooting is not needed (DSM 7 only). From 09e7762fdbbf81bf8e7d7b3766276bfbf8d25dc8 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sun, 16 Apr 2023 16:09:37 +1000 Subject: [PATCH 70/74] Update CHANGES.txt --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index fdac968..6e9affc 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,5 @@ v2.1.37 -- Now edits max supported memory to match the amount of memory installed, if greater than the current max memory setting. +- Now edits max supported memory to match the amount of memory installed, if installed memory is greater than the current max memory setting. - Minor improvements. v2.0.36 From f0af84746320e17f4ed2b81c92cc30635cac4a65 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Mon, 17 Apr 2023 19:02:33 +1000 Subject: [PATCH 71/74] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 9f2a5fc..ff31cc3 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,6 @@ #### What the script does: * Optionally disable DSM's "support_disk_compatibility". * Optionally disable DSM's "support_memory_compatibility" to prevent non-Synology memory notifications. * Optionally edits max supported memory to match the amount of memory installed, if installed memory is greater than the current max memory setting. -- Minor improvements. * Checks that M.2 volume support is enabled (on models that have M.2 slots or PCIe slots). * Enables creating M.2 storage pools and volumes from within Storage Manager. * Makes DSM recheck disk compatibility so rebooting is not needed (DSM 7 only). From d552f2651a9ab662f71361744d6d7c9ea77edff2 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Mon, 17 Apr 2023 20:05:13 +1000 Subject: [PATCH 72/74] Update syno_hdd_db.sh --- syno_hdd_db.sh | 45 +++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index ec9f6fd..ea49bc3 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -30,6 +30,12 @@ # It's also parsed and checked and probably in some cases it could be more critical to patch that one instead. # DONE +# Changed method of checking if drive is a USB drive to prevent ignoring internal drives on RS models. +# +# Improved shell output when editing max memory setting. +# +# Changed to not run "synostgdisk --check-all-disks-compatibility" in DSM 6.2.3 (which has no synostgdisk. +# # Now edits max supported memory to match the amount of memory installed, if greater than the current max memory setting. # # Now allows creating M.2 storage pool and volume all from Storage Manager @@ -115,7 +121,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v2.1.37" +scriptver="v2.1.38" script=Synology_HDD_db repo="007revad/Synology_HDD_db" @@ -428,10 +434,12 @@ fixdrivemodel(){ } getdriveinfo() { - # Skip removable drives (USB drives) # $1 is /sys/block/sata1 etc - removable=$(cat "$1/removable") # Some DSM 7 RS models return 1 for internal drives! - if [[ $removable == "0" ]] || [[ $dsm -gt "6" ]]; then + + # Skip USB drives + usb=$(grep $(basename -- "$1") /proc/mounts | grep usb | cut -d" " -f1-2) + if [[ ! $usb ]]; then + # Get drive model and firmware version hdmodel=$(cat "$1/device/model") hdmodel=$(printf "%s" "$hdmodel" | xargs) # trim leading and trailing white space @@ -912,8 +920,9 @@ else fi fi -# Get total amount of installed memory +# Optioanlly set mem_max_mb to the amount of installed memory if [[ $ram == "yes" ]]; then + # Get total amount of installed memory IFS=$'\n' read -r -d '' -a array < <(dmidecode -t memory | grep -i 'size') if [[ ${#array[@]} -gt "0" ]]; then num="0" @@ -927,13 +936,19 @@ if [[ $ram == "yes" ]]; then num=$((num +1)) done fi + # Set mem_max_mb to the amount of installed memory setting="$(get_key_value $synoinfo mem_max_mb)" if [[ $ramtotal -gt $setting ]]; then synosetkeyvalue "$synoinfo" mem_max_mb "$ramtotal" + # Check we changed mem_max_mb setting="$(get_key_value $synoinfo mem_max_mb)" if [[ $setting == "$ramtotal" ]]; then echo -e "\nSet max memory to $ramtotal MB." + else + echo -e "\n${Error}ERROR${Off} Failed to change max memory!" fi + elif [[ $setting == "$ramtotal" ]]; then + echo -e "\nMax memory already set to $ramtotal MB." fi fi @@ -1059,15 +1074,17 @@ fi # Make Synology check disk compatibility -/usr/syno/sbin/synostgdisk --check-all-disks-compatibility -status=$? -if [[ $status -eq "0" ]]; then - echo -e "\nDSM successfully checked disk compatibility." -else - # Ignore DSM 6 as it returns 255 for "synostgdisk --check-all-disks-compatibility" - if [[ $dsm -gt "6" ]]; then - echo -e "\nDSM ${Red}failed${Off} to check disk compatibility with exit code $status" - echo -e "\nYou may need to ${Cyan}reboot the Synology${Off} to see the changes." +if [[ -f /usr/syno/sbin/synostgdisk ]]; then # DSM 6.2.3 does not have synostgdisk + /usr/syno/sbin/synostgdisk --check-all-disks-compatibility + status=$? + if [[ $status -eq "0" ]]; then + echo -e "\nDSM successfully checked disk compatibility." + else + # Ignore DSM 6.2.4 as it returns 255 for "synostgdisk --check-all-disks-compatibility" + if [[ $dsm -gt "6" ]]; then + echo -e "\nDSM ${Red}failed${Off} to check disk compatibility with exit code $status" + echo -e "\nYou may need to ${Cyan}reboot the Synology${Off} to see the changes." + fi fi fi From 33a8f5926daa57c8095e65231e3d7fb1e2b8fe19 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Mon, 17 Apr 2023 20:06:28 +1000 Subject: [PATCH 73/74] Update CHANGES.txt --- CHANGES.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 6e9affc..8af37d1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,8 @@ +v2.1.38 +- Improved shell output when editing max memory setting. +- Changed method of checking if drive is a USB drive to prevent ignoring internal drives on RS models. +- Changed to not run "synostgdisk --check-all-disks-compatibility" in DSM 6.2.3 (which has no synostgdisk). + v2.1.37 - Now edits max supported memory to match the amount of memory installed, if installed memory is greater than the current max memory setting. - Minor improvements. From 451ff22633e751117b75da1f248d31b3cfda4059 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Mon, 17 Apr 2023 20:07:47 +1000 Subject: [PATCH 74/74] Update syno_hdd_db.sh --- syno_hdd_db.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index ea49bc3..8197c5a 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -30,11 +30,11 @@ # It's also parsed and checked and probably in some cases it could be more critical to patch that one instead. # DONE -# Changed method of checking if drive is a USB drive to prevent ignoring internal drives on RS models. -# # Improved shell output when editing max memory setting. # -# Changed to not run "synostgdisk --check-all-disks-compatibility" in DSM 6.2.3 (which has no synostgdisk. +# Changed method of checking if drive is a USB drive to prevent ignoring internal drives on RS models. +# +# Changed to not run "synostgdisk --check-all-disks-compatibility" in DSM 6.2.3 (which has no synostgdisk). # # Now edits max supported memory to match the amount of memory installed, if greater than the current max memory setting. #