Skip to content

Commit

Permalink
add get DSM logs
Browse files Browse the repository at this point in the history
  • Loading branch information
wjz304 committed May 18, 2024
1 parent 52e73df commit 35861f8
Show file tree
Hide file tree
Showing 17 changed files with 5,654 additions and 5,589 deletions.
695 changes: 349 additions & 346 deletions files/initrd/opt/rr/lang/ar_SA/LC_MESSAGES/rr.po

Large diffs are not rendered by default.

695 changes: 349 additions & 346 deletions files/initrd/opt/rr/lang/de_DE/LC_MESSAGES/rr.po

Large diffs are not rendered by default.

692 changes: 346 additions & 346 deletions files/initrd/opt/rr/lang/en_US/LC_MESSAGES/rr.po

Large diffs are not rendered by default.

695 changes: 349 additions & 346 deletions files/initrd/opt/rr/lang/es_ES/LC_MESSAGES/rr.po

Large diffs are not rendered by default.

695 changes: 349 additions & 346 deletions files/initrd/opt/rr/lang/fr_FR/LC_MESSAGES/rr.po

Large diffs are not rendered by default.

695 changes: 349 additions & 346 deletions files/initrd/opt/rr/lang/ja_JP/LC_MESSAGES/rr.po

Large diffs are not rendered by default.

695 changes: 349 additions & 346 deletions files/initrd/opt/rr/lang/ko_KR/LC_MESSAGES/rr.po

Large diffs are not rendered by default.

746 changes: 374 additions & 372 deletions files/initrd/opt/rr/lang/rr.pot

Large diffs are not rendered by default.

695 changes: 349 additions & 346 deletions files/initrd/opt/rr/lang/ru_RU/LC_MESSAGES/rr.po

Large diffs are not rendered by default.

695 changes: 349 additions & 346 deletions files/initrd/opt/rr/lang/th_TH/LC_MESSAGES/rr.po

Large diffs are not rendered by default.

695 changes: 349 additions & 346 deletions files/initrd/opt/rr/lang/tr_TR/LC_MESSAGES/rr.po

Large diffs are not rendered by default.

695 changes: 349 additions & 346 deletions files/initrd/opt/rr/lang/uk_UA/LC_MESSAGES/rr.po

Large diffs are not rendered by default.

695 changes: 349 additions & 346 deletions files/initrd/opt/rr/lang/vi_VN/LC_MESSAGES/rr.po

Large diffs are not rendered by default.

695 changes: 349 additions & 346 deletions files/initrd/opt/rr/lang/zh_CN/LC_MESSAGES/rr.po

Large diffs are not rendered by default.

695 changes: 349 additions & 346 deletions files/initrd/opt/rr/lang/zh_HK/LC_MESSAGES/rr.po

Large diffs are not rendered by default.

695 changes: 349 additions & 346 deletions files/initrd/opt/rr/lang/zh_TW/LC_MESSAGES/rr.po

Large diffs are not rendered by default.

