Browse Source

Merge pull request #60 from 007revad/develop

Develop
pull/91/head v2.1.38
Dave Russell 3 years ago
committed by GitHub
parent
commit
387787ddb8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      CHANGES.txt
  2. 37
      syno_hdd_db.sh

5
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 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. - 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. - Minor improvements.

37
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. # It's also parsed and checked and probably in some cases it could be more critical to patch that one instead.
# DONE # DONE
# 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).
#
# 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 greater than the current max memory setting.
# #
# 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
@ -115,7 +121,7 @@
# Optionally disable "support_disk_compatibility". # Optionally disable "support_disk_compatibility".
scriptver="v2.1.37" scriptver="v2.1.38"
script=Synology_HDD_db script=Synology_HDD_db
repo="007revad/Synology_HDD_db" repo="007revad/Synology_HDD_db"
@ -428,10 +434,12 @@ fixdrivemodel(){
} }
getdriveinfo() { getdriveinfo() {
# Skip removable drives (USB drives)
# $1 is /sys/block/sata1 etc # $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 # Get drive model and firmware version
hdmodel=$(cat "$1/device/model") hdmodel=$(cat "$1/device/model")
hdmodel=$(printf "%s" "$hdmodel" | xargs) # trim leading and trailing white space hdmodel=$(printf "%s" "$hdmodel" | xargs) # trim leading and trailing white space
@ -912,8 +920,9 @@ else
fi fi
fi fi
# Get total amount of installed memory # Optioanlly set mem_max_mb to the amount of installed memory
if [[ $ram == "yes" ]]; then if [[ $ram == "yes" ]]; then
# Get total amount of installed memory
IFS=$'\n' read -r -d '' -a array < <(dmidecode -t memory | grep -i 'size') IFS=$'\n' read -r -d '' -a array < <(dmidecode -t memory | grep -i 'size')
if [[ ${#array[@]} -gt "0" ]]; then if [[ ${#array[@]} -gt "0" ]]; then
num="0" num="0"
@ -927,13 +936,19 @@ if [[ $ram == "yes" ]]; then
num=$((num +1)) num=$((num +1))
done done
fi fi
# Set mem_max_mb to the amount of installed memory
setting="$(get_key_value $synoinfo mem_max_mb)" setting="$(get_key_value $synoinfo mem_max_mb)"
if [[ $ramtotal -gt $setting ]]; then if [[ $ramtotal -gt $setting ]]; then
synosetkeyvalue "$synoinfo" mem_max_mb "$ramtotal" synosetkeyvalue "$synoinfo" mem_max_mb "$ramtotal"
# Check we changed mem_max_mb
setting="$(get_key_value $synoinfo mem_max_mb)" setting="$(get_key_value $synoinfo mem_max_mb)"
if [[ $setting == "$ramtotal" ]]; then if [[ $setting == "$ramtotal" ]]; then
echo -e "\nSet max memory to $ramtotal MB." echo -e "\nSet max memory to $ramtotal MB."
else
echo -e "\n${Error}ERROR${Off} Failed to change max memory!"
fi fi
elif [[ $setting == "$ramtotal" ]]; then
echo -e "\nMax memory already set to $ramtotal MB."
fi fi
fi fi
@ -1059,16 +1074,18 @@ fi
# Make Synology check disk compatibility # Make Synology check disk compatibility
/usr/syno/sbin/synostgdisk --check-all-disks-compatibility if [[ -f /usr/syno/sbin/synostgdisk ]]; then # DSM 6.2.3 does not have synostgdisk
status=$? /usr/syno/sbin/synostgdisk --check-all-disks-compatibility
if [[ $status -eq "0" ]]; then status=$?
if [[ $status -eq "0" ]]; then
echo -e "\nDSM successfully checked disk compatibility." echo -e "\nDSM successfully checked disk compatibility."
else else
# Ignore DSM 6 as it returns 255 for "synostgdisk --check-all-disks-compatibility" # Ignore DSM 6.2.4 as it returns 255 for "synostgdisk --check-all-disks-compatibility"
if [[ $dsm -gt "6" ]]; then if [[ $dsm -gt "6" ]]; then
echo -e "\nDSM ${Red}failed${Off} to check disk compatibility with exit code $status" 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." echo -e "\nYou may need to ${Cyan}reboot the Synology${Off} to see the changes."
fi fi
fi
fi fi
if [[ $dsm -eq "6" ]]; then if [[ $dsm -eq "6" ]]; then

Loading…
Cancel
Save