Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #49 from fbelavenuto/dev
Browse files Browse the repository at this point in the history
Synoinfo entries unified
  • Loading branch information
fbelavenuto authored Jul 21, 2022
2 parents ea67f64 + 5dc0b6e commit ce5f427
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

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).

Expand Down
2 changes: 1 addition & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
A fazer
- Descobrir como é o serial do DS2422+
- 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:
- Generalizar código dos addons
Expand All @@ -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
- Acertar flag DIRTY ao atualizar módulos, etc
- Consertar MAC custom
- Mudar synoinfo para ler do modelo e preencher no user_config, para usuário poder deletar entradas do modelo
32 changes: 14 additions & 18 deletions files/board/arpl/overlayfs/opt/arpl/menu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,14 @@ function buildMenu() {
if [ "${BUILD}" != "${resp}" ]; then
BUILD=${resp}
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
rm -f "${ORI_ZIMAGE_FILE}" "${ORI_RDGZ_FILE}" "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}"
DIRTY=1
fi
}

Expand Down Expand Up @@ -386,8 +391,7 @@ function synoinfoMenu() {
if [ "${DT}" != "true" ]; then
echo "x \"Set maxdisks manually\"" >> "${TMP_PATH}/menu"
fi
echo "s \"Show user synoinfo\"" >> "${TMP_PATH}/menu"
echo "m \"Show model/build synoinfo\"" >> "${TMP_PATH}/menu"
echo "s \"Show synoinfo entries\"" >> "${TMP_PATH}/menu"
echo "e \"Exit\"" >> "${TMP_PATH}/menu"

# menu loop
Expand All @@ -397,13 +401,13 @@ function synoinfoMenu() {
[ $? -ne 0 ] && return
case "`<${TMP_PATH}/resp`" in
a)
dialog --backtitle "`backtitle`" --title "User synoinfo" \
--inputbox "Type a name of synoinfo variable" 0 0 \
dialog --backtitle "`backtitle`" --title "Synoinfo entries" \
--inputbox "Type a name of synoinfo entry" 0 0 \
2>${TMP_PATH}/resp
[ $? -ne 0 ] && continue
NAME="`sed 's/://g' <"${TMP_PATH}/resp"`"
dialog --backtitle "`backtitle`" --title "User synoinfo" \
--inputbox "Type a value of '${NAME}' variable" 0 0 "${SYNOINFO[${NAME}]}" \
dialog --backtitle "`backtitle`" --title "Synoinfo entries" \
--inputbox "Type a value of '${NAME}' entry" 0 0 "${SYNOINFO[${NAME}]}" \
2>${TMP_PATH}/resp
[ $? -ne 0 ] && continue
VALUE="`<"${TMP_PATH}/resp"`"
Expand All @@ -413,15 +417,15 @@ function synoinfoMenu() {
;;
d)
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
fi
ITEMS=""
for I in "${!SYNOINFO[@]}"; do
ITEMS+="${I} ${SYNOINFO[${I}]} off "
done
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"
[ $? -ne 0 ] && continue
RESP=`<"${TMP_PATH}/resp"`
Expand All @@ -446,15 +450,7 @@ function synoinfoMenu() {
for KEY in ${!SYNOINFO[@]}; do
ITEMS+="${KEY}: ${SYNOINFO[$KEY]}\n"
done
dialog --backtitle "`backtitle`" --title "User synoinfo" \
--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" \
dialog --backtitle "`backtitle`" --title "Synoinfo entries" \
--aspect 18 --msgbox "${ITEMS}" 0 0
;;
e) return ;;
Expand Down
5 changes: 1 addition & 4 deletions files/board/arpl/overlayfs/opt/arpl/ramdisk-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ RD_COMPRESSED="`readModelKey "${MODEL}" "builds.${BUILD}.rd-compressed"`"
declare -A SYNOINFO
declare -A ADDONS

# Read more config
while IFS="=" read KEY VALUE; do
[ -n "${KEY}" ] && SYNOINFO["${KEY}"]="${VALUE}"
done < <(readModelMap "${MODEL}" "builds.${BUILD}.synoinfo")
# Read synoinfo and addons from config
while IFS="=" read KEY VALUE; do
[ -n "${KEY}" ] && SYNOINFO["${KEY}"]="${VALUE}"
done < <(readConfigMap "synoinfo" "${USER_CONFIG_FILE}")
Expand Down

0 comments on commit ce5f427

Please sign in to comment.