Browse Source

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.
pull/289/head
Dave Russell 2 years ago
committed by GitHub
parent
commit
d4ac47d222
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 60
      syno_hdd_db.sh

60
syno_hdd_db.sh

@ -16,6 +16,14 @@
#-------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------
# CHANGES # 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 # Bug fix for -s, --showedits option for multiple of the same drive model
# but with different firmware versions. Issue #276 # 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" adapter_cards2="/usr/syno/etc/adapter_cards.conf"
dbpath=/var/lib/disk-compatibility/ dbpath=/var/lib/disk-compatibility/
synoinfo="/etc.defaults/synoinfo.conf" 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" vidfile="/usr/syno/etc.defaults/pci_vendor_ids.conf"
vidfile2="/usr/syno/etc/pci_vendor_ids.conf" vidfile2="/usr/syno/etc/pci_vendor_ids.conf"
@ -619,7 +635,13 @@ if [[ $restore == "yes" ]]; then
fi fi
# Restore storage_panel.js from backup # 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 [[ -f "${strgmgr}.$strgmgrver" ]]; then
if cp -p "${strgmgr}.$strgmgrver" "$strgmgr"; then if cp -p "${strgmgr}.$strgmgrver" "$strgmgr"; then
echo "Restored $(basename -- "$strgmgr")" echo "Restored $(basename -- "$strgmgr")"
@ -1032,17 +1054,25 @@ fi
# Host db files # Host db files
db1list=($(find "$dbpath" -maxdepth 1 -name "*_host*.db")) db1list=($(find "$dbpath" -maxdepth 1 -name "*_host*.db"))
db2list=($(find "$dbpath" -maxdepth 1 -name "*_host*.db.new")) 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 # Expansion Unit db files
for i in "${!eunits[@]}"; do for i in "${!eunits[@]}"; do
eunitdb1list=($(find "$dbpath" -maxdepth 1 -name "${eunits[i],,}*.db")) #eunitdb1list+=($(find "$dbpath" -maxdepth 1 -name "${eunits[i],,}*.db"))
eunitdb2list=($(find "$dbpath" -maxdepth 1 -name "${eunits[i],,}*.db.new")) 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 done
# M.2 Card db files # M.2 Card db files
for i in "${!m2cards[@]}"; do for i in "${!m2cards[@]}"; do
m2carddb1list=($(find "$dbpath" -maxdepth 1 -name "*_${m2cards[i],,}*.db")) m2carddb1list+=($(find "$dbpath" -maxdepth 1 -name "*_${m2cards[i],,}*.db"))
m2carddb2list=($(find "$dbpath" -maxdepth 1 -name "*_${m2cards[i],,}*.db.new")) m2carddb2list+=($(find "$dbpath" -maxdepth 1 -name "*_${m2cards[i],,}*.db.new"))
done done
@ -1889,13 +1919,21 @@ fi
# Enable creating pool on drives in M.2 adaptor card # Enable creating pool on drives in M.2 adaptor card
if [[ -f "$strgmgr" ]]; then if [[ -f "$strgmgr" ]] && [[ $buildnumber -gt 42962 ]]; then
# StorageManager package is installed # DSM 7.2 and later
if [[ ${#m2cards[@]} -gt "0" ]]; then #if [[ ${#m2cards[@]} -gt "0" ]]; then
if grep 'notSupportM2Pool_addOnCard' "$strgmgr" >/dev/null; then if grep 'notSupportM2Pool_addOnCard' "$strgmgr" >/dev/null; then
# Backup storage_panel.js" # 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 "" echo ""
if [[ ! -f "${strgmgr}.$strgmgrver" ]]; then if [[ ! -f "${strgmgr}.$strgmgrver" ]]; then
if cp -p "$strgmgr" "${strgmgr}.$strgmgrver"; then if cp -p "$strgmgr" "${strgmgr}.$strgmgrver"; then
@ -1916,7 +1954,7 @@ if [[ -f "$strgmgr" ]]; then
else else
echo -e "\nCreating pool in UI on drives in M.2 adaptor card already enabled." echo -e "\nCreating pool in UI on drives in M.2 adaptor card already enabled."
fi fi
fi #fi
fi fi

Loading…
Cancel
Save