Skip to content

Commit

Permalink
Merge pull request #194 from 007revad/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
007revad committed Dec 28, 2023
2 parents 24e38f0 + d2a15b2 commit 5ef78b9
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v3.3.73
- Bug fix for vendor id.

v3.3.72
- Bug fix for enabling creating storage pools in Storage Manager for M.2 drives in PCIe adaptor cards.
- Bug fix for not copying syno_hdd_db_vendors.txt to script location when script updates itself.
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,20 @@ sudo -i /path-to-script/syno_hdd_db.sh -nr --showedits

<p align="leftr"><img src="images/syno_hdd_db.png"></p>

### vendor_ids.txt

You only need to edit syno_hdd_vendor_ids.txt if the script warns you about a missing vendor id.

If DSM doesn't know the brand of your NVMe drives they will show up in Storage Manager as Unknown brand, and Unrecognised firmware version.

<p align="leftr"><img src="images/unknown.png"></p>

In this case the script will show you the vendor ID and advise you to add it to the syno_hdd_vendor_ids.txt file.

<p align="leftr"><img src="images/vendor_ids.png"></p>

<br>

**Credits**

- The idea for this script came from a comment made by Empyrealist on the Synology subreddit.
Expand Down
Binary file added images/vendor_ids.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions syno_hdd_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#
# Added new vendor ids for Apacer, aigo, Lexar and Transcend NVMe drives.
#
# Now includes syno_hdd_vendor.txt so users can add their NVMe drive's vendor id.
# - syno_hdd_vendor.txt needs to be in the same folder as syno_hdd_db.sh
# Now includes syno_hdd_vendor_ids.txt so users can add their NVMe drive's vendor id.
# - syno_hdd_vendor_ids.txt needs to be in the same folder as syno_hdd_db.sh
#
# Now warns if script is located on an M.2 volume.

Expand Down Expand Up @@ -178,7 +178,7 @@ fi
# Check script is running as root
if [[ $( whoami ) != "root" ]]; then
ding
echo -e "${Error}ERROR${Off} This script must be run as root or sudo!"
echo -e "${Error}ERROR${Off} This script must be run as sudo or root!"
exit 1
fi

Expand Down Expand Up @@ -654,16 +654,16 @@ vendor_from_id(){
0x05dc) vendor=Lexar ;;
0x1d79) vendor=Transcend;;
*)
# Get vendor from syno_hdd_vendor.txt
vidlist="$scriptpath/syno_hdd_vendor.txt"
# Get vendor from syno_hdd_vendor_ids.txt
vidlist="$scriptpath/syno_hdd_vendor_ids.txt"
if [[ -r "$vidlist" ]]; then
val=$(synogetkeyvalue "$vidlist" "$1")
if synogetkeyvalue "$vidlist" "$1"; then
if [[ -n "$val" ]]; then
vendor="$val"
else
echo -e "\n${Yellow}WARNING{OFF} No vendor found for vid $1" >&2
echo -e "You can add your drive's vendor to: "
echo "$vidlist"
echo -e "\n${Yellow}WARNING${Off} No vendor found for vid $1" >&2
echo -e "You can add ${Cyan}$1${Off} and your drive's vendor to: " >&2
echo "$vidlist" >&2
fi
else
echo -e "\n${Error}ERROR{OFF} $vidlist not found!" >&2
Expand All @@ -681,9 +681,9 @@ set_vendor(){
synosetkeyvalue "$vidfile" "${vid,,}" "$vendor"
val=$(synogetkeyvalue "$vidfile" "${vid,,}")
if [[ $val == "${vendor}" ]]; then
echo "Added $vendor to pci_vendor_ids" >&2
echo -e "\nAdded $vendor to pci_vendor_ids" >&2
else
echo "Failed to add $vendor to pci_vendor_ids!" >&2
echo -e "\nFailed to add $vendor to pci_vendor_ids!" >&2
fi
fi
if ! grep "$vid" "$vidfile2" >/dev/null; then
Expand Down Expand Up @@ -1774,7 +1774,7 @@ if [[ $wdda == "no" ]]; then
fi


# Enabled creating pool on drives in M.2 adaptor card
# Enable creating pool on drives in M.2 adaptor card
if [[ -f "$strgmgr" ]]; then
# StorageManager package is installed
if [[ ${#m2cards[@]} -gt "0" ]]; then
Expand Down
4 changes: 3 additions & 1 deletion syno_hdd_vendor_ids.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# You can add your drive's vendor id and vendor name here
# You can add your drive's vendor id and vendor name here.
#
# Only edit this file if the script warns you about a missing vendor id.

0x1dbe="ADATA"
0x0ed1="aigo"
Expand Down

0 comments on commit 5ef78b9

Please sign in to comment.