From 91babd9162cbcbb18d8c7d9f541531317ef2da5e Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Fri, 25 Oct 2024 14:12:48 +0200 Subject: [PATCH] functions: cleanup Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 13 ------------- files/initrd/opt/arc/include/functions.sh | 10 ++++++---- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index 6de8fc9d..83148000 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -1676,19 +1676,6 @@ function greplogs() { MSG+="Can't find system logs!\n" fi - PSTORE=0 - if [ -n "$(ls /sys/fs/pstore 2>/dev/null)" ]; then - mkdir -p "${TMP_PATH}/logs/pstore" - cp -rf /sys/fs/pstore/* "${TMP_PATH}/logs/pstore" - [ -n "$(ls /sys/fs/pstore/*.z 2>/dev/null)" ] && zlib-flate -uncompress "${TMP_PATH}/logs/pstore/ps.log" 2>/dev/null - PSTORE=1 - fi - if [ ${PSTORE} -eq 1 ]; then - MSG+="Pstore logs found!\n" - else - MSG+="Can't find pstore logs!\n" - fi - ADDONS=0 if [ -d "${PART1_PATH}/logs" ]; then mkdir -p "${TMP_PATH}/logs/addons" diff --git a/files/initrd/opt/arc/include/functions.sh b/files/initrd/opt/arc/include/functions.sh index 9a206ea1..e54e6aa1 100755 --- a/files/initrd/opt/arc/include/functions.sh +++ b/files/initrd/opt/arc/include/functions.sh @@ -230,8 +230,8 @@ function _sort_netif() { local ETHX="$(ls /sys/class/net/ 2>/dev/null | grep eth)" # real network cards list for ETH in ${ETHX}; do local MAC="$(cat /sys/class/net/${ETH}/address 2>/dev/null | sed 's/://g; s/.*/\L&/')" - local ETHBUS="$(ethtool -i ${ETH} 2>/dev/null | grep bus-info | cut -d' ' -f2)" - ETHLIST="${ETHLIST}${ETHBUS} ${MAC} ${ETH}\n" + local BUS="$(ethtool -i ${ETH} 2>/dev/null | grep bus-info | cut -d' ' -f2)" + ETHLIST="${ETHLIST}${BUS} ${MAC} ${ETH}\n" done local ETHLISTTMPM="" local ETHLISTTMPB="$(echo -e "${ETHLIST}" | sort)" @@ -245,14 +245,16 @@ function _sort_netif() { local ETHLIST="$(echo -e "${ETHLISTTMPM}${ETHLISTTMPB}" | grep -v '^$')" local ETHSEQ="$(echo -e "${ETHLIST}" | awk '{print $3}' | sed 's/eth//g')" local ETHNUM="$(echo -e "${ETHLIST}" | wc -l)" + + # echo "${ETHSEQ}" # sort - if [ ! "${ETHSEQ}" == "$(seq 0 $((${ETHNUM:0} - 1)))" ]; then + if [ ! "${ETHSEQ}" = "$(seq 0 $((${ETHNUM:0} - 1)))" ]; then /etc/init.d/S41dhcpcd stop >/dev/null 2>&1 /etc/init.d/S40network stop >/dev/null 2>&1 for i in $(seq 0 $((${ETHNUM:0} - 1))); do ip link set dev eth${i} name tmp${i} done - local I=0 + I=0 for i in ${ETHSEQ}; do ip link set dev tmp${i} name eth${I} I=$((${I} + 1))