krata/hack/dist/bundle.sh
Alex Zenla 9a45d754bf
chore(xenplatform): elf loader should async load the file (#197)
* fix(build): remove unused environment variables

* chore(xenplatform): elf loader should async load the file
2024-06-23 12:57:01 +00:00

43 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
set -e
# shellcheck source-path=SCRIPTDIR source=common.sh
. "$(dirname "${0}")/common.sh"
TARGET_ARCH="$("${KRATA_DIR}/hack/build/arch.sh")"
BUNDLE_TAR="${OUTPUT_DIR}/bundle-systemd-${TARGET_ARCH}.tgz"
rm -f "${BUNDLE_TAR}"
BUNDLE_DIR="$(mktemp -d /tmp/krata-bundle.XXXXXXXXXXXXX)"
BUNDLE_DIR="${BUNDLE_DIR}/krata"
mkdir -p "${BUNDLE_DIR}"
./hack/build/cargo.sh build --release --bin kratad --bin kratanet --bin kratactl
RUST_TARGET="$(./hack/build/target.sh)"
for X in kratad kratanet kratactl
do
cp "${KRATA_DIR}/target/${RUST_TARGET}/release/${X}" "${BUNDLE_DIR}/${X}"
done
./hack/initrd/build.sh
./hack/kernel/fetch.sh
cd "${BUNDLE_DIR}"
cp "${KRATA_DIR}/target/initrd/initrd-${TARGET_ARCH}" initrd
cp "${KRATA_DIR}/target/kernel/kernel-${TARGET_ARCH}" kernel
cp "${KRATA_DIR}/target/kernel/addons-${TARGET_ARCH}.squashfs" addons.squashfs
cp "${KRATA_DIR}/resources/systemd/kratad.service" kratad.service
cp "${KRATA_DIR}/resources/systemd/kratanet.service" kratanet.service
cp "${KRATA_DIR}/resources/bundle/install.sh" install.sh
cp "${KRATA_DIR}/resources/bundle/uninstall.sh" uninstall.sh
for X in install.sh uninstall.sh kratactl kratad kratanet
do
chmod +x "${X}"
done
cd ..
tar czf "${BUNDLE_TAR}" .
cd "${KRATA_DIR}"
rm -rf "$(dirname "${BUNDLE_DIR}")"