add some error info

This commit is contained in:
Ing 2024-03-27 04:31:13 +08:00
parent 5d7e305172
commit d363faca57
9 changed files with 2019 additions and 1809 deletions

View File

@ -20,7 +20,7 @@ printf "\033[1;44m%*s\033[0m\n" ${COLUMNS} ""
# Get first MAC address # Get first MAC address
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep -v lo) || true ETHX=$(ls /sys/class/net/ 2>/dev/null | grep -v lo) || true
# No network devices # No network devices
[ $(echo ${ETHX} | wc -w) -le 0 ] && die "$(TEXT "Network devices not found!")" [ $(echo ${ETHX} | wc -w) -le 0 ] && die "$(TEXT "Network devices not found! Please re execute init.sh after connecting to the network!")"
# If user config file not exists, initialize it # If user config file not exists, initialize it
if [ ! -f "${USER_CONFIG_FILE}" ]; then if [ ! -f "${USER_CONFIG_FILE}" ]; then
@ -175,6 +175,7 @@ done
# Inform user # Inform user
echo echo
echo -e "$(TEXT "Call \033[1;32minit.sh\033[0m to re get init info")"
echo -e "$(TEXT "Call \033[1;32mmenu.sh\033[0m to configure loader")" echo -e "$(TEXT "Call \033[1;32mmenu.sh\033[0m to configure loader")"
echo echo
echo -e "$(TEXT "User config is on") \033[1;32m${USER_CONFIG_FILE}\033[0m" echo -e "$(TEXT "User config is on") \033[1;32m${USER_CONFIG_FILE}\033[0m"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -851,10 +851,12 @@ function cmdlineMenu() {
MSG+="$(TEXT " * \Z4intel_idle.max_cstate=1\Zn\n Set the maximum C-state depth allowed by the intel_idle driver.\n")" MSG+="$(TEXT " * \Z4intel_idle.max_cstate=1\Zn\n Set the maximum C-state depth allowed by the intel_idle driver.\n")"
MSG+="$(TEXT " * \Z4pcie_port_pm=off\Zn\n Turn off the power management of the PCIe port.\n")" MSG+="$(TEXT " * \Z4pcie_port_pm=off\Zn\n Turn off the power management of the PCIe port.\n")"
MSG+="$(TEXT " * \Z4libata.force=noncq\Zn\n Disable NCQ for all SATA ports.\n")" MSG+="$(TEXT " * \Z4libata.force=noncq\Zn\n Disable NCQ for all SATA ports.\n")"
MSG+="$(TEXT " * \Z4SataPortMap=??\Zn\n Sata Port Map.\n")" MSG+="$(TEXT " * \Z4SataPortMap=??\Zn\n Sata Port Map.(Not apply to DT models.)\n")"
MSG+="$(TEXT " * \Z4DiskIdxMap=??\Zn\n Disk Index Map, Modify disk name sequence.\n")" MSG+="$(TEXT " * \Z4DiskIdxMap=??\Zn\n Disk Index Map, Modify disk name sequence.(Not apply to DT models.)\n")"
MSG+="$(TEXT " * \Z4ahci_remap=4>5:5>8:12>16\Zn\n Remap data port sequence.(Not apply to DT models.)\n")"
MSG+="$(TEXT " * \Z4i915.enable_guc=2\Zn\n Enable the GuC firmware on Intel graphics hardware.(value: 1,2 or 3)\n")" MSG+="$(TEXT " * \Z4i915.enable_guc=2\Zn\n Enable the GuC firmware on Intel graphics hardware.(value: 1,2 or 3)\n")"
MSG+="$(TEXT " * \Z4i915.max_vfs=7\Zn\n Set the maximum number of virtual functions (VFs) that can be created for Intel graphics hardware.\n")" MSG+="$(TEXT " * \Z4i915.max_vfs=7\Zn\n Set the maximum number of virtual functions (VFs) that can be created for Intel graphics hardware.\n")"
MSG+="$(TEXT " * \Z4consoleblank=300\Zn\n Set the console to auto turnoff display 300 seconds after no activity (measured in seconds).\n")"
MSG+="$(TEXT "\nEnter the parameter name and value you need to add.\n")" MSG+="$(TEXT "\nEnter the parameter name and value you need to add.\n")"
LINENUM=$(($(echo -e "${MSG}" | wc -l) + 10)) LINENUM=$(($(echo -e "${MSG}" | wc -l) + 10))
while true; do while true; do
@ -1074,7 +1076,7 @@ function getSynoExtractor() {
RET=$? RET=$?
if [ ${RET} -ne 0 -o ${STATUS:-0} -ne 200 ]; then if [ ${RET} -ne 0 -o ${STATUS:-0} -ne 200 ]; then
rm -f "${OLDPAT_PATH}" rm -f "${OLDPAT_PATH}"
MSG="$(printf "$(TEXT "Check internet or cache disk space.\nError: %d:%d")" "${RET}" "${STATUS}")" MSG="$(printf "$(TEXT "Check internet or cache disk space.\nError: %d:%d\n(Please via https://curl.se/libcurl/c/libcurl-errors.html check error description.)")" "${RET}" "${STATUS}")"
echo -e "${MSG}" >"${LOG_FILE}" echo -e "${MSG}" >"${LOG_FILE}"
return 1 return 1
fi fi
@ -1229,7 +1231,7 @@ function extractDsmFiles() {
rm -rf "${PAT_PATH}.downloading" rm -rf "${PAT_PATH}.downloading"
if [ ${RET} -ne 0 -o ${STATUS:-0} -ne 200 ]; then if [ ${RET} -ne 0 -o ${STATUS:-0} -ne 200 ]; then
rm -f "${PAT_PATH}" rm -f "${PAT_PATH}"
MSG="$(printf "$(TEXT "Check internet or cache disk space.\nError: %d:%d")" "${RET}" "${STATUS}")" MSG="$(printf "$(TEXT "Check internet or cache disk space.\nError: %d:%d\n(Please via https://curl.se/libcurl/c/libcurl-errors.html check error description.)")" "${RET}" "${STATUS}")"
echo -e "${MSG}" >"${LOG_FILE}" echo -e "${MSG}" >"${LOG_FILE}"
return 1 return 1
fi fi
@ -2437,14 +2439,26 @@ function advancedMenu() {
DIALOG --title "$(TEXT "Advanced")" \ DIALOG --title "$(TEXT "Advanced")" \
--yesno "$(TEXT "This option only installs opkg package management, allowing you to install more tools for use and debugging. Do you want to continue?")" 0 0 --yesno "$(TEXT "This option only installs opkg package management, allowing you to install more tools for use and debugging. Do you want to continue?")" 0 0
[ $? -ne 0 ] && return [ $? -ne 0 ] && return
( rm -f "${LOG_FILE}"
wget -O - http://bin.entware.net/x64-k3.2/installer/generic.sh | /bin/sh while true; do
opkg update wget http://bin.entware.net/x64-k3.2/installer/generic.sh -O "generic.sh" >"${LOG_FILE}"
#opkg install python3 python3-pip [ $? -ne 0 -o ! -f "generic.sh" ] && break
) 2>&1 | DIALOG --title "$(TEXT "Advanced")" \ chmod +x "generic.sh"
./generic.sh 2>"${LOG_FILE}"
[ $? -ne 0 ] && break
opkg update 2>"${LOG_FILE}"
[ $? -ne 0 ] && break
rm -f "generic.sh" "${LOG_FILE}"
break
done 2>&1 | DIALOG --title "$(TEXT "Advanced")" \
--progressbox "$(TEXT "opkg installing ...")" 20 100 --progressbox "$(TEXT "opkg installing ...")" 20 100
if [ -f "${LOG_FILE}" ]; then
MSG="$(TEXT "opkg install failed.")\n$(<"${LOG_FILE}"))"
else
MSG="$(TEXT "opkg install complete.")"
fi
DIALOG --title "$(TEXT "Advanced")" \ DIALOG --title "$(TEXT "Advanced")" \
--msgbox "$(TEXT "opkg install is complete. Please reconnect to ssh/web, or execute 'source ~/.bashrc'")" 0 0 --msgbox "${MSG}" 0 0
NEXT="e" NEXT="e"
;; ;;
p) p)
@ -2623,7 +2637,7 @@ function downloadExts() {
--progressbox "$(TEXT "Downloading ...")" 20 100 --progressbox "$(TEXT "Downloading ...")" 20 100
fi fi
if [ ${RET} -ne 0 -o ${STATUS:-0} -ne 200 ]; then if [ ${RET} -ne 0 -o ${STATUS:-0} -ne 200 ]; then
MSG="$(printf "$(TEXT "Error downloading new version.\nError: %d:%d")" "${RET}" "${STATUS}")" MSG="$(printf "$(TEXT "Error downloading new version.\nError: %d:%d\n(Please via https://curl.se/libcurl/c/libcurl-errors.html check error description.)")" "${RET}" "${STATUS}")"
if [ "${5}" = "-1" ]; then if [ "${5}" = "-1" ]; then
echo "${T} - ${MSG}" echo "${T} - ${MSG}"
elif [ "${5}" = "0" ]; then elif [ "${5}" = "0" ]; then
@ -3373,4 +3387,5 @@ else
done done
clear clear
echo -e "$(TEXT "Call \033[1;32mmenu.sh\033[0m to return to menu")" echo -e "$(TEXT "Call \033[1;32mmenu.sh\033[0m to return to menu")"
${WORK_PATH}/init.sh
fi fi