boot/network: add macsys "arc"
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
@@ -135,20 +135,29 @@ CMDLINE['sn']="${SN}"
|
||||
CMDLINE['net.ifnames']="0"
|
||||
CMDLINE['biosdevname']="0"
|
||||
N=0
|
||||
if [ "${MACSYS}" = "hardware" ]; then
|
||||
if [ "${MACSYS}" = "arc" ]; then
|
||||
MAC="$(readConfigKey "mac.eth0" "${USER_CONFIG_FILE}")"
|
||||
[ -n "${MAC}" ] && CMDLINE["mac1"]="${MAC}"
|
||||
for ETH in ${ETHX}; do
|
||||
N=$((${N} + 1))
|
||||
done
|
||||
CMDLINE['netif_num']="1"
|
||||
CMDLINE['skip_vender_mac_interfaces']="0,1,2,3,4,5,6,7"
|
||||
elif [ "${MACSYS}" = "hardware" ]; then
|
||||
for ETH in ${ETHX}; do
|
||||
MAC="$(readConfigKey "mac.${ETH}" "${USER_CONFIG_FILE}")"
|
||||
[ -n "${MAC}" ] && N=$((${N} + 1)) && CMDLINE["mac${N}"]="${MAC}"
|
||||
done
|
||||
CMDLINE['netif_num']="${N}"
|
||||
CMDLINE['skip_vender_mac_interfaces']="0,1,2,3,4,5,6,7"
|
||||
elif [ "${MACSYS}" = "custom" ]; then
|
||||
for ETH in ${ETHX}; do
|
||||
MAC="$(readConfigKey "mac.${ETH}" "${USER_CONFIG_FILE}")"
|
||||
[ -n "${MAC}" ] && N=$((${N} + 1)) && CMDLINE["mac${N}"]="${MAC}"
|
||||
done
|
||||
CMDLINE['netif_num']="${N}"
|
||||
CMDLINE['skip_vender_mac_interfaces']="$(seq -s, ${N} 7)"
|
||||
fi
|
||||
CMDLINE['netif_num']="${N}"
|
||||
|
||||
# Read cmdline
|
||||
while IFS=': ' read -r KEY VALUE; do
|
||||
|
||||
@@ -48,19 +48,23 @@ function getnet() {
|
||||
dialog --backtitle "$(backtitle)" --title "Mac Setting" --msgbox "Invalid MAC" 0 0
|
||||
done
|
||||
fi
|
||||
# Ask for Macsys
|
||||
dialog --clear --backtitle "$(backtitle)" \
|
||||
--nocancel --title "Macsys Setting" \
|
||||
--menu "Do you want to apply Mac to NIC?" 7 50 0 \
|
||||
1 "No - Do not apply (Fake)Mac" \
|
||||
2 "Yes - Apply (Fake)Mac" \
|
||||
2>"${TMP_PATH}/resp"
|
||||
resp="$(<"${TMP_PATH}/resp")"
|
||||
[ -z "${resp}" ] && return 1
|
||||
if [ ${resp} -eq 1 ]; then
|
||||
writeConfigKey "arc.macsys" "hardware" "${USER_CONFIG_FILE}"
|
||||
elif [ ${resp} -eq 2 ]; then
|
||||
writeConfigKey "arc.macsys" "custom" "${USER_CONFIG_FILE}"
|
||||
if [ "${ARCPATCH}" = "true" ]; then
|
||||
writeConfigKey "arc.macsys" "arc" "${USER_CONFIG_FILE}"
|
||||
else
|
||||
# Ask for Macsys
|
||||
dialog --clear --backtitle "$(backtitle)" \
|
||||
--nocancel --title "Macsys Setting" \
|
||||
--menu "Do you want to apply Mac to NIC?" 7 50 0 \
|
||||
1 "No - Do not apply (Fake)Mac" \
|
||||
2 "Yes - Apply (Fake)Mac" \
|
||||
2>"${TMP_PATH}/resp"
|
||||
resp="$(<"${TMP_PATH}/resp")"
|
||||
[ -z "${resp}" ] && return 1
|
||||
if [ ${resp} -eq 1 ]; then
|
||||
writeConfigKey "arc.macsys" "hardware" "${USER_CONFIG_FILE}"
|
||||
elif [ ${resp} -eq 2 ]; then
|
||||
writeConfigKey "arc.macsys" "custom" "${USER_CONFIG_FILE}"
|
||||
fi
|
||||
fi
|
||||
MACSYS="$(readConfigKey "arc.macsys" "${USER_CONFIG_FILE}")"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user