Rebuild ISO payload tree before copying packages (Sam & Codex)

This commit is contained in:
Sam & Claude 2026-05-12 22:18:49 +02:00 committed by 123kupola
parent dc37b6fb86
commit 2617d000b3

View file

@ -738,11 +738,22 @@ install_live_runtime_packages
configure_live_installer_session
# Copy payload
# Rebuild payload paths from scratch inside the reusable work image. A failed
# prior build can leave a partial package tree behind, and overlaying a new
# hashed pkg repo onto that stale path produces "Not a directory" copy errors.
rm -rf "${USB_SHARE}/firstboot" "${USB_SHARE}/packages" "${USB_SHARE}/npm-globals"
rm -f "${USB_SHARE}/installerconfig" \
"${USB_SHARE}/clawdie-ai.tar.gz" \
"${USB_SHARE}/build.cfg" \
"${USB_SHARE}/build-manifest.json"
cp "${SCRIPT_DIR}/installerconfig" "${USB_SHARE}/installerconfig"
cp -r "${SCRIPT_DIR}/firstboot" "${USB_SHARE}/"
cp -r "${PKG_REPO_DIR}" "${USB_SHARE}/"
cp -r "${SCRIPT_DIR}/firstboot" "${USB_SHARE}/firstboot"
mkdir -p "${USB_SHARE}/packages"
cp -R "${PKG_REPO_DIR}/." "${USB_SHARE}/packages/"
if [ -d "$NPM_GLOBALS_DIR" ]; then
cp -r "${NPM_GLOBALS_DIR}" "${USB_SHARE}/"
mkdir -p "${USB_SHARE}/npm-globals"
cp -R "${NPM_GLOBALS_DIR}/." "${USB_SHARE}/npm-globals/"
echo " Bundled npm-globals: $(ls "${NPM_GLOBALS_DIR}"/*.tgz 2>/dev/null | wc -l | tr -d ' ') tarballs"
fi
cp "${CLAWDIE_TARBALL_ISO}" "${USB_SHARE}/clawdie-ai.tar.gz"