arc/init: some more fixes

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium
2024-03-02 21:27:57 +01:00
parent 5bd5e6d805
commit 03539316c3
2 changed files with 25 additions and 23 deletions

View File

@@ -31,8 +31,11 @@ fi
# Get Loader Disk Bus
BUS=$(getBus "${LOADER_DISK}")
# Set Warning to 0
WARNON=0
# Set Warning to false
WARNON1="false"
WARNON2="false"
WARNON3="false"
WARNON4="false"
# Get DSM Data from Config
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
@@ -175,14 +178,6 @@ function arcMenu() {
if [ "${MODEL}" != "${resp}" ]; then
MODEL="${resp}"
DT="$(readModelKey "${MODEL}" "dt")"
# Check for AES
if ! grep -q "^flags.*aes.*" /proc/cpuinfo; then
WARNON=4
fi
# Check for DT and SAS/SCSI
if [ "${DT}" = "true" ] && [[ ${SASCONTROLLER} -gt 0 || ${SCSICONTROLLER} -gt 0 ]]; then
WARNON=2
fi
PRODUCTVER=""
writeConfigKey "model" "${MODEL}" "${USER_CONFIG_FILE}"
writeConfigKey "productver" "" "${USER_CONFIG_FILE}"
@@ -370,19 +365,23 @@ function arcsettings() {
# Select Addons
addonSelection
# Check Warnings
if [ ${WARNON} -eq 1 ]; then
if [ "${WARNON1}" = "true" ]; then
dialog --backtitle "$(backtitle)" --title "Arc Warning" \
--msgbox "WARN: Your Controller has more then 8 Disks connected. Max Disks per Controller: 8" 0 0
--msgbox "WARN: Your Controller has more then 8 Disks connected.\nMax Disks per Controller: 8" 0 0
fi
if [ ${WARNON} -eq 2 ]; then
# Check for DT and SAS/SCSI
if [ "${DT}" = "true" ] && [[ ${SASCONTROLLER} -gt 0 || ${SCSICONTROLLER} -gt 0 ]]; then
dialog --backtitle "$(backtitle)" --title "Arc Warning" \
--msgbox "WARN: You use a HBA Controller and selected a HBA Model.\nThis is still an experimental Feature." 0 0
--msgbox "WARN: You use a HBA/Raid Controller and selected a DT Model.\nThis is still an experimental Feature." 0 0
fi
if [ ${WARNON} -eq 3 ]; then
# Check for more then 8 Ethernet Ports
DEVICENIC="$(readConfigKey "device.nic" "${USER_CONFIG_FILE}")"
if [ "${DEVICENIC}" -gt 8 ]; then
dialog --backtitle "$(backtitle)" --title "Arc Warning" \
--msgbox "WARN: You have more then 8 Ethernet Ports. There are only 8 supported by DSM." 0 0
--msgbox "WARN: You have more then 8 Ethernet Ports.\nThere are only 8 supported by DSM." 0 0
fi
if [ ${WARNON} -eq 4 ]; then
# Check for AES
if ! grep -q "^flags.*aes.*" /proc/cpuinfo; then
dialog --backtitle "$(backtitle)" --title "Arc Warning" \
--msgbox "WARN: Your CPU does not have AES Support for Hardwareencryption in DSM." 0 0
fi
@@ -1991,7 +1990,7 @@ function sysinfo() {
IP=""
STATICIP="$(readConfigKey "static.${ETH}" "${USER_CONFIG_FILE}")"
DRIVER=$(ls -ld /sys/class/net/${ETH}/device/driver 2>/dev/null | awk -F '/' '{print $NF}')
MAC="$(cat /sys/class/net/${ETH}/address | sed 's/://g')"
MAC="$(readConfigKey "mac.${ETH}" "${USER_CONFIG_FILE}")"
COUNT=0
while true; do
if [ "${STATICIP}" = "true" ]; then

View File

@@ -63,7 +63,7 @@ initConfigKey "netmask" "{}" "${USER_CONFIG_FILE}"
initConfigKey "mac" "{}" "${USER_CONFIG_FILE}"
initConfigKey "static" "{}" "${USER_CONFIG_FILE}"
# KVM Check
if grep -q -E "(vmx|svm)" /proc/cpuinfo; then
if grep -q -E '(vmx|svm)' /proc/cpuinfo; then
writeConfigKey "arc.kvm" "true" "${USER_CONFIG_FILE}"
else
writeConfigKey "arc.kvm" "false" "${USER_CONFIG_FILE}"
@@ -73,9 +73,12 @@ fi
ETHX=$(ls /sys/class/net/ | grep -v lo) || true
MACSYS="$(readConfigKey "arc.macsys" "${USER_CONFIG_FILE}")"
# Write Mac to config
N=0
NIC=0
for ETH in ${ETHX}; do
MACR="$(cat /sys/class/net/${ETH}/address | sed 's/://g')"
if [ -z "${MACR}" ]; then
MACR="000000000000"
fi
initConfigKey "mac.${ETH}" "${MACR}" "${USER_CONFIG_FILE}"
if [ "${MACSYS}" = "custom" ]; then
MACA="$(readConfigKey "mac.${ETH}" "${USER_CONFIG_FILE}")"
@@ -88,12 +91,12 @@ for ETH in ${ETHX}; do
fi
echo
fi
N=$((${N} + 1))
NIC=$((${NIC} + 1))
done
# Write NIC Amount to config
writeConfigKey "device.nic" "${N}" "${USER_CONFIG_FILE}"
writeConfigKey "device.nic" "${NIC}" "${USER_CONFIG_FILE}"
# No network devices
[ ${N} -le 0 ] && die "No NIC found! - Loader does not work without Network connection."
[ ${NIC} -le 0 ] && die "No NIC found! - Loader does not work without Network connection."
# Get the VID/PID if we are in USB
VID="0x46f4"