From c75350f32bcd21b8b009206c22a448baff572b4f Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Sun, 21 Jan 2024 12:04:42 +0100 Subject: [PATCH] tree: multiple rework Signed-off-by: AuxXxilium --- files/initrd/opt/arc/include/addons.sh | 10 +++++----- files/initrd/opt/arc/include/modules.sh | 12 ++++++------ files/initrd/opt/arc/init.sh | 1 + 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/files/initrd/opt/arc/include/addons.sh b/files/initrd/opt/arc/include/addons.sh index 5123130..e92f609 100755 --- a/files/initrd/opt/arc/include/addons.sh +++ b/files/initrd/opt/arc/include/addons.sh @@ -54,12 +54,12 @@ function installAddon() { HAS_FILES=0 # First check generic files if [ -f "${ADDONS_PATH}/${ADDON}/all.tgz" ]; then - tar -zxf "${ADDONS_PATH}/${ADDON}/all.tgz" -C "${TMP_PATH}/${ADDON}" + tar zxf "${ADDONS_PATH}/${ADDON}/all.tgz" -C "${TMP_PATH}/${ADDON}" HAS_FILES=1 fi # Now check specific platform files if [ -f "${ADDONS_PATH}/${ADDON}/${PLATFORM}-${KVER}.tgz" ]; then - tar -zxf "${ADDONS_PATH}/${ADDON}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/${ADDON}" + tar zxf "${ADDONS_PATH}/${ADDON}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/${ADDON}" HAS_FILES=1 fi # If has files to copy, copy it, else return error @@ -82,7 +82,7 @@ function untarAddon() { fi rm -rf "${TMP_PATH}/${ADDON:?}" mkdir -p "${TMP_PATH}/${ADDON}" - tar -xaf "${1}" -C "${TMP_PATH}/${ADDON}" || return + tar xaf "${1}" -C "${TMP_PATH}/${ADDON}" || return ADDON=$(readConfigKey "name" "${TMP_PATH}/${ADDON}/manifest.yml") [ -z "${ADDON}" ] && return rm -rf "${ADDONS_PATH}/${ADDON:?}" @@ -97,8 +97,8 @@ function updateAddons() { ADDON=$(basename "${F}" | sed 's|.addon||') rm -rf "${ADDONS_PATH}/${ADDON:?}" mkdir -p "${ADDONS_PATH}/${ADDON}" - echo "Installing ${F} to ${ADDONS_PATH}/${ADDON}" - tar -xaf "${F}" -C "${ADDONS_PATH}/${ADDON}" + echo "Installing ${F} to ${ADDONS_PATH}/${ADDON}" 2>"${LOG_FILE}" || dieLog + tar xaf "${F}" -C "${ADDONS_PATH}/${ADDON}" rm -f "${F}" done } \ No newline at end of file diff --git a/files/initrd/opt/arc/include/modules.sh b/files/initrd/opt/arc/include/modules.sh index 1033732..ad4c2e8 100755 --- a/files/initrd/opt/arc/include/modules.sh +++ b/files/initrd/opt/arc/include/modules.sh @@ -13,7 +13,7 @@ function getAllModules() { # Unzip modules for temporary folder rm -rf "${TMP_PATH}/modules" mkdir -p "${TMP_PATH}/modules" - tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" + tar zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" # Get list of all modules for F in $(ls ${TMP_PATH}/modules/*.ko); do X=$(basename ${F}) @@ -41,9 +41,9 @@ function addToModules() { # Unzip modules for temporary folder rm -rf "${TMP_PATH}/modules" mkdir -p "${TMP_PATH}/modules" - tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" + tar zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" cp -f ${KOFILE} ${TMP_PATH}/modules - tar -zcf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" . + tar zcf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" . } ############################################################################### @@ -62,9 +62,9 @@ function delToModules() { # Unzip modules for temporary folder rm -rf "${TMP_PATH}/modules" mkdir -p "${TMP_PATH}/modules" - tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" + tar zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" rm -f ${TMP_PATH}/modules/${KONAME} - tar -zcf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" . + tar zcf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" . } ############################################################################### @@ -94,7 +94,7 @@ function getdepends() { # Unzip modules for temporary folder rm -rf "${TMP_PATH}/modules" mkdir -p "${TMP_PATH}/modules" - tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" + tar zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" DPS=($(_getdepends ${KONAME} | tr ' ' '\n' | sort -u)) echo ${DPS[@]} rm -rf "${TMP_PATH}/modules" diff --git a/files/initrd/opt/arc/init.sh b/files/initrd/opt/arc/init.sh index f1b6c92..a66a192 100755 --- a/files/initrd/opt/arc/init.sh +++ b/files/initrd/opt/arc/init.sh @@ -4,6 +4,7 @@ set -e [[ -z "${ARC_PATH}" || ! -d "${ARC_PATH}/include" ]] && ARC_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" . ${ARC_PATH}/include/functions.sh +. ${ARC_PATH}/include/addons.sh [ -z "${LOADER_DISK}" ] && die "Loader Disk not found!"