mirror of
https://github.com/RROrg/rr.git
synced 2025-06-21 05:51:05 +08:00
优化 GPU 相关数组定义
This commit is contained in:
parent
1baac66eba
commit
f1cc7c20a1
@ -234,7 +234,7 @@ function _get_fastest() {
|
||||
URL="$(echo "${fastest}" | awk '{print $1}')"
|
||||
SPD="$(echo "${fastest}" | awk '{print $2}')" # It is a float type
|
||||
echo "${URL:-${1}}"
|
||||
[ "$(echo "${SPD:-999}" | cut -d. -f1)" -ge 999 ] && return 1 || return 0
|
||||
[ "$(echo "${SPD:-999}" | cut -d'.' -f1)" -ge 999 ] && return 1 || return 0
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
@ -301,11 +301,11 @@ function getBus() {
|
||||
function getIP() {
|
||||
local IP=""
|
||||
if [ -n "${1}" ] && [ -d "/sys/class/net/${1}" ]; then
|
||||
IP=$(ip route show dev "${1}" 2>/dev/null | sed -n 's/.* via .* src \(.*\) metric .*/\1/p')
|
||||
[ -z "${IP}" ] && IP=$(ip addr show "${1}" scope global 2>/dev/null | grep -E "inet .* eth" | awk '{print $2}' | cut -f1 -d'/' | head -1)
|
||||
IP=$(ip route show dev "${1}" 2>/dev/null | sed -n 's/.* via .* src \(.*\) metric .*/\1/p' | head -1)
|
||||
[ -z "${IP}" ] && IP=$(ip addr show "${1}" scope global 2>/dev/null | grep -E "inet .* eth" | awk '{print $2}' | cut -d'/' -f1 | head -1)
|
||||
else
|
||||
IP=$(ip route show 2>/dev/null | sed -n 's/.* via .* src \(.*\) metric .*/\1/p' | head -1)
|
||||
[ -z "${IP}" ] && IP=$(ip addr show scope global 2>/dev/null | grep -E "inet .* eth" | awk '{print $2}' | cut -f1 -d'/' | head -1)
|
||||
[ -z "${IP}" ] && IP=$(ip addr show scope global 2>/dev/null | grep -E "inet .* eth" | awk '{print $2}' | cut -d'/' -f1 | head -1)
|
||||
fi
|
||||
echo "${IP}"
|
||||
return 0
|
||||
|
@ -150,7 +150,8 @@ function modelMenu() {
|
||||
while true; do
|
||||
rm -f "${TMP_PATH}/menu"
|
||||
FLGNEX=0
|
||||
IGPUPS=(apollolake geminilake)
|
||||
IGPU1L=(apollolake geminilake epyc7002)
|
||||
IGPU2L=(epyc7002)
|
||||
IGPUID="$(lspci -nd ::300 2>/dev/null | grep "8086" | cut -d' ' -f3 | sed 's/://g')"
|
||||
NVMEMS=(DS918+ RS1619xs+ DS419+ DS1019+ DS719+ DS1621xs+)
|
||||
NVMEMD=$(find /sys/devices -type d -name nvme | awk -F'/' '{print NF}' | sort -n | tail -n1)
|
||||
@ -170,8 +171,8 @@ function modelMenu() {
|
||||
fi
|
||||
unset DT G N H
|
||||
[ "$(readConfigKey "platforms.${A}.dt" "${WORK_PATH}/platforms.yml")" = "true" ] && DT="DT" || DT=""
|
||||
[ -z "${G}" ] && [ ${hasiGPU} -eq 1 ] && echo "${IGPUPS[@]}" | grep -wq "${A}" && G="G"
|
||||
[ -z "${G}" ] && [ ${hasiGPU} -eq 2 ] && echo "epyc7002" | grep -wq "${A}" && G="G"
|
||||
[ -z "${G}" ] && [ ${hasiGPU} -eq 1 ] && echo "${IGPU1L[@]}" | grep -wq "${A}" && G="G"
|
||||
[ -z "${G}" ] && [ ${hasiGPU} -eq 2 ] && echo "${IGPU2L[@]}" | grep -wq "${A}" && G="G"
|
||||
[ -z "${N}" ] && [ ${hasNVME} -ne 0 ] && [ "${DT}" = "DT" ] && N="N"
|
||||
[ -z "${N}" ] && [ ${hasNVME} -eq 2 ] && echo "${NVMEMS[@]}" | grep -wq "${M}" && N="N"
|
||||
[ -z "${H}" ] && [ ${hasHBA} -eq 1 ] && [ ! "${DT}" = "DT" ] && H="H"
|
||||
@ -2161,7 +2162,7 @@ function languageMenu() {
|
||||
###############################################################################
|
||||
# Choose a timezone
|
||||
function timezoneMenu() {
|
||||
OPTIONS="$(find /usr/share/zoneinfo/right -type f | cut -d '/' -f 6- | sort | uniq | xargs)"
|
||||
OPTIONS="$(find /usr/share/zoneinfo/right -type f | cut -d'/' -f6- | sort | uniq | xargs)"
|
||||
DIALOG --title "$(TEXT "Settings")" \
|
||||
--default-item "${LAYOUT}" --no-items --menu "$(TEXT "Choose a timezone")" 0 0 20 ${OPTIONS} \
|
||||
2>"${TMP_PATH}/resp"
|
||||
|
Loading…
x
Reference in New Issue
Block a user