Refactor toolchain packaging process by introducing package-toolchain.sh

- Replaced the packaging logic in build-toolchain.sh with a call to the new package-toolchain.sh script for better organization and maintainability.
- Added package-toolchain.sh to handle the stripping and archiving of the toolchain, including necessary checks for the installation directory and environment script.
- Updated README.md to document the addition of package-toolchain.sh for clarity on the build process.
This commit is contained in:
2026-04-06 15:09:07 +03:00
parent 082098c9ec
commit 8267e2e4da
3 changed files with 39 additions and 15 deletions

View File

@@ -211,21 +211,8 @@ cd "${TOP}"
# ==================================================================
# Strip и упаковка
# ==================================================================
echo "== Strip toolchain и упаковка =="
cd "${TOP}"
WDIR=$(mktemp -d)
trap 'rm -rf "$WDIR"' EXIT
ARCHIVE_TOOLCHAIN_DIR="${WDIR}/${TARGET}"
mkdir -p "${ARCHIVE_TOOLCHAIN_DIR}"
cp -a "${INSTALL_DIR}"/* "${ARCHIVE_TOOLCHAIN_DIR}/"
cp -a "${TOP}/scripts/env.sh" "${WDIR}/env.sh"
find "${ARCHIVE_TOOLCHAIN_DIR}" -type f -executable -exec strip -p {} \; 2>/dev/null || true
tar -C "$WDIR" --owner=0 --group=0 -cJf "toolset-jlv-${SUBARCH}-gcc${GCC_VER}-uclibc${UCLIBC_VER}.tar.xz" "${TARGET}" "env.sh"
echo "Готово: toolset-jlv-${SUBARCH}-gcc${GCC_VER}-uclibc${UCLIBC_VER}.tar.xz"
bash ./package-toolchain.sh "${TARGET}" "${SUBARCH}" "${INSTALL_DIR}"
# ==================================================================
# Очистка