mirror of
https://github.com/RROrg/rr.git
synced 2025-06-21 05:51:05 +08:00
Synoinfo entries unified:
Synoinfo entries from model config file are copyed to user config file when the user choose a build.
This commit is contained in:
parent
722c03a506
commit
5dc0b6e705
@ -14,7 +14,7 @@ To use this project, download the latest image available and burn it to a USB st
|
|||||||
|
|
||||||
The menu system is dynamic and I hope it is intuitive enough that the user can use it without any problems. Its allows you to choose a model, the existing buildnumber for the chosen model, type or randomly create a serial number, add/remove addons, add/remove/view "cmdline" and "synoinfo" entries, choose the LKM version, create the loader, boot, manually edit the configuration file, choose a keymap, update and exit.
|
The menu system is dynamic and I hope it is intuitive enough that the user can use it without any problems. Its allows you to choose a model, the existing buildnumber for the chosen model, type or randomly create a serial number, add/remove addons, add/remove/view "cmdline" and "synoinfo" entries, choose the LKM version, create the loader, boot, manually edit the configuration file, choose a keymap, update and exit.
|
||||||
|
|
||||||
Changing addons and synoinfo entries require re-creating the loader, cmdline entries do not. You can view the "cmdline" and "synoinfo" entries defined for the chosen model, with user-defined entries having higher priority.
|
Changing addons and synoinfo entries require re-creating the loader, cmdline entries do not.
|
||||||
|
|
||||||
There is no need to configure the VID/PID (if using a USB stick) or define the MAC Addresses of the network interfaces. If the user wants to modify the MAC Address of any interface, he must manually add "cmdline" entries in the corresponding menu (set "netif_num" according to "mac1..4" entries).
|
There is no need to configure the VID/PID (if using a USB stick) or define the MAC Addresses of the network interfaces. If the user wants to modify the MAC Address of any interface, he must manually add "cmdline" entries in the corresponding menu (set "netif_num" according to "mac1..4" entries).
|
||||||
|
|
||||||
|
2
TODO
2
TODO
@ -1,7 +1,6 @@
|
|||||||
A fazer
|
A fazer
|
||||||
- Descobrir como é o serial do DS2422+
|
- Descobrir como é o serial do DS2422+
|
||||||
- Estudar acrescentar modo simples e avançado do menu
|
- Estudar acrescentar modo simples e avançado do menu
|
||||||
- Mudar synoinfo para ler do modelo e preencher no user_config, para usuário poder deletar entradas do modelo
|
|
||||||
|
|
||||||
Concluidos:
|
Concluidos:
|
||||||
- Generalizar código dos addons
|
- Generalizar código dos addons
|
||||||
@ -27,3 +26,4 @@ Concluidos:
|
|||||||
- Mudar addons para colocar pacote completo na partição 3 e detectar dinâmicamente durante o boot do júnior
|
- Mudar addons para colocar pacote completo na partição 3 e detectar dinâmicamente durante o boot do júnior
|
||||||
- Acertar flag DIRTY ao atualizar módulos, etc
|
- Acertar flag DIRTY ao atualizar módulos, etc
|
||||||
- Consertar MAC custom
|
- Consertar MAC custom
|
||||||
|
- Mudar synoinfo para ler do modelo e preencher no user_config, para usuário poder deletar entradas do modelo
|
||||||
|
@ -104,9 +104,14 @@ function buildMenu() {
|
|||||||
if [ "${BUILD}" != "${resp}" ]; then
|
if [ "${BUILD}" != "${resp}" ]; then
|
||||||
BUILD=${resp}
|
BUILD=${resp}
|
||||||
writeConfigKey "build" "${BUILD}" "${USER_CONFIG_FILE}"
|
writeConfigKey "build" "${BUILD}" "${USER_CONFIG_FILE}"
|
||||||
DIRTY=1
|
# Delete synoinfo and reload model/build synoinfo
|
||||||
|
writeConfigKey "synoinfo" "{}" "${USER_CONFIG_FILE}"
|
||||||
|
while IFS="=" read KEY VALUE; do
|
||||||
|
writeConfigKey "synoinfo.${KEY}" "${VALUE}" "${USER_CONFIG_FILE}"
|
||||||
|
done < <(readModelMap "${MODEL}" "builds.${BUILD}.synoinfo")
|
||||||
# Remove old files
|
# Remove old files
|
||||||
rm -f "${ORI_ZIMAGE_FILE}" "${ORI_RDGZ_FILE}" "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}"
|
rm -f "${ORI_ZIMAGE_FILE}" "${ORI_RDGZ_FILE}" "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}"
|
||||||
|
DIRTY=1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,8 +391,7 @@ function synoinfoMenu() {
|
|||||||
if [ "${DT}" != "true" ]; then
|
if [ "${DT}" != "true" ]; then
|
||||||
echo "x \"Set maxdisks manually\"" >> "${TMP_PATH}/menu"
|
echo "x \"Set maxdisks manually\"" >> "${TMP_PATH}/menu"
|
||||||
fi
|
fi
|
||||||
echo "s \"Show user synoinfo\"" >> "${TMP_PATH}/menu"
|
echo "s \"Show synoinfo entries\"" >> "${TMP_PATH}/menu"
|
||||||
echo "m \"Show model/build synoinfo\"" >> "${TMP_PATH}/menu"
|
|
||||||
echo "e \"Exit\"" >> "${TMP_PATH}/menu"
|
echo "e \"Exit\"" >> "${TMP_PATH}/menu"
|
||||||
|
|
||||||
# menu loop
|
# menu loop
|
||||||
@ -397,13 +401,13 @@ function synoinfoMenu() {
|
|||||||
[ $? -ne 0 ] && return
|
[ $? -ne 0 ] && return
|
||||||
case "`<${TMP_PATH}/resp`" in
|
case "`<${TMP_PATH}/resp`" in
|
||||||
a)
|
a)
|
||||||
dialog --backtitle "`backtitle`" --title "User synoinfo" \
|
dialog --backtitle "`backtitle`" --title "Synoinfo entries" \
|
||||||
--inputbox "Type a name of synoinfo variable" 0 0 \
|
--inputbox "Type a name of synoinfo entry" 0 0 \
|
||||||
2>${TMP_PATH}/resp
|
2>${TMP_PATH}/resp
|
||||||
[ $? -ne 0 ] && continue
|
[ $? -ne 0 ] && continue
|
||||||
NAME="`sed 's/://g' <"${TMP_PATH}/resp"`"
|
NAME="`sed 's/://g' <"${TMP_PATH}/resp"`"
|
||||||
dialog --backtitle "`backtitle`" --title "User synoinfo" \
|
dialog --backtitle "`backtitle`" --title "Synoinfo entries" \
|
||||||
--inputbox "Type a value of '${NAME}' variable" 0 0 "${SYNOINFO[${NAME}]}" \
|
--inputbox "Type a value of '${NAME}' entry" 0 0 "${SYNOINFO[${NAME}]}" \
|
||||||
2>${TMP_PATH}/resp
|
2>${TMP_PATH}/resp
|
||||||
[ $? -ne 0 ] && continue
|
[ $? -ne 0 ] && continue
|
||||||
VALUE="`<"${TMP_PATH}/resp"`"
|
VALUE="`<"${TMP_PATH}/resp"`"
|
||||||
@ -413,7 +417,7 @@ function synoinfoMenu() {
|
|||||||
;;
|
;;
|
||||||
d)
|
d)
|
||||||
if [ ${#SYNOINFO[@]} -eq 0 ]; then
|
if [ ${#SYNOINFO[@]} -eq 0 ]; then
|
||||||
dialog --backtitle "`backtitle`" --msgbox "No user synoinfo to remove" 0 0
|
dialog --backtitle "`backtitle`" --msgbox "No synoinfo entries to remove" 0 0
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
ITEMS=""
|
ITEMS=""
|
||||||
@ -421,7 +425,7 @@ function synoinfoMenu() {
|
|||||||
ITEMS+="${I} ${SYNOINFO[${I}]} off "
|
ITEMS+="${I} ${SYNOINFO[${I}]} off "
|
||||||
done
|
done
|
||||||
dialog --backtitle "`backtitle`" \
|
dialog --backtitle "`backtitle`" \
|
||||||
--checklist "Select synoinfo to remove" 0 0 0 ${ITEMS} \
|
--checklist "Select synoinfo entry to remove" 0 0 0 ${ITEMS} \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
[ $? -ne 0 ] && continue
|
[ $? -ne 0 ] && continue
|
||||||
RESP=`<"${TMP_PATH}/resp"`
|
RESP=`<"${TMP_PATH}/resp"`
|
||||||
@ -446,15 +450,7 @@ function synoinfoMenu() {
|
|||||||
for KEY in ${!SYNOINFO[@]}; do
|
for KEY in ${!SYNOINFO[@]}; do
|
||||||
ITEMS+="${KEY}: ${SYNOINFO[$KEY]}\n"
|
ITEMS+="${KEY}: ${SYNOINFO[$KEY]}\n"
|
||||||
done
|
done
|
||||||
dialog --backtitle "`backtitle`" --title "User synoinfo" \
|
dialog --backtitle "`backtitle`" --title "Synoinfo entries" \
|
||||||
--aspect 18 --msgbox "${ITEMS}" 0 0
|
|
||||||
;;
|
|
||||||
m)
|
|
||||||
ITEMS=""
|
|
||||||
while IFS="=" read KEY VALUE; do
|
|
||||||
ITEMS+="${KEY}: ${VALUE}\n"
|
|
||||||
done < <(readModelMap "${MODEL}" "builds.${BUILD}.synoinfo")
|
|
||||||
dialog --backtitle "`backtitle`" --title "Model/build synoinfo" \
|
|
||||||
--aspect 18 --msgbox "${ITEMS}" 0 0
|
--aspect 18 --msgbox "${ITEMS}" 0 0
|
||||||
;;
|
;;
|
||||||
e) return ;;
|
e) return ;;
|
||||||
|
@ -44,10 +44,7 @@ RD_COMPRESSED="`readModelKey "${MODEL}" "builds.${BUILD}.rd-compressed"`"
|
|||||||
declare -A SYNOINFO
|
declare -A SYNOINFO
|
||||||
declare -A ADDONS
|
declare -A ADDONS
|
||||||
|
|
||||||
# Read more config
|
# Read synoinfo and addons from config
|
||||||
while IFS="=" read KEY VALUE; do
|
|
||||||
[ -n "${KEY}" ] && SYNOINFO["${KEY}"]="${VALUE}"
|
|
||||||
done < <(readModelMap "${MODEL}" "builds.${BUILD}.synoinfo")
|
|
||||||
while IFS="=" read KEY VALUE; do
|
while IFS="=" read KEY VALUE; do
|
||||||
[ -n "${KEY}" ] && SYNOINFO["${KEY}"]="${VALUE}"
|
[ -n "${KEY}" ] && SYNOINFO["${KEY}"]="${VALUE}"
|
||||||
done < <(readConfigMap "synoinfo" "${USER_CONFIG_FILE}")
|
done < <(readConfigMap "synoinfo" "${USER_CONFIG_FILE}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user