75 changes: 48 additions & 27 deletions files/initrd/opt/rr/menu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,13 @@ function modelMenu() {
PS="$(readConfigEntriesArray "platforms" "${WORK_PATH}/platforms.yml" | sort)"
MJ="$(python include/functions.py getmodels -p "${PS[*]}")"
if [ -z "${MJ}" -o "${MJ}" = "[]" ]; then
DIALOG --title "$(TEXT "Model")" \
--msgbox "$(TEXT "Failed to get models, Please check the network and try again, or use 'Parse Pat'!")" 0 0
if _get_fastest synology.com >/dev/null 2>&1; then
DIALOG --title "$(TEXT "Model")" \
--msgbox "$(TEXT "Failed to get models, Please check the network and try again, or use 'Parse Pat'!")" 0 0
else
DIALOG --title "$(TEXT "Model")" \
--msgbox "$(TEXT "Unable to connect to Synology website, Please check the network and try again, or use 'Parse Pat'!")" 0 0
fi
return 1
fi
echo -n "" >"${TMP_PATH}/modellist"
Expand Down Expand Up @@ -266,8 +271,7 @@ function productversMenu() {
if [ -z "${paturl}" -o -z "${patsum}" ]; then
if [ ${NETERR} -ne 0 ]; then
MSG=""
MSG+="$(TEXT "Network error, please check the network connection and try again.")"
MSG+="\n$(TEXT "Or use 'Parse pat' function for installation.")"
MSG+="$(TEXT "Unable to connect to Synology website, Please check the network and try again, or use 'Parse Pat'!")"
else
MSG="$(TEXT "Failed to get pat data,\nPlease manually fill in the URL and md5sum of the corresponding version of pat.\nOr click 'Retry'.")"
fi
Expand Down Expand Up @@ -2138,6 +2142,45 @@ function cloneBootloaderDisk() {
return
}

function reportBugs() {
if [ -d "${PART1_PATH}/logs" ]; then
DSMROOTS="$(findDSMRoot)"
if [ -n "${DSMROOTS}" ]; then
mkdir -p "${TMP_PATH}/mdX"
for I in ${DSMROOTS}; do
mount -t ext4 "${I}" "${TMP_PATH}/mdX"
[ $? -ne 0 ] && continue
mkdir -p "${PART1_PATH}/logs/md0/log"
cp -rf ${TMP_PATH}/mdX/.log.junior "${PART1_PATH}/logs/md0"
cp -rf ${TMP_PATH}/mdX/var/log/messages ${TMP_PATH}/mdX/var/log/*.log "${PART1_PATH}/logs/md0/log"
umount "${TMP_PATH}/mdX"
done
rm -rf "${TMP_PATH}/mdX"
fi
rm -f "${TMP_PATH}/logs.tar.gz"
tar -czf "${TMP_PATH}/logs.tar.gz" -C "${PART1_PATH}" logs
if [ -z "${SSH_TTY}" ]; then # web
mv -f "${TMP_PATH}/logs.tar.gz" "/var/www/data/logs.tar.gz"
URL="http://$(getIP)/logs.tar.gz"
DIALOG --title "$(TEXT "Advanced")" \
--msgbox "$(printf "$(TEXT "Please via %s to download the logs,\nAnd go to github to create an issue and upload the logs.")" "${URL}")" 0 0
else
sz -be -B 536870912 "${TMP_PATH}/logs.tar.gz"
DIALOG --title "$(TEXT "Advanced")" \
--msgbox "$(TEXT "Please go to github to create an issue and upload the logs.")" 0 0
fi
else
MSG=""
MSG+="$(TEXT "\Z1No logs found!\Zn\n\n")"
MSG+="$(TEXT "Please do as follows:\n")"
MSG+="$(TEXT " 1. Add dbgutils in addons and rebuild.\n")"
MSG+="$(TEXT " 2. Wait 10 minutes after booting.\n")"
MSG+="$(TEXT " 3. Reboot into RR and go to this option.\n")"
DIALOG --title "$(TEXT "Advanced")" \
--msgbox "${MSG}" 0 0
fi
}

###############################################################################
# Set proxy
# $1 - KEY
Expand Down Expand Up @@ -2425,29 +2468,7 @@ function advancedMenu() {
NEXT="e"
;;
v)
if [ -d "${PART1_PATH}/logs" ]; then
rm -f "${TMP_PATH}/logs.tar.gz"
tar -czf "${TMP_PATH}/logs.tar.gz" -C "${PART1_PATH}" logs
if [ -z "${SSH_TTY}" ]; then # web
mv -f "${TMP_PATH}/logs.tar.gz" "/var/www/data/logs.tar.gz"
URL="http://$(getIP)/logs.tar.gz"
DIALOG --title "$(TEXT "Advanced")" \
--msgbox "$(printf "$(TEXT "Please via %s to download the logs,\nAnd go to github to create an issue and upload the logs.")" "${URL}")" 0 0
else
sz -be -B 536870912 "${TMP_PATH}/logs.tar.gz"
DIALOG --title "$(TEXT "Advanced")" \
--msgbox "$(TEXT "Please go to github to create an issue and upload the logs.")" 0 0
fi
else
MSG=""
MSG+="$(TEXT "\Z1No logs found!\Zn\n\n")"
MSG+="$(TEXT "Please do as follows:\n")"
MSG+="$(TEXT " 1. Add dbgutils in addons and rebuild.\n")"
MSG+="$(TEXT " 2. Wait 10 minutes after booting.\n")"
MSG+="$(TEXT " 3. Reboot into RR and go to this option.\n")"
DIALOG --title "$(TEXT "Advanced")" \
--msgbox "${MSG}" 0 0
fi
reportBugs
NEXT="e"
;;
5)
Expand Down

0 comments on commit 35861f8

Please sign in to comment.