mirror of
https://github.com/RROrg/rr.git
synced 2025-06-21 05:51:05 +08:00
back wait ip timeout
This commit is contained in:
parent
ac5953dce7
commit
9e50a71a6c
@ -178,7 +178,9 @@ else
|
|||||||
echo "$(printf "$(TEXT "Detected %s network cards.")" "${#ETHX[@]}")"
|
echo "$(printf "$(TEXT "Detected %s network cards.")" "${#ETHX[@]}")"
|
||||||
echo "$(TEXT "Checking Connect.")"
|
echo "$(TEXT "Checking Connect.")"
|
||||||
COUNT=0
|
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"
|
hasConnect="false"
|
||||||
for N in $(seq 0 $(expr ${#ETHX[@]} - 1)); do
|
for N in $(seq 0 $(expr ${#ETHX[@]} - 1)); do
|
||||||
if ethtool ${ETHX[${N}]} | grep 'Link detected' | grep -q 'yes'; then
|
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"
|
echo -en "\r${ETHX[${N}]}(${DRIVER}): $(TEXT "NOT CONNECTED")\n"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
if [ ${COUNT} -eq 8 ]; then # Under normal circumstances, no errors should occur here.
|
if [ ${COUNT} -eq ${BOOTIPWAIT} ]; then # Under normal circumstances, no errors should occur here.
|
||||||
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
|
break
|
||||||
fi
|
fi
|
||||||
COUNT=$((${COUNT} + 1))
|
COUNT=$((${COUNT} + 1))
|
||||||
@ -253,7 +255,7 @@ else
|
|||||||
fi
|
fi
|
||||||
echo -e "\033[1;37m$(TEXT "Booting...")\033[0m"
|
echo -e "\033[1;37m$(TEXT "Booting...")\033[0m"
|
||||||
for T in $(w | grep -v "TTY" | awk -F' ' '{print $2}'); do
|
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
|
done
|
||||||
KERNELWAY="$(readConfigKey "kernelway" "${USER_CONFIG_FILE}")"
|
KERNELWAY="$(readConfigKey "kernelway" "${USER_CONFIG_FILE}")"
|
||||||
[ "${KERNELWAY}" = "kexec" ] && kexec -f -e || poweroff
|
[ "${KERNELWAY}" = "kexec" ] && kexec -f -e || poweroff
|
||||||
|
@ -80,7 +80,9 @@ if [ ! -f "${USER_CONFIG_FILE}" ]; then
|
|||||||
writeConfigKey "notsetmacs" "false" "${USER_CONFIG_FILE}"
|
writeConfigKey "notsetmacs" "false" "${USER_CONFIG_FILE}"
|
||||||
writeConfigKey "prerelease" "false" "${USER_CONFIG_FILE}"
|
writeConfigKey "prerelease" "false" "${USER_CONFIG_FILE}"
|
||||||
writeConfigKey "bootwait" "10" "${USER_CONFIG_FILE}"
|
writeConfigKey "bootwait" "10" "${USER_CONFIG_FILE}"
|
||||||
|
writeConfigKey "bootipwait" "10" "${USER_CONFIG_FILE}"
|
||||||
writeConfigKey "kernelway" "power" "${USER_CONFIG_FILE}"
|
writeConfigKey "kernelway" "power" "${USER_CONFIG_FILE}"
|
||||||
|
writeConfigKey "odp" "false" "${USER_CONFIG_FILE}"
|
||||||
writeConfigKey "model" "" "${USER_CONFIG_FILE}"
|
writeConfigKey "model" "" "${USER_CONFIG_FILE}"
|
||||||
writeConfigKey "productver" "" "${USER_CONFIG_FILE}"
|
writeConfigKey "productver" "" "${USER_CONFIG_FILE}"
|
||||||
writeConfigKey "buildnum" "" "${USER_CONFIG_FILE}"
|
writeConfigKey "buildnum" "" "${USER_CONFIG_FILE}"
|
||||||
@ -211,7 +213,7 @@ for N in $(seq 0 $(expr ${#ETHX[@]} - 1)); do
|
|||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
if [ ${COUNT} -eq 15 ]; then
|
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
|
break
|
||||||
fi
|
fi
|
||||||
COUNT=$((${COUNT} + 1))
|
COUNT=$((${COUNT} + 1))
|
||||||
|
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.
File diff suppressed because it is too large
Load Diff
@ -32,7 +32,9 @@ DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")"
|
|||||||
NOTSETMACS="$(readConfigKey "notsetmacs" "${USER_CONFIG_FILE}")"
|
NOTSETMACS="$(readConfigKey "notsetmacs" "${USER_CONFIG_FILE}")"
|
||||||
PRERELEASE="$(readConfigKey "prerelease" "${USER_CONFIG_FILE}")"
|
PRERELEASE="$(readConfigKey "prerelease" "${USER_CONFIG_FILE}")"
|
||||||
BOOTWAIT="$(readConfigKey "bootwait" "${USER_CONFIG_FILE}")"
|
BOOTWAIT="$(readConfigKey "bootwait" "${USER_CONFIG_FILE}")"
|
||||||
|
BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")"
|
||||||
KERNELWAY="$(readConfigKey "kernelway" "${USER_CONFIG_FILE}")"
|
KERNELWAY="$(readConfigKey "kernelway" "${USER_CONFIG_FILE}")"
|
||||||
|
ODP="$(readConfigKey "odp" "${USER_CONFIG_FILE}")" # official drivers priorities
|
||||||
SN="$(readConfigKey "sn" "${USER_CONFIG_FILE}")"
|
SN="$(readConfigKey "sn" "${USER_CONFIG_FILE}")"
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@ -420,6 +422,7 @@ function moduleMenu() {
|
|||||||
d "$(TEXT "Deselect all modules")" \
|
d "$(TEXT "Deselect all modules")" \
|
||||||
c "$(TEXT "Choose modules to include")" \
|
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" \
|
||||||
e "$(TEXT "Exit")" \
|
e "$(TEXT "Exit")" \
|
||||||
2>${TMP_PATH}/resp
|
2>${TMP_PATH}/resp
|
||||||
[ $? -ne 0 ] && break
|
[ $? -ne 0 ] && break
|
||||||
@ -528,6 +531,10 @@ function moduleMenu() {
|
|||||||
--msgbox "$(TEXT "Not a valid file, please try again!")" 0 0
|
--msgbox "$(TEXT "Not a valid file, please try again!")" 0 0
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
p)
|
||||||
|
[ "${ODP}" = "false" ] && ODP='true' || ODP='false'
|
||||||
|
writeConfigKey "odp" "${ODP}" "${USER_CONFIG_FILE}"
|
||||||
|
;;
|
||||||
e)
|
e)
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
@ -994,6 +1001,7 @@ function advancedMenu() {
|
|||||||
if loaderIsConfigured; then
|
if loaderIsConfigured; then
|
||||||
echo "q \"$(TEXT "Switch direct boot:") \Z4${DIRECTBOOT}\Zn\"" >>"${TMP_PATH}/menu"
|
echo "q \"$(TEXT "Switch direct boot:") \Z4${DIRECTBOOT}\Zn\"" >>"${TMP_PATH}/menu"
|
||||||
if [ "${DIRECTBOOT}" = "false" ]; then
|
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 "w \"$(TEXT "Timeout of boot wait:") \Z4${BOOTWAIT}\Zn\"" >>"${TMP_PATH}/menu"
|
||||||
echo "k \"$(TEXT "kernel switching method:") \Z4${KERNELWAY}\Zn\"" >>"${TMP_PATH}/menu"
|
echo "k \"$(TEXT "kernel switching method:") \Z4${KERNELWAY}\Zn\"" >>"${TMP_PATH}/menu"
|
||||||
fi
|
fi
|
||||||
@ -1036,6 +1044,18 @@ function advancedMenu() {
|
|||||||
writeConfigKey "directboot" "${DIRECTBOOT}" "${USER_CONFIG_FILE}"
|
writeConfigKey "directboot" "${DIRECTBOOT}" "${USER_CONFIG_FILE}"
|
||||||
NEXT="e"
|
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)
|
w)
|
||||||
ITEMS="$(echo -e "1 \n5 \n10 \n30 \n60 \n")"
|
ITEMS="$(echo -e "1 \n5 \n10 \n30 \n60 \n")"
|
||||||
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \
|
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \
|
||||||
|
@ -39,6 +39,7 @@ LAYOUT="$(readConfigKey "layout" "${USER_CONFIG_FILE}")"
|
|||||||
KEYMAP="$(readConfigKey "keymap" "${USER_CONFIG_FILE}")"
|
KEYMAP="$(readConfigKey "keymap" "${USER_CONFIG_FILE}")"
|
||||||
PATURL="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")"
|
PATURL="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")"
|
||||||
PATSUM="$(readConfigKey "patsum" "${USER_CONFIG_FILE}")"
|
PATSUM="$(readConfigKey "patsum" "${USER_CONFIG_FILE}")"
|
||||||
|
ODP="$(readConfigKey "odp" "${USER_CONFIG_FILE}")" # official drivers priorities
|
||||||
|
|
||||||
# Check if DSM buildnumber changed
|
# Check if DSM buildnumber changed
|
||||||
. "${RAMDISK_PATH}/etc/VERSION"
|
. "${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"
|
tar -zxf "${MODULES_PATH}/${PLATFORM}-$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}.tgz" -C "${TMP_PATH}/modules"
|
||||||
for F in $(ls "${TMP_PATH}/modules/"*.ko); do
|
for F in $(ls "${TMP_PATH}/modules/"*.ko); do
|
||||||
M=$(basename ${F})
|
M=$(basename ${F})
|
||||||
|
[ "${ODP}" = "true" -a -f "${RAMDISK_PATH}/usr/lib/modules/${M}" ] && continue
|
||||||
if arrayExistItem "${M:0:-3}" "${!USERMODULES[@]}"; then
|
if arrayExistItem "${M:0:-3}" "${!USERMODULES[@]}"; then
|
||||||
cp -f "${F}" "${RAMDISK_PATH}/usr/lib/modules/${M}"
|
cp -f "${F}" "${RAMDISK_PATH}/usr/lib/modules/${M}"
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user