From d4ac47d222deb1fa0b4b65b22420fb2fcef4cb33 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Thu, 9 May 2024 09:44:39 +1000 Subject: [PATCH 1/8] Update syno_hdd_db.sh v3.5.90 - Changed to enable creating storage pools/volumes on NVMe drives in a PCIe M.2 adaptor in DSM 7.2 - Previously only supported DSM 7.2.1 - Changed to enable creating storage pools/volumes on NVMe drives in a PCIe M.2 adaptor even if PCIe M.2 adaptor not found. - This may allow creating NVMe volumes on 3rd party PCIe M.2 adaptors. - Bug fix for when there's multiple expansion unit models only the last expansion unit was processed. Issue #288 - Bug fix for when there's multiple M2 adaptor card models only the last M2 card was processed. - Bug fix for incorrectly matching model name variations as well as the exact model name. - e.g. RX1217 matched RX1217, RX1217rp and RX1217sas. --- syno_hdd_db.sh | 60 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 695f7a2..081ea14 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -16,6 +16,14 @@ #-------------------------------------------------------------------------------------------------- # CHANGES +# Bug fix for when there's multiple expansion unit models only the last expansion unit was processed. Issue #288 +# Bug fix for when there's multiple M2 adaptor card models only the last M2 card was processed. +# Bug fix for incorrectly matching model name variations as well as the exact model name. +# - e.g. RX1217 matched RX1217, RX1217rp and RX1217sas. +# +# Changed to enable creating storage pools/volumes on NVMe drives in a PCIe M.2 adaptor even if +# PCIe M.2 adaptor not found. This may allow creating NVMe volumes on 3rd party PCIe M.2 adaptors. +# # Bug fix for -s, --showedits option for multiple of the same drive model # but with different firmware versions. Issue #276 # @@ -538,7 +546,15 @@ adapter_cards="/usr/syno/etc.defaults/adapter_cards.conf" adapter_cards2="/usr/syno/etc/adapter_cards.conf" dbpath=/var/lib/disk-compatibility/ synoinfo="/etc.defaults/synoinfo.conf" -strgmgr="/var/packages/StorageManager/target/ui/storage_panel.js" + +if [[ $buildnumber -gt 64570 ]]; then + # DSM 7.2.1 and later + #strgmgr="/var/packages/StorageManager/target/ui/storage_panel.js" + strgmgr="/usr/local/packages/@appstore/StorageManager/ui/storage_panel.js" +elif [[ $buildnumber -ge 64561 ]]; then + # DSM 7.2 + strgmgr="/usr/syno/synoman/webman/modules/StorageManager/storage_panel.js" +fi vidfile="/usr/syno/etc.defaults/pci_vendor_ids.conf" vidfile2="/usr/syno/etc/pci_vendor_ids.conf" @@ -619,7 +635,13 @@ if [[ $restore == "yes" ]]; then fi # Restore storage_panel.js from backup - strgmgrver="$(/usr/syno/bin/synopkg version StorageManager)" + if [[ $buildnumber -gt 64570 ]]; then + # DSM 7.2.1 and later + strgmgrver="$(/usr/syno/bin/synopkg version StorageManager)" + elif [[ $buildnumber -ge 64561 ]]; then + # DSM 7.2 + strgmgrver="${buildnumber}${smallfixnumber}" + fi if [[ -f "${strgmgr}.$strgmgrver" ]]; then if cp -p "${strgmgr}.$strgmgrver" "$strgmgr"; then echo "Restored $(basename -- "$strgmgr")" @@ -1032,17 +1054,25 @@ fi # Host db files db1list=($(find "$dbpath" -maxdepth 1 -name "*_host*.db")) db2list=($(find "$dbpath" -maxdepth 1 -name "*_host*.db.new")) +#db1list=($(find "$dbpath" -maxdepth 1 -regextype posix-extended\ +# -iregex ".*_host(_v7)?.db")) +#db2list=($(find "$dbpath" -maxdepth 1 -regextype posix-extended\ +# -iregex ".*_host(_v7)?.db.new")) # Expansion Unit db files for i in "${!eunits[@]}"; do - eunitdb1list=($(find "$dbpath" -maxdepth 1 -name "${eunits[i],,}*.db")) - eunitdb2list=($(find "$dbpath" -maxdepth 1 -name "${eunits[i],,}*.db.new")) + #eunitdb1list+=($(find "$dbpath" -maxdepth 1 -name "${eunits[i],,}*.db")) + eunitdb1list+=($(find "$dbpath" -maxdepth 1 -regextype posix-extended\ + -iregex ".*${eunits[i],,}(_v7)?.db")) + #eunitdb2list+=($(find "$dbpath" -maxdepth 1 -name "${eunits[i],,}*.db.new")) + eunitdb2list+=($(find "$dbpath" -maxdepth 1 -regextype posix-extended\ + -iregex ".*${eunits[i],,}(_v7)?.db.new")) done # M.2 Card db files for i in "${!m2cards[@]}"; do - m2carddb1list=($(find "$dbpath" -maxdepth 1 -name "*_${m2cards[i],,}*.db")) - m2carddb2list=($(find "$dbpath" -maxdepth 1 -name "*_${m2cards[i],,}*.db.new")) + m2carddb1list+=($(find "$dbpath" -maxdepth 1 -name "*_${m2cards[i],,}*.db")) + m2carddb2list+=($(find "$dbpath" -maxdepth 1 -name "*_${m2cards[i],,}*.db.new")) done @@ -1889,13 +1919,21 @@ fi # Enable creating pool on drives in M.2 adaptor card -if [[ -f "$strgmgr" ]]; then - # StorageManager package is installed - if [[ ${#m2cards[@]} -gt "0" ]]; then +if [[ -f "$strgmgr" ]] && [[ $buildnumber -gt 42962 ]]; then + # DSM 7.2 and later + #if [[ ${#m2cards[@]} -gt "0" ]]; then if grep 'notSupportM2Pool_addOnCard' "$strgmgr" >/dev/null; then # Backup storage_panel.js" - strgmgrver="$(synopkg version StorageManager)" + + if [[ $buildnumber -gt 64570 ]]; then + # DSM 7.2.1 and later + strgmgrver="$(/usr/syno/bin/synopkg version StorageManager)" + elif [[ $buildnumber -ge 64561 ]]; then + # DSM 7.2 + strgmgrver="${buildnumber}${smallfixnumber}" + fi + echo "" if [[ ! -f "${strgmgr}.$strgmgrver" ]]; then if cp -p "$strgmgr" "${strgmgr}.$strgmgrver"; then @@ -1916,7 +1954,7 @@ if [[ -f "$strgmgr" ]]; then else echo -e "\nCreating pool in UI on drives in M.2 adaptor card already enabled." fi - fi + #fi fi From a67f818634b31174d8dccd19f74bcc977f2b90e7 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Thu, 9 May 2024 09:44:46 +1000 Subject: [PATCH 2/8] Update CHANGES.txt --- CHANGES.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 7ef16a1..dc3583d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,13 @@ +v3.5.90 +- Changed to enable creating storage pools/volumes on NVMe drives in a PCIe M.2 adaptor in DSM 7.2 + - Previously only supported DSM 7.2.1 +- Changed to enable creating storage pools/volumes on NVMe drives in a PCIe M.2 adaptor even if PCIe M.2 adaptor not found. + - This may allow creating NVMe volumes on 3rd party PCIe M.2 adaptors. +- Bug fix for when there's multiple expansion unit models only the last expansion unit was processed. Issue #288 +- Bug fix for when there's multiple M2 adaptor card models only the last M2 card was processed. +- Bug fix for incorrectly matching model name variations as well as the exact model name. + - e.g. RX1217 matched RX1217, RX1217rp and RX1217sas. + v3.5.89 - Bug fix for -s, --showedits option with multiple of the same drive model but with different firmware versions. Issue #276 From 0cf419f54500c798aab1e8abfe138bd201652b2a Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Thu, 9 May 2024 09:45:48 +1000 Subject: [PATCH 3/8] Update CHANGES.txt --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index dc3583d..fe87d23 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -v3.5.90 +v3.5.90-RC - Changed to enable creating storage pools/volumes on NVMe drives in a PCIe M.2 adaptor in DSM 7.2 - Previously only supported DSM 7.2.1 - Changed to enable creating storage pools/volumes on NVMe drives in a PCIe M.2 adaptor even if PCIe M.2 adaptor not found. From 13e90e11148ad99488a16e30fe91a28516697b22 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sat, 11 May 2024 08:04:10 +1000 Subject: [PATCH 4/8] Update CHANGES.txt --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index fe87d23..dc3583d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -v3.5.90-RC +v3.5.90 - Changed to enable creating storage pools/volumes on NVMe drives in a PCIe M.2 adaptor in DSM 7.2 - Previously only supported DSM 7.2.1 - Changed to enable creating storage pools/volumes on NVMe drives in a PCIe M.2 adaptor even if PCIe M.2 adaptor not found. From 9069f042403dd947943cd164eb60dfa090f632d3 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sat, 11 May 2024 08:09:33 +1000 Subject: [PATCH 5/8] 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 081ea14..ce72367 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -1921,7 +1921,7 @@ fi # Enable creating pool on drives in M.2 adaptor card if [[ -f "$strgmgr" ]] && [[ $buildnumber -gt 42962 ]]; then # DSM 7.2 and later - #if [[ ${#m2cards[@]} -gt "0" ]]; then + if [[ ${#m2cards[@]} -gt "0" ]]; then if grep 'notSupportM2Pool_addOnCard' "$strgmgr" >/dev/null; then # Backup storage_panel.js" @@ -1954,7 +1954,7 @@ if [[ -f "$strgmgr" ]] && [[ $buildnumber -gt 42962 ]]; then else echo -e "\nCreating pool in UI on drives in M.2 adaptor card already enabled." fi - #fi + fi fi From 3aa9fb64c7a0e32eafe23c733279379f937e1c58 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sat, 11 May 2024 08:24:03 +1000 Subject: [PATCH 6/8] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 22336dc..59ecd62 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ ### Options when running the script -w, --wdda Disable WD Device Analytics to prevent DSM showing a false warning for WD drives that are 3 years old DSM 7.2.1 already has WDDA disabled + -p, --pci Enable creating volumes on M2 in unknown PCIe adaptor -e, --email Disable colored text in output scheduler emails --restore Undo all changes made by the script --autoupdate=AGE Auto update script (useful when script is scheduled) From a2c0ec982f6c99558f72dd66740da62bf26450ef Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sat, 11 May 2024 08:25:08 +1000 Subject: [PATCH 7/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 59ecd62..7be5856 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ ### Options when running the script -w, --wdda Disable WD Device Analytics to prevent DSM showing a false warning for WD drives that are 3 years old DSM 7.2.1 already has WDDA disabled - -p, --pci Enable creating volumes on M2 in unknown PCIe adaptor + -p, --pcie Enable creating volumes on M2 in unknown PCIe adaptor -e, --email Disable colored text in output scheduler emails --restore Undo all changes made by the script --autoupdate=AGE Auto update script (useful when script is scheduled) From 7752f30df03af595d294b5dfa0021f33a6f60ed2 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sat, 11 May 2024 08:27:05 +1000 Subject: [PATCH 8/8] Update syno_hdd_db.sh --- syno_hdd_db.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index ce72367..e21fc4a 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -32,7 +32,7 @@ # Hard coded /usr/syno/bin/ for Synology commands (to prevent $PATH issues). # # Now enables creating storage pools in Storage Manager for M.2 drives in PCIe adaptor cards. -# - E10M20-T1, M2D20, M2D18 and M2D17 +# - E10M20-T1, M2D20, M2D18, M2D17 and FX2422N # # Added new vendor ids for Apacer, aigo, Lexar and Transcend NVMe drives. # @@ -90,6 +90,7 @@ Options: -w, --wdda Disable WD Device Analytics to prevent DSM showing a false warning for WD drives that are 3 years old DSM 7.2.1 already has WDDA disabled + -p, --pcie Enable creating volumes on M2 in unknown PCIe adaptor -e, --email Disable colored text in output scheduler emails --restore Undo all changes made by the script --autoupdate=AGE Auto update script (useful when script is scheduled) @@ -119,7 +120,7 @@ args=("$@") # Check for flags with getopt if options="$(getopt -o abcdefghijklmnopqrstuvwxyz0123456789 -l \ - restore,showedits,noupdate,nodbupdate,m2,force,incompatible,ram,wdda,email,autoupdate:,help,version,debug \ + restore,showedits,noupdate,nodbupdate,m2,force,incompatible,ram,pcie,wdda,email,autoupdate:,help,version,debug \ -- "$@")"; then eval set -- "$options" while true; do @@ -149,6 +150,9 @@ if options="$(getopt -o abcdefghijklmnopqrstuvwxyz0123456789 -l \ -w|--wdda) # Disable "support_wdda" wdda=no ;; + -p|--pcie) # Enable creating volumes on M2 in unknown PCIe adaptor + forcepci=yes + ;; -e|--email) # Disable colour text in task scheduler emails color=no ;; @@ -1921,7 +1925,7 @@ fi # Enable creating pool on drives in M.2 adaptor card if [[ -f "$strgmgr" ]] && [[ $buildnumber -gt 42962 ]]; then # DSM 7.2 and later - if [[ ${#m2cards[@]} -gt "0" ]]; then + if [[ ${#m2cards[@]} -gt "0" ]] || [[ $forcepci == "yes" ]]; then if grep 'notSupportM2Pool_addOnCard' "$strgmgr" >/dev/null; then # Backup storage_panel.js"