From 05bd5d6af6968b9c2a42762686373b41c362d9dd Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Tue, 1 Oct 2024 11:56:22 +1000 Subject: [PATCH 1/6] Create .gitattributes --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto From 4027b130b02dda8ba6281ce696b9e028b2f44c3e Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Tue, 1 Oct 2024 12:24:16 +1000 Subject: [PATCH 2/6] Update .gitattributes --- .gitattributes | 101 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 100 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index dfe0770..7353bc3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,101 @@ +# Common settings that generally should always be used with your language specific settings + # Auto detect text files and perform LF normalization -* text=auto +* text=auto + +# +# The above will handle all files NOT found below +# + +# Documents +*.bibtex text diff=bibtex +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain +*.md text diff=markdown +*.mdx text diff=markdown +*.tex text diff=tex +*.adoc text +*.textile text +*.mustache text +*.csv text eol=crlf +*.tab text +*.tsv text +*.txt text +*.sql text +*.epub diff=astextplain +*.dsc text eol=crlf +*.dsp text eol=crlf +*.ini text eol=crlf + +# Graphics +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.tif binary +*.tiff binary +*.ico binary +# SVG treated as text by default. +*.svg text +# If you want to treat it as binary, +# use the following line instead. +# *.svg binary +*.eps binary + +# Scripts +*.bash text eol=lf +*.fish text eol=lf +*.ksh text eol=lf +*.sh text eol=lf +*.zsh text eol=lf +# These are explicitly windows files and should use crlf +*.bat text eol=crlf +*.cmd text eol=crlf +*.ps1 text eol=crlf + +# Serialisation +*.json text +*.toml text +*.xml text +*.yaml text +*.yml text + +# Archives +*.7z binary +*.bz binary +*.bz2 binary +*.bzip2 binary +*.gz binary +*.lz binary +*.lzma binary +*.rar binary +*.tar binary +*.taz binary +*.tbz binary +*.tbz2 binary +*.tgz binary +*.tlz binary +*.txz binary +*.xz binary +*.Z binary +*.zip binary +*.zst binary + +# Text files where line endings should be preserved +*.patch -text + +# +# Exclude files from exporting +# + +.gitattributes export-ignore +.gitignore export-ignore +.gitkeep export-ignore \ No newline at end of file From 747c578abb56f6f9e2baf5e5088a1d4ce7a08dfe Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Wed, 2 Oct 2024 08:18:57 +1000 Subject: [PATCH 3/6] set sh files as executable --- .gitattributes | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.gitattributes b/.gitattributes index 7353bc3..86a3b88 100644 --- a/.gitattributes +++ b/.gitattributes @@ -15,6 +15,7 @@ *.DOCX diff=astextplain *.dot diff=astextplain *.DOT diff=astextplain +*.epub diff=astextplain *.pdf diff=astextplain *.PDF diff=astextplain *.rtf diff=astextplain @@ -25,15 +26,11 @@ *.adoc text *.textile text *.mustache text -*.csv text eol=crlf *.tab text *.tsv text *.txt text *.sql text -*.epub diff=astextplain -*.dsc text eol=crlf -*.dsp text eol=crlf -*.ini text eol=crlf +*.csv text eol=crlf # Graphics *.png binary @@ -43,17 +40,19 @@ *.tif binary *.tiff binary *.ico binary +*.eps binary # SVG treated as text by default. *.svg text # If you want to treat it as binary, # use the following line instead. # *.svg binary -*.eps binary # Scripts *.bash text eol=lf *.fish text eol=lf *.ksh text eol=lf +*.py text eol=lf +*.php text eol=lf *.sh text eol=lf *.zsh text eol=lf # These are explicitly windows files and should use crlf @@ -61,6 +60,14 @@ *.cmd text eol=crlf *.ps1 text eol=crlf +# Visual Dialog Script +*.dsc text eol=crlf +*.dsp text eol=crlf + +# Config files +*.ini text eol=crlf +*.conf text eol=lf + # Serialisation *.json text *.toml text From d684e3f6eefffca38f0adbc127fbd99ae4b05069 Mon Sep 17 00:00:00 2001 From: richard Date: Sat, 19 Oct 2024 23:33:34 +0100 Subject: [PATCH 4/6] get_size_gb() calculation error for 20GB HDDs. Increased precision of GiB to GB, 2^30 / 1e9 = 1.073741824 --- syno_hdd_db.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index a16099a..0b97023 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -896,11 +896,9 @@ fixdrivemodel(){ get_size_gb(){ # $1 is /sys/block/sata1 or /sys/block/nvme0n1 etc - local float - local int - float=$(synodisk --info /dev/"$(basename -- "$1")" | grep 'Total capacity' | awk '{print $4 * 1.0737}') - int="${float%.*}" - echo "$int" + local disk_size_gb + disk_size_gb=$(synodisk --info /dev/"$(basename -- "$1")" | grep 'Total capacity' | awk '{print int($4 * 1.073741824)}') + echo "$disk_size_gb" } getdriveinfo(){ From 5b91007ea4e277f427083009811696309a1915dc Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sun, 20 Oct 2024 10:26:50 +1100 Subject: [PATCH 5/6] Update CHANGES.txt --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index a19784c..44f1459 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +v3.5.103 +- Bug fix getting size of large drives. Issue #368 + v3.5.102 - Changed to use a faster method of detecting if an expansion unit is connected, for models with the syno_slot_mapping command. - Changed so XPE users using the hdddb addon don't need to reboot. From eba77306b1030b21f092941ed63be4ca59c89dc9 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sun, 20 Oct 2024 10:27:47 +1100 Subject: [PATCH 6/6] Update syno_hdd_db.sh get_size_gb() calculation error for 20GB HDDs. --- 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 0b97023..a24bd81 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -29,7 +29,7 @@ # /var/packages/StorageManager/target/ui/storage_panel.js -scriptver="v3.5.102" +scriptver="v3.5.103" script=Synology_HDD_db repo="007revad/Synology_HDD_db" scriptname=syno_hdd_db