From 0b344ac8af76970ac31a23333eb00f9fbf061f7f Mon Sep 17 00:00:00 2001 From: Ing Date: Sat, 27 May 2023 11:48:32 +0800 Subject: [PATCH] When there is no custom macs, remove the incoming data in cmdline. --- files/board/arpl/overlayfs/opt/arpl/boot.sh | 35 ++++++++++-------- .../arpl/overlayfs/opt/arpl/lang/arpl.pot | 30 +++++++++------ .../arpl/overlayfs/opt/arpl/lang/zh_CN.mo | Bin 19830 -> 20015 bytes .../arpl/overlayfs/opt/arpl/lang/zh_CN.po | 32 +++++++++------- 4 files changed, 56 insertions(+), 41 deletions(-) diff --git a/files/board/arpl/overlayfs/opt/arpl/boot.sh b/files/board/arpl/overlayfs/opt/arpl/boot.sh index 4c982a2b..b72b9fe2 100755 --- a/files/board/arpl/overlayfs/opt/arpl/boot.sh +++ b/files/board/arpl/overlayfs/opt/arpl/boot.sh @@ -60,7 +60,7 @@ fi declare -A CMDLINE # Fixed values -CMDLINE['netif_num']=0 +#CMDLINE['netif_num']=0 # Automatic values CMDLINE['syno_hw_version']="${MODEL}" [ -z "${VID}" ] && VID="0x0000" # Sanity check @@ -97,22 +97,25 @@ for N in `seq 1 8`; do # Currently, only up to 8 are supported. (<==> menu.sh [ -n "${CMDLINE["mac${N}"]}" ] && MACS+=(${CMDLINE["mac${N}"]}) done NETIF_NUM=${#MACS[*]} -# set netif_num to custom mac amount, netif_num must be equal to the MACX amount, otherwise the kernel will panic. -CMDLINE["netif_num"]=${NETIF_NUM} # The current original CMDLINE['netif_num'] is no longer in use, Consider deleting. -# real network cards amount -NETRL_NUM=`ls /sys/class/net/ | grep eth | wc -l` -if [ ${NETIF_NUM} -le ${NETRL_NUM} ]; then - echo -e "\033[1;33m*** `printf "$(TEXT "Detected %s network cards, but only %s MACs were customized, the rest will use the original MACs.")" "${NETRL_NUM}" "${CMDLINE["netif_num"]}"` ***\033[0m" - ETHX=(`ls /sys/class/net/ | grep eth`) # real network cards list - for N in `seq $(expr ${NETIF_NUM} + 1) ${NETRL_NUM}`; do - MACR="`cat /sys/class/net/${ETHX[$(expr ${N} - 1)]}/address | sed 's/://g'`" - # no duplicates - while [[ "${MACS[*]}" =~ "$MACR" ]]; do # no duplicates - MACR="${MACR:0:10}`printf "%02x" $((0x${MACR:10:2} + 1))`" +NETRL_NUM=`ls /sys/class/net/ | grep eth | wc -l` # real network cards amount +if [ ${NETIF_NUM} -eq 0 ]; then + echo -e "\033[1;33m*** `printf "$(TEXT "Detected %s network cards, but No MACs were customized, they will use the original MACs.")" "${NETRL_NUM}"` ***\033[0m" +else + # set netif_num to custom mac amount, netif_num must be equal to the MACX amount, otherwise the kernel will panic. + CMDLINE["netif_num"]=${NETIF_NUM} # The current original CMDLINE['netif_num'] is no longer in use, Consider deleting. + if [ ${NETIF_NUM} -le ${NETRL_NUM} ]; then + echo -e "\033[1;33m*** `printf "$(TEXT "Detected %s network cards, but only %s MACs were customized, the rest will use the original MACs.")" "${NETRL_NUM}" "${CMDLINE["netif_num"]}"` ***\033[0m" + ETHX=(`ls /sys/class/net/ | grep eth`) # real network cards list + for N in `seq $(expr ${NETIF_NUM} + 1) ${NETRL_NUM}`; do + MACR="`cat /sys/class/net/${ETHX[$(expr ${N} - 1)]}/address | sed 's/://g'`" + # no duplicates + while [[ "${MACS[*]}" =~ "$MACR" ]]; do # no duplicates + MACR="${MACR:0:10}`printf "%02x" $((0x${MACR:10:2} + 1))`" + done + CMDLINE["mac${N}"]="${MACR}" done - CMDLINE["mac${N}"]="${MACR}" - done - CMDLINE["netif_num"]=${NETRL_NUM} + CMDLINE["netif_num"]=${NETRL_NUM} + fi fi # Prepare command line diff --git a/files/board/arpl/overlayfs/opt/arpl/lang/arpl.pot b/files/board/arpl/overlayfs/opt/arpl/lang/arpl.pot index e07ceb38..d2ef5e3b 100644 --- a/files/board/arpl/overlayfs/opt/arpl/lang/arpl.pot +++ b/files/board/arpl/overlayfs/opt/arpl/lang/arpl.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-22 13:55+0800\n" +"POT-Creation-Date: 2023-05-27 11:44+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -63,49 +63,55 @@ msgid "" "The current version of arpl does not support booting %s-%s, please rebuild." msgstr "" -#: boot.sh:105 +#: boot.sh:102 +msgid "" +"Detected %s network cards, but No MACs were customized, they will use the " +"original MACs." +msgstr "" + +#: boot.sh:107 msgid "" "Detected %s network cards, but only %s MACs were customized, the rest will " "use the original MACs." msgstr "" -#: boot.sh:135 +#: boot.sh:138 msgid "Cmdline:\\n" msgstr "" -#: boot.sh:140 +#: boot.sh:143 msgid "Reboot to boot directly in DSM" msgstr "" -#: boot.sh:146 init.sh:175 +#: boot.sh:149 init.sh:175 msgid "Detected %s network cards, Waiting IP." msgstr "" -#: boot.sh:152 init.sh:181 +#: boot.sh:155 init.sh:181 msgid "DOWN" msgstr "" -#: boot.sh:156 init.sh:185 +#: boot.sh:159 init.sh:185 msgid "ERROR" msgstr "" -#: boot.sh:162 +#: boot.sh:165 msgid "Access \\033[1;34mhttp://%s:5000\\033[0m to connect the DSM via web." msgstr "" -#: boot.sh:171 +#: boot.sh:174 msgid "Loading DSM kernel..." msgstr "" -#: boot.sh:175 +#: boot.sh:178 msgid "Warning, running kexec with --noefi param, strange things will happen!!" msgstr "" -#: boot.sh:180 +#: boot.sh:183 msgid "Booting..." msgstr "" -#: boot.sh:183 +#: boot.sh:186 msgid "" "[This interface will not be operational. Please use the http://find.synology." "com/ find DSM and connect.]" diff --git a/files/board/arpl/overlayfs/opt/arpl/lang/zh_CN.mo b/files/board/arpl/overlayfs/opt/arpl/lang/zh_CN.mo index eca42baf9ac3221eafe3d5e53134bed4f4117cab..07e3b9eaf04855fd2fbd629e95715e549fb04ab8 100644 GIT binary patch delta 5312 zcmZA334D+D0mt!Qh@_z+33Bk43sEGRMB+&53N~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/arpl/overlayfs/opt/arpl/lang/zh_CN.po b/files/board/arpl/overlayfs/opt/arpl/lang/zh_CN.po index 9575bdde..2490662a 100644 --- a/files/board/arpl/overlayfs/opt/arpl/lang/zh_CN.po +++ b/files/board/arpl/overlayfs/opt/arpl/lang/zh_CN.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: arpl-i18n\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-22 13:55+0800\n" -"PO-Revision-Date: 2023-05-22 13:56+0800\n" +"POT-Creation-Date: 2023-05-27 11:44+0800\n" +"PO-Revision-Date: 2023-05-27 11:45+0800\n" "Last-Translator: ing \n" "Language-Team: Chinese (simplified) \n" "Language: zh_CN\n" @@ -62,49 +62,55 @@ msgid "" "The current version of arpl does not support booting %s-%s, please rebuild." msgstr "当前版本的arpl不支持引导 %s-%s, 请重新编译." -#: boot.sh:105 +#: boot.sh:102 +msgid "" +"Detected %s network cards, but No MACs were customized, they will use the " +"original MACs." +msgstr "检测到 %s 个网卡, 但是没有自定义 MACs, 它们将使用自身 MACs." + +#: boot.sh:107 msgid "" "Detected %s network cards, but only %s MACs were customized, the rest will " "use the original MACs." msgstr "检测到 %s 个网卡, 但是仅自定义了 %s 个 MACs, 其他网卡将使用自身 MACs." -#: boot.sh:135 +#: boot.sh:138 msgid "Cmdline:\\n" msgstr "Cmdline:\\n" -#: boot.sh:140 +#: boot.sh:143 msgid "Reboot to boot directly in DSM" msgstr "重启并直接进入DSM引导" -#: boot.sh:146 init.sh:175 +#: boot.sh:149 init.sh:175 msgid "Detected %s network cards, Waiting IP." msgstr "检测到 %s 个网卡, 获取 IP." -#: boot.sh:152 init.sh:181 +#: boot.sh:155 init.sh:181 msgid "DOWN" msgstr "卸载" -#: boot.sh:156 init.sh:185 +#: boot.sh:159 init.sh:185 msgid "ERROR" msgstr "错误" -#: boot.sh:162 +#: boot.sh:165 msgid "Access \\033[1;34mhttp://%s:5000\\033[0m to connect the DSM via web." msgstr "在浏览器中访问 \\033[1;34mhttp://%s:5000\\033[0m 链接 DSM." -#: boot.sh:171 +#: boot.sh:174 msgid "Loading DSM kernel..." msgstr "加载 DSM kernel..." -#: boot.sh:175 +#: boot.sh:178 msgid "Warning, running kexec with --noefi param, strange things will happen!!" msgstr "警告, 使用'--noefi'参数运行'kexec', 可能有不好的事情发生!!" -#: boot.sh:180 +#: boot.sh:183 msgid "Booting..." msgstr "引导中..." -#: boot.sh:183 +#: boot.sh:186 msgid "" "[This interface will not be operational. Please use the http://find.synology." "com/ find DSM and connect.]"