tree: more rewrite

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium
2024-06-07 21:50:40 +02:00
parent d344504a93
commit 6d0295a1cf
5 changed files with 14 additions and 14 deletions

View File

@@ -107,7 +107,7 @@ else
CMDLINE['noefi']=""
fi
if [ $(echo "${KVER:-4}" | cut -d'.' -f1) -lt 5 ]; then
if [ ! "${BUS}" == "usb" ]; then
if [ "${BUS}" != "usb" ]; then
SZ=$(blockdev --getsz ${LOADER_DISK} 2>/dev/null) # SZ=$(cat /sys/block/${LOADER_DISK/\/dev\//}/size)
SS=$(blockdev --getss ${LOADER_DISK} 2>/dev/null) # SS=$(cat /sys/block/${LOADER_DISK/\/dev\//}/queue/hw_sector_size)
SIZE=$((${SZ:-0} * ${SS:-0} / 1024 / 1024 + 10))
@@ -137,12 +137,12 @@ CMDLINE['loglevel']="15"
CMDLINE['log_buf_len']="32M"
CMDLINE["HddHotplug"]="1"
CMDLINE["vender_format_version"]="2"
#if [ -n "$(ls /dev/mmcblk* 2>/dev/null)" ] && [ ! "${BUS}" == "mmc" ] && [ ! "${EMMCBOOT}" == "true" ]; then
# [ ! "${CMDLINE['modprobe.blacklist']}" == "" ] && CMDLINE['modprobe.blacklist']+=","
#if [ -n "$(ls /dev/mmcblk* 2>/dev/null)" ] && [ "${BUS}" != "mmc" ] && [ "${EMMCBOOT}" != "true" ]; then
# [ "${CMDLINE['modprobe.blacklist']}" != "" ] && CMDLINE['modprobe.blacklist']+=","
# CMDLINE['modprobe.blacklist']+="sdhci,sdhci_pci,sdhci_acpi"
#fi
if [ "${DT}" == "true" ] && ! echo "epyc7002 purley broadwellnkv2" | grep -wq "${PLATFORM}"; then
[ ! "${CMDLINE['modprobe.blacklist']}" == "" ] && CMDLINE['modprobe.blacklist']+=","
[ "${CMDLINE['modprobe.blacklist']}" != "" ] && CMDLINE['modprobe.blacklist']+=","
CMDLINE['modprobe.blacklist']+="mpt3sas"
fi
if echo "epyc7002 apollolake geminilake" | grep -wq "${PLATFORM}"; then

View File

@@ -248,7 +248,7 @@ EOF
[ ${IDX} -ge $(wc -l <${TMP_PATH}/ethlist) ] && break
ETH=$(cat ${TMP_PATH}/ethlist | sed -n "$((${IDX} + 1))p" | awk '{print $3}')
# echo "ETH: ${ETH}"
if [ -n "${ETH}" ] && [ ! "${ETH}" == "eth${IDX}" ]; then
if [ -n "${ETH}" ] && [ "${ETH}" != "eth${IDX}" ]; then
# echo "change ${ETH} <=> eth${IDX}"
ip link set dev eth${IDX} down
ip link set dev ${ETH} down

View File

@@ -122,13 +122,13 @@ function getmap() {
if [ $(lspci -d ::106 | wc -l) -gt 0 ]; then
LASTDRIVE=0
while read -r D; do
if [ "${BUS}" == "sata" ] && [ ! "${MACHINE}" == "NATIVE" ] && [ ${D} -eq 0 ]; then
if [ "${BUS}" == "sata" ] && [ "${MACHINE}" != "NATIVE" ] && [ ${D} -eq 0 ]; then
MAXDISKS=${DRIVES}
echo -n "${D}>${MAXDISKS}:">>"${TMP_PATH}/remap"
elif [ ! ${D} = ${LASTDRIVE} ]; then
elif [ ${D} != ${LASTDRIVE} ]; then
echo -n "${D}>${LASTDRIVE}:">>"${TMP_PATH}/remap"
LASTDRIVE=$((${LASTDRIVE} + 1))
elif [ ${D} = ${LASTDRIVE} ]; then
elif [ ${D} == ${LASTDRIVE} ]; then
LASTDRIVE=$((${D} + 1))
fi
done < <(cat "${TMP_PATH}/ports")
@@ -144,9 +144,9 @@ function getmapSelection() {
CUSTOM="$(readConfigKey "arc.custom" "${USER_CONFIG_FILE}")"
if [ "${CUSTOM}" == "false" ]; then
# Show recommended Option to user
if [[ -n "${SATAREMAP}" && "${EXTERNALCONTROLLER}" == "true" && "${MACHINE}" == "NATIVE" ]]; then
if [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" == "true" ] && [ "${MACHINE}" == "NATIVE" ]]; then
REMAP2="*"
elif [[ -n "${SATAREMAP}" && "${EXTERNALCONTROLLER}" == "false" ]]; then
elif [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" == "false" ]; then
REMAP3="*"
else
REMAP1="*"

View File

@@ -93,7 +93,7 @@ for ETH in ${ETHX}; do
initConfigKey "mac.${ETH}" "${MACR}" "${USER_CONFIG_FILE}"
if [ "${MACSYS}" == "custom" ]; then
MACA="$(readConfigKey "mac.${ETH}" "${USER_CONFIG_FILE}")"
if [ ! "${MACA}" == "${MACR}" ]; then
if [ "${MACA}" != "${MACR}" ]; then
MAC="${MACA:0:2}:${MACA:2:2}:${MACA:4:2}:${MACA:6:2}:${MACA:8:2}:${MACA:10:2}"
echo "Setting ${ETH} MAC to ${MAC}"
ip link set dev ${ETH} address "${MAC}" >/dev/null 2>&1 || true

View File

@@ -43,13 +43,13 @@ CUSTOM="${readConfigKey "arc.custom" "${USER_CONFIG_FILE}"}"
###############################################################################
# Mounts backtitle dynamically
function backtitle() {
if [ ! -n "${MODEL}" ]; then
if [ -z "${MODEL}" ]; then
MODEL="(Model)"
fi
if [ ! -n "${PRODUCTVER}" ]; then
if [ -z "${PRODUCTVER}" ]; then
PRODUCTVER="(Version)"
fi
if [ ! -n "${IPCON}" ]; then
if [ -z "${IPCON}" ]; then
IPCON="(IP)"
fi
BACKTITLE="${ARC_TITLE} | "