mirror of
https://github.com/AuxXxilium/arc-c.git
synced 2024-11-23 23:11:08 +07:00
network: rework nic count function
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
a83cf4214a
commit
0db93601be
@ -173,7 +173,7 @@ elif [[ "${DIRECTBOOT}" = "true" && ${BOOTCOUNT} -eq 0 ]]; then
|
||||
exec reboot
|
||||
elif [ "${DIRECTBOOT}" = "false" ]; then
|
||||
ETHX=$(ls /sys/class/net/ | grep -v lo || true)
|
||||
ETH=$(ls /sys/class/net/ | grep eth | wc -l)
|
||||
ETH=$(echo ${ETHX} | wc -w)
|
||||
STATICIP="$(readConfigKey "arc.staticip" "${USER_CONFIG_FILE}")"
|
||||
BOOTIPWAIT="$(readConfigKey "arc.bootipwait" "${USER_CONFIG_FILE}")"
|
||||
echo -e "\033[1;34mDetected ${ETH} NIC.\033[0m \033[1;37mWaiting for Connection:\033[0m"
|
||||
|
@ -65,7 +65,8 @@ function getnet() {
|
||||
}
|
||||
|
||||
# Get Amount of NIC
|
||||
ETH=$(ls /sys/class/net/ | grep eth | wc -l)
|
||||
ETHX=$(ls /sys/class/net/ | grep -v lo || true)
|
||||
ETH=$(echo ${ETHX} | wc -w)
|
||||
writeConfigKey "device.nic" "${ETH}" "${USER_CONFIG_FILE}"
|
||||
# Get actual IP
|
||||
ARCIP="$(readConfigKey "arc.ip" "${USER_CONFIG_FILE}")"
|
||||
|
@ -61,9 +61,9 @@ initConfigKey "device" "{}" "${USER_CONFIG_FILE}"
|
||||
|
||||
# Init Network
|
||||
ETHX=$(ls /sys/class/net/ | grep -v lo || true)
|
||||
ETH=$(ls /sys/class/net/ | grep eth | wc -l)
|
||||
ETH=$(echo ${ETHX} | wc -w)
|
||||
# No network devices
|
||||
[ $(echo ${ETHX} | wc -w) -le 0 ] && die "No NIC found! - Loader does not work without Network connection."
|
||||
[ ${ETH} -le 0 ] && die "No NIC found! - Loader does not work without Network connection."
|
||||
MACSYS="$(readConfigKey "arc.macsys" "${USER_CONFIG_FILE}")"
|
||||
if [ "${MACSYS}" = "custom" ]; then
|
||||
MACR="$(cat /sys/class/net/eth0/address | sed 's/://g')"
|
||||
|
@ -138,6 +138,7 @@ cp -f "${TMP_PATH}/modules/rp.ko" "${RAMDISK_PATH}/usr/lib/modules/rp.ko"
|
||||
rm -rf "${TMP_PATH}/modules"
|
||||
|
||||
# Copying hwdb.bin to destination
|
||||
mkdir -p "${RAMDISK_PATH}/etc/udev"
|
||||
cp -f "/etc/udev/hwdb.bin" "${RAMDISK_PATH}/etc/udev/hwdb.bin"
|
||||
|
||||
# Copying fake modprobe
|
||||
|
Loading…
Reference in New Issue
Block a user