mirror of
https://github.com/RROrg/rr.git
synced 2025-06-21 05:51:05 +08:00
modify menu
This commit is contained in:
parent
b28256e7e4
commit
e6fbd67b85
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -215,6 +215,9 @@ msgstr "目前只支援 dts 格式的檔案,請準備並點選確認上傳。\
|
|||||||
msgid "Custom dts file # Need rebuild"
|
msgid "Custom dts file # Need rebuild"
|
||||||
msgstr "自訂 dts 檔案 # 需要重新編譯"
|
msgstr "自訂 dts 檔案 # 需要重新編譯"
|
||||||
|
|
||||||
|
msgid "DMI: "
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
msgid "DOWN"
|
msgid "DOWN"
|
||||||
msgstr "關閉"
|
msgstr "關閉"
|
||||||
|
|
||||||
@ -242,11 +245,8 @@ msgstr "删除 cmdline 參數"
|
|||||||
msgid "Delete synoinfo item(s)"
|
msgid "Delete synoinfo item(s)"
|
||||||
msgstr "删除 Synoinfo 參數"
|
msgstr "删除 Synoinfo 參數"
|
||||||
|
|
||||||
msgid "Deselect all modules"
|
msgid "Deselect all"
|
||||||
msgstr "取消所有模組"
|
msgstr "取消所有"
|
||||||
|
|
||||||
msgid "Deselecting all modules"
|
|
||||||
msgstr "取消所有模組"
|
|
||||||
|
|
||||||
msgid "Detected %s network cards, %s MACs were customized, the rest will use the original MACs."
|
msgid "Detected %s network cards, %s MACs were customized, the rest will use the original MACs."
|
||||||
msgstr "檢測到 %s 個網路卡, 自訂了 %s 個 MAC,其他網路卡將使用本身 MAC。"
|
msgstr "檢測到 %s 個網路卡, 自訂了 %s 個 MAC,其他網路卡將使用本身 MAC。"
|
||||||
@ -527,6 +527,9 @@ msgstr "回復開機碟 # 測試"
|
|||||||
msgid "Restore bootloader disk with success to %s!\\nReboot?"
|
msgid "Restore bootloader disk with success to %s!\\nReboot?"
|
||||||
msgstr "成功回復開機碟到 %s!\\n重新開機?"
|
msgstr "成功回復開機碟到 %s!\\n重新開機?"
|
||||||
|
|
||||||
|
msgid "Retry"
|
||||||
|
msgstr "重試"
|
||||||
|
|
||||||
msgid "Save is complete."
|
msgid "Save is complete."
|
||||||
msgstr "儲存完成。"
|
msgstr "儲存完成。"
|
||||||
|
|
||||||
@ -539,8 +542,8 @@ msgstr "儲存中..."
|
|||||||
msgid "Select addon to remove"
|
msgid "Select addon to remove"
|
||||||
msgstr "選擇要删除的增益集"
|
msgstr "選擇要删除的增益集"
|
||||||
|
|
||||||
msgid "Select all modules"
|
msgid "Select all"
|
||||||
msgstr "選擇所有模組"
|
msgstr "選擇所有"
|
||||||
|
|
||||||
msgid "Select an addon"
|
msgid "Select an addon"
|
||||||
msgstr "選擇增益集"
|
msgstr "選擇增益集"
|
||||||
@ -557,9 +560,6 @@ msgstr "選擇要載入的增益集"
|
|||||||
msgid "Select synoinfo entry to remove"
|
msgid "Select synoinfo entry to remove"
|
||||||
msgstr "選擇要删除的參數"
|
msgstr "選擇要删除的參數"
|
||||||
|
|
||||||
msgid "Selecting all modules"
|
|
||||||
msgstr "全選所有模組"
|
|
||||||
|
|
||||||
msgid "Selecting loaded modules"
|
msgid "Selecting loaded modules"
|
||||||
msgstr "選擇已識別的模組"
|
msgstr "選擇已識別的模組"
|
||||||
|
|
||||||
@ -587,8 +587,8 @@ msgstr "顯示 dsm logo:"
|
|||||||
msgid "Show model inherent cmdline"
|
msgid "Show model inherent cmdline"
|
||||||
msgstr "顯示型號預設的 cmdline 參數"
|
msgstr "顯示型號預設的 cmdline 參數"
|
||||||
|
|
||||||
msgid "Show selected modules"
|
msgid "Show/Select modules"
|
||||||
msgstr "顯示已選取的模組"
|
msgstr "顯/選擇模組"
|
||||||
|
|
||||||
msgid "Show synoinfo entries"
|
msgid "Show synoinfo entries"
|
||||||
msgstr "顯示 Synoinfo 參數"
|
msgstr "顯示 Synoinfo 參數"
|
||||||
@ -776,9 +776,6 @@ msgstr "警告:\\n該作業不可逆,請提前備份重要資料。是否繼
|
|||||||
msgid "Welcome to %s"
|
msgid "Welcome to %s"
|
||||||
msgstr "歡迎使用 %s"
|
msgstr "歡迎使用 %s"
|
||||||
|
|
||||||
msgid "Writing to user config"
|
|
||||||
msgstr "寫入使用者設置"
|
|
||||||
|
|
||||||
msgid "Writing..."
|
msgid "Writing..."
|
||||||
msgstr "寫入中..."
|
msgstr "寫入中..."
|
||||||
|
|
||||||
|
@ -182,37 +182,43 @@ function productversMenu() {
|
|||||||
--msgbox "$(TEXT "This version only support usb startup, Please select another version or switch the startup mode.")" 0 0
|
--msgbox "$(TEXT "This version only support usb startup, Please select another version or switch the startup mode.")" 0 0
|
||||||
# return
|
# return
|
||||||
fi
|
fi
|
||||||
# get online pat data
|
while true; do
|
||||||
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Product Version")" \
|
# get online pat data
|
||||||
--infobox "$(TEXT "Get pat data ..")" 0 0
|
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Product Version")" \
|
||||||
idx=0
|
--infobox "$(TEXT "Get pat data ..")" 0 0
|
||||||
while [ ${idx} -le 3 ]; do # Loop 3 times, if successful, break
|
idx=0
|
||||||
fastest=$(_get_fastest "www.synology.com" "www.synology.cn")
|
while [ ${idx} -le 3 ]; do # Loop 3 times, if successful, break
|
||||||
[ "${fastest}" = "www.synology.cn" ] &&
|
fastest=$(_get_fastest "www.synology.com" "www.synology.cn")
|
||||||
fastest="https://www.synology.cn/api/support/findDownloadInfo?lang=zh-cn" ||
|
[ "${fastest}" = "www.synology.cn" ] &&
|
||||||
fastest="https://www.synology.com/api/support/findDownloadInfo?lang=en-us"
|
fastest="https://www.synology.cn/api/support/findDownloadInfo?lang=zh-cn" ||
|
||||||
patdata=$(curl -skL "${fastest}&product=${MODEL/+/%2B}&major=${resp%%.*}&minor=${resp##*.}")
|
fastest="https://www.synology.com/api/support/findDownloadInfo?lang=en-us"
|
||||||
if [ "$(echo ${patdata} | jq -r '.success' 2>/dev/null)" = "true" ]; then
|
patdata=$(curl -skL "${fastest}&product=${MODEL/+/%2B}&major=${resp%%.*}&minor=${resp##*.}")
|
||||||
if echo ${patdata} | jq -r '.info.system.detail[0].items[0].files[0].label_ext' 2>/dev/null | grep -q 'pat'; then
|
if [ "$(echo ${patdata} | jq -r '.success' 2>/dev/null)" = "true" ]; then
|
||||||
paturl=$(echo ${patdata} | jq -r '.info.system.detail[0].items[0].files[0].url')
|
if echo ${patdata} | jq -r '.info.system.detail[0].items[0].files[0].label_ext' 2>/dev/null | grep -q 'pat'; then
|
||||||
patsum=$(echo ${patdata} | jq -r '.info.system.detail[0].items[0].files[0].checksum')
|
paturl=$(echo ${patdata} | jq -r '.info.system.detail[0].items[0].files[0].url')
|
||||||
paturl=${paturl%%\?*}
|
patsum=$(echo ${patdata} | jq -r '.info.system.detail[0].items[0].files[0].checksum')
|
||||||
break
|
paturl=${paturl%%\?*}
|
||||||
|
break
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
idx=$((${idx} + 1))
|
||||||
|
done
|
||||||
|
if [ -z "${paturl}" -o -z "${patsum}" ]; then
|
||||||
|
MSG="$(TEXT "Failed to get pat data,\nPlease manually fill in the URL and md5sum of the corresponding version of pat.")"
|
||||||
|
paturl=""
|
||||||
|
patsum=""
|
||||||
|
else
|
||||||
|
MSG="$(TEXT "Successfully to get pat data,\nPlease confirm or modify as needed.")"
|
||||||
fi
|
fi
|
||||||
idx=$((${idx} + 1))
|
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Product Version")" \
|
||||||
|
--extra-button --extra-label "$(TEXT "Retry")" \
|
||||||
|
--form "${MSG}" 10 110 2 "URL" 1 1 "${paturl}" 1 5 100 0 "MD5" 2 1 "${patsum}" 2 5 100 0 \
|
||||||
|
2>"${TMP_PATH}/resp"
|
||||||
|
RET=$?
|
||||||
|
[ ${RET} -eq 0 ] && break # ok-button
|
||||||
|
[ ${RET} -eq 3 ] && continue # extra-button
|
||||||
|
return # 1 or 255 # cancel-button or ESC
|
||||||
done
|
done
|
||||||
if [ -z "${paturl}" -o -z "${patsum}" ]; then
|
|
||||||
MSG="$(TEXT "Failed to get pat data,\nPlease manually fill in the URL and md5sum of the corresponding version of pat.")"
|
|
||||||
paturl=""
|
|
||||||
patsum=""
|
|
||||||
else
|
|
||||||
MSG="$(TEXT "Successfully to get pat data,\nPlease confirm or modify as needed.")"
|
|
||||||
fi
|
|
||||||
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Product Version")" \
|
|
||||||
--form "${MSG}" 10 110 2 "URL" 1 1 "${paturl}" 1 5 100 0 "MD5" 2 1 "${patsum}" 2 5 100 0 \
|
|
||||||
2>"${TMP_PATH}/resp"
|
|
||||||
[ $? -ne 0 ] && return
|
|
||||||
paturl="$(cat "${TMP_PATH}/resp" | tail -n +1 | head -1)"
|
paturl="$(cat "${TMP_PATH}/resp" | tail -n +1 | head -1)"
|
||||||
patsum="$(cat "${TMP_PATH}/resp" | tail -n +2 | head -1)"
|
patsum="$(cat "${TMP_PATH}/resp" | tail -n +2 | head -1)"
|
||||||
[ -z "${paturl}" -o -z "${patsum}" ] && return
|
[ -z "${paturl}" -o -z "${patsum}" ] && return
|
||||||
@ -403,38 +409,69 @@ function moduleMenu() {
|
|||||||
PLATFORM="$(readModelKey "${MODEL}" "platform")"
|
PLATFORM="$(readModelKey "${MODEL}" "platform")"
|
||||||
KVER="$(readModelKey "${MODEL}" "productvers.[${PRODUCTVER}].kver")"
|
KVER="$(readModelKey "${MODEL}" "productvers.[${PRODUCTVER}].kver")"
|
||||||
KPRE="$(readModelKey "${MODEL}" "productvers.[${PRODUCTVER}].kpre")"
|
KPRE="$(readModelKey "${MODEL}" "productvers.[${PRODUCTVER}].kpre")"
|
||||||
|
NEXT="c"
|
||||||
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \
|
|
||||||
--infobox "$(TEXT "Reading modules")" 0 0
|
|
||||||
ALLMODULES=$(getAllModules "${PLATFORM}" "$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}")
|
|
||||||
unset USERMODULES
|
|
||||||
declare -A USERMODULES
|
|
||||||
while IFS=': ' read KEY VALUE; do
|
|
||||||
[ -n "${KEY}" ] && USERMODULES["${KEY}"]="${VALUE}"
|
|
||||||
done < <(readConfigMap "modules" "${USER_CONFIG_FILE}")
|
|
||||||
NEXT="s"
|
|
||||||
# loop menu
|
# loop menu
|
||||||
while true; do
|
while true; do
|
||||||
dialog --backtitle "$(backtitle)" --colors \
|
dialog --backtitle "$(backtitle)" --colors \
|
||||||
--default-item ${NEXT} --menu "$(TEXT "Choose a option")" 0 0 0 \
|
--default-item ${NEXT} --menu "$(TEXT "Choose a option")" 0 0 0 \
|
||||||
s "$(TEXT "Show selected modules")" \
|
c "$(TEXT "Show/Select modules")" \
|
||||||
l "$(TEXT "Select loaded modules")" \
|
l "$(TEXT "Select loaded modules")" \
|
||||||
a "$(TEXT "Select all modules")" \
|
|
||||||
d "$(TEXT "Deselect all modules")" \
|
|
||||||
c "$(TEXT "Choose modules to include")" \
|
|
||||||
o "$(TEXT "Upload a external module")" \
|
o "$(TEXT "Upload a external module")" \
|
||||||
p "$(TEXT "Priority use of official drivers:") \Z4${ODP}\Zn" \
|
p "$(TEXT "Priority use of official drivers:") \Z4${ODP}\Zn" \
|
||||||
e "$(TEXT "Exit")" \
|
e "$(TEXT "Exit")" \
|
||||||
2>${TMP_PATH}/resp
|
2>${TMP_PATH}/resp
|
||||||
[ $? -ne 0 ] && break
|
[ $? -ne 0 ] && break
|
||||||
case "$(<${TMP_PATH}/resp)" in
|
case "$(<${TMP_PATH}/resp)" in
|
||||||
s)
|
c)
|
||||||
ITEMS=""
|
while true; do
|
||||||
for KEY in ${!USERMODULES[@]}; do
|
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \
|
||||||
ITEMS+="${KEY}: ${USERMODULES[$KEY]}\n"
|
--infobox "$(TEXT "Reading modules")" 0 0
|
||||||
|
ALLMODULES=$(getAllModules "${PLATFORM}" "$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}")
|
||||||
|
unset USERMODULES
|
||||||
|
declare -A USERMODULES
|
||||||
|
while IFS=': ' read KEY VALUE; do
|
||||||
|
[ -n "${KEY}" ] && USERMODULES["${KEY}"]="${VALUE}"
|
||||||
|
done < <(readConfigMap "modules" "${USER_CONFIG_FILE}")
|
||||||
|
rm -f "${TMP_PATH}/opts"
|
||||||
|
while read ID DESC; do
|
||||||
|
arrayExistItem "${ID}" "${!USERMODULES[@]}" && ACT="on" || ACT="off"
|
||||||
|
echo "${ID} ${DESC} ${ACT}" >>"${TMP_PATH}/opts"
|
||||||
|
done <<<${ALLMODULES}
|
||||||
|
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \
|
||||||
|
--extra-button --extra-label "$(TEXT "Select all")" \
|
||||||
|
--help-button --help-label "$(TEXT "Deselect all")" \
|
||||||
|
--checklist "$(TEXT "Select modules to include")" 0 0 0 --file "${TMP_PATH}/opts" \
|
||||||
|
2>${TMP_PATH}/resp
|
||||||
|
RET=$?
|
||||||
|
case ${RET} in
|
||||||
|
0) # ok-button
|
||||||
|
resp=$(<${TMP_PATH}/resp)
|
||||||
|
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
|
||||||
|
for ID in ${resp}; do
|
||||||
|
writeConfigKey "modules.${ID}" "" "${USER_CONFIG_FILE}"
|
||||||
|
done
|
||||||
|
DIRTY=1
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
3) # extra-button
|
||||||
|
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
|
||||||
|
while read ID DESC; do
|
||||||
|
writeConfigKey "modules.${ID}" "" "${USER_CONFIG_FILE}"
|
||||||
|
done <<<${ALLMODULES}
|
||||||
|
DIRTY=1
|
||||||
|
;;
|
||||||
|
2) # help-button
|
||||||
|
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
|
||||||
|
DIRTY=1
|
||||||
|
;;
|
||||||
|
1) # cancel-button
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
255) # ESC
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \
|
|
||||||
--msgbox "${ITEMS}" 0 0
|
|
||||||
;;
|
;;
|
||||||
l)
|
l)
|
||||||
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \
|
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \
|
||||||
@ -444,61 +481,12 @@ function moduleMenu() {
|
|||||||
KOLIST+="$(getdepends "${PLATFORM}" "$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}" "${I}") ${I} "
|
KOLIST+="$(getdepends "${PLATFORM}" "$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}" "${I}") ${I} "
|
||||||
done
|
done
|
||||||
KOLIST=($(echo ${KOLIST} | tr ' ' '\n' | sort -u))
|
KOLIST=($(echo ${KOLIST} | tr ' ' '\n' | sort -u))
|
||||||
unset USERMODULES
|
|
||||||
declare -A USERMODULES
|
|
||||||
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
|
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
|
||||||
for ID in ${KOLIST[@]}; do
|
for ID in ${KOLIST[@]}; do
|
||||||
USERMODULES["${ID}"]=""
|
|
||||||
writeConfigKey "modules.${ID}" "" "${USER_CONFIG_FILE}"
|
writeConfigKey "modules.${ID}" "" "${USER_CONFIG_FILE}"
|
||||||
done
|
done
|
||||||
DIRTY=1
|
DIRTY=1
|
||||||
;;
|
;;
|
||||||
a)
|
|
||||||
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \
|
|
||||||
--infobox "$(TEXT "Selecting all modules")" 0 0
|
|
||||||
unset USERMODULES
|
|
||||||
declare -A USERMODULES
|
|
||||||
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
|
|
||||||
while read ID DESC; do
|
|
||||||
USERMODULES["${ID}"]=""
|
|
||||||
writeConfigKey "modules.${ID}" "" "${USER_CONFIG_FILE}"
|
|
||||||
done <<<${ALLMODULES}
|
|
||||||
DIRTY=1
|
|
||||||
;;
|
|
||||||
|
|
||||||
d)
|
|
||||||
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \
|
|
||||||
--infobox "$(TEXT "Deselecting all modules")" 0 0
|
|
||||||
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
|
|
||||||
unset USERMODULES
|
|
||||||
declare -A USERMODULES
|
|
||||||
DIRTY=1
|
|
||||||
;;
|
|
||||||
|
|
||||||
c)
|
|
||||||
rm -f "${TMP_PATH}/opts"
|
|
||||||
while read ID DESC; do
|
|
||||||
arrayExistItem "${ID}" "${!USERMODULES[@]}" && ACT="on" || ACT="off"
|
|
||||||
echo "${ID} ${DESC} ${ACT}" >>"${TMP_PATH}/opts"
|
|
||||||
done <<<${ALLMODULES}
|
|
||||||
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \
|
|
||||||
--checklist "$(TEXT "Select modules to include")" 0 0 0 --file "${TMP_PATH}/opts" \
|
|
||||||
2>${TMP_PATH}/resp
|
|
||||||
[ $? -ne 0 ] && continue
|
|
||||||
resp=$(<${TMP_PATH}/resp)
|
|
||||||
[ -z "${resp}" ] && continue
|
|
||||||
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \
|
|
||||||
--infobox "$(TEXT "Writing to user config")" 0 0
|
|
||||||
unset USERMODULES
|
|
||||||
declare -A USERMODULES
|
|
||||||
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
|
|
||||||
for ID in ${resp}; do
|
|
||||||
USERMODULES["${ID}"]=""
|
|
||||||
writeConfigKey "modules.${ID}" "" "${USER_CONFIG_FILE}"
|
|
||||||
done
|
|
||||||
DIRTY=1
|
|
||||||
;;
|
|
||||||
|
|
||||||
o)
|
o)
|
||||||
MSG=""
|
MSG=""
|
||||||
MSG+="$(TEXT "This function is experimental and dangerous. If you don't know much, please exit.\n")"
|
MSG+="$(TEXT "This function is experimental and dangerous. If you don't know much, please exit.\n")"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user