back wait ip timeout

This commit is contained in:
Ing 2023-09-13 05:10:16 +08:00
parent ac5953dce7
commit 9e50a71a6c
11 changed files with 1173 additions and 1111 deletions

View File

@ -178,7 +178,9 @@ else
echo "$(printf "$(TEXT "Detected %s network cards.")" "${#ETHX[@]}")"
echo "$(TEXT "Checking Connect.")"
COUNT=0
while [ ${COUNT} -lt 32 ]; do
BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")"
[ -z "${BOOTIPWAIT}" ] && BOOTIPWAIT=10
while [ ${COUNT} -lt $((${BOOTIPWAIT} + 32)) ]; do
hasConnect="false"
for N in $(seq 0 $(expr ${#ETHX[@]} - 1)); do
if ethtool ${ETHX[${N}]} | grep 'Link detected' | grep -q 'yes'; then
@ -208,8 +210,8 @@ else
echo -en "\r${ETHX[${N}]}(${DRIVER}): $(TEXT "NOT CONNECTED")\n"
break
fi
if [ ${COUNT} -eq 8 ]; then # Under normal circumstances, no errors should occur here.
echo -en "\r${ETHX[${N}]}(${DRIVER}): $(TEXT "TIMEOUT")\n"
if [ ${COUNT} -eq ${BOOTIPWAIT} ]; then # Under normal circumstances, no errors should occur here.
echo -en "\r${ETHX[${N}]}(${DRIVER}): $(TEXT "TIMEOUT (Please check the IP on the router.)")\n"
break
fi
COUNT=$((${COUNT} + 1))
@ -253,7 +255,7 @@ else
fi
echo -e "\033[1;37m$(TEXT "Booting...")\033[0m"
for T in $(w | grep -v "TTY" | awk -F' ' '{print $2}'); do
echo -e "\n\033[1;43m$(TEXT "[This interface will not be operational. Please use the http://find.synology.com/ find DSM and connect.]")\033[0m\n" >"/dev/${T}" 2>/dev/null || true
echo -e "\n\033[1;43m$(TEXT "[This interface will not be operational.\nPlease wait for a few minutes before using the http://find.synology.com/ or Synology Assistant find DSM and connect.]")\033[0m\n" >"/dev/${T}" 2>/dev/null || true
done
KERNELWAY="$(readConfigKey "kernelway" "${USER_CONFIG_FILE}")"
[ "${KERNELWAY}" = "kexec" ] && kexec -f -e || poweroff

View File

@ -80,7 +80,9 @@ if [ ! -f "${USER_CONFIG_FILE}" ]; then
writeConfigKey "notsetmacs" "false" "${USER_CONFIG_FILE}"
writeConfigKey "prerelease" "false" "${USER_CONFIG_FILE}"
writeConfigKey "bootwait" "10" "${USER_CONFIG_FILE}"
writeConfigKey "bootipwait" "10" "${USER_CONFIG_FILE}"
writeConfigKey "kernelway" "power" "${USER_CONFIG_FILE}"
writeConfigKey "odp" "false" "${USER_CONFIG_FILE}"
writeConfigKey "model" "" "${USER_CONFIG_FILE}"
writeConfigKey "productver" "" "${USER_CONFIG_FILE}"
writeConfigKey "buildnum" "" "${USER_CONFIG_FILE}"
@ -211,7 +213,7 @@ for N in $(seq 0 $(expr ${#ETHX[@]} - 1)); do
break
fi
if [ ${COUNT} -eq 15 ]; then
echo -en "\r${ETHX[${N}]}(${DRIVER}): $(TEXT "TIMEOUT")\n"
echo -en "\r${ETHX[${N}]}(${DRIVER}): $(TEXT "TIMEOUT (Please check the IP on the router.)")\n"
break
fi
COUNT=$((${COUNT} + 1))

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

@ -32,7 +32,9 @@ DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")"
NOTSETMACS="$(readConfigKey "notsetmacs" "${USER_CONFIG_FILE}")"
PRERELEASE="$(readConfigKey "prerelease" "${USER_CONFIG_FILE}")"
BOOTWAIT="$(readConfigKey "bootwait" "${USER_CONFIG_FILE}")"
BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")"
KERNELWAY="$(readConfigKey "kernelway" "${USER_CONFIG_FILE}")"
ODP="$(readConfigKey "odp" "${USER_CONFIG_FILE}")" # official drivers priorities
SN="$(readConfigKey "sn" "${USER_CONFIG_FILE}")"
###############################################################################
@ -420,6 +422,7 @@ function moduleMenu() {
d "$(TEXT "Deselect all modules")" \
c "$(TEXT "Choose modules to include")" \
o "$(TEXT "Upload a external module")" \
p "$(TEXT "Priority use of official drivers:") \Z4${ODP}\Zn" \
e "$(TEXT "Exit")" \
2>${TMP_PATH}/resp
[ $? -ne 0 ] && break
@ -528,6 +531,10 @@ function moduleMenu() {
--msgbox "$(TEXT "Not a valid file, please try again!")" 0 0
fi
;;
p)
[ "${ODP}" = "false" ] && ODP='true' || ODP='false'
writeConfigKey "odp" "${ODP}" "${USER_CONFIG_FILE}"
;;
e)
break
;;
@ -994,6 +1001,7 @@ function advancedMenu() {
if loaderIsConfigured; then
echo "q \"$(TEXT "Switch direct boot:") \Z4${DIRECTBOOT}\Zn\"" >>"${TMP_PATH}/menu"
if [ "${DIRECTBOOT}" = "false" ]; then
echo "i \"$(TEXT "Timeout of get ip in boot:") \Z4${BOOTIPWAIT}\Zn\"" >>"${TMP_PATH}/menu"
echo "w \"$(TEXT "Timeout of boot wait:") \Z4${BOOTWAIT}\Zn\"" >>"${TMP_PATH}/menu"
echo "k \"$(TEXT "kernel switching method:") \Z4${KERNELWAY}\Zn\"" >>"${TMP_PATH}/menu"
fi
@ -1036,6 +1044,18 @@ function advancedMenu() {
writeConfigKey "directboot" "${DIRECTBOOT}" "${USER_CONFIG_FILE}"
NEXT="e"
;;
i)
ITEMS="$(echo -e "1 \n5 \n10 \n30 \n60 \n")"
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \
--default-item "${BOOTIPWAIT}" --no-items --menu "$(TEXT "Choose a waiting time(seconds)")" 0 0 0 ${ITEMS} \
2>${TMP_PATH}/resp
[ $? -ne 0 ] && return
resp=$(cat ${TMP_PATH}/resp 2>/dev/null)
[ -z "${resp}" ] && return
BOOTIPWAIT=${resp}
writeConfigKey "bootipwait" "${BOOTIPWAIT}" "${USER_CONFIG_FILE}"
NEXT="e"
;;
w)
ITEMS="$(echo -e "1 \n5 \n10 \n30 \n60 \n")"
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \

View File

@ -39,6 +39,7 @@ LAYOUT="$(readConfigKey "layout" "${USER_CONFIG_FILE}")"
KEYMAP="$(readConfigKey "keymap" "${USER_CONFIG_FILE}")"
PATURL="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")"
PATSUM="$(readConfigKey "patsum" "${USER_CONFIG_FILE}")"
ODP="$(readConfigKey "odp" "${USER_CONFIG_FILE}")" # official drivers priorities
# Check if DSM buildnumber changed
. "${RAMDISK_PATH}/etc/VERSION"
@ -125,6 +126,7 @@ mkdir -p "${TMP_PATH}/modules"
tar -zxf "${MODULES_PATH}/${PLATFORM}-$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}.tgz" -C "${TMP_PATH}/modules"
for F in $(ls "${TMP_PATH}/modules/"*.ko); do
M=$(basename ${F})
[ "${ODP}" = "true" -a -f "${RAMDISK_PATH}/usr/lib/modules/${M}" ] && continue
if arrayExistItem "${M:0:-3}" "${!USERMODULES[@]}"; then
cp -f "${F}" "${RAMDISK_PATH}/usr/lib/modules/${M}"
else