mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 05:10:55 +00:00
hack: rename scripts to hack
This commit is contained in:
20
hack/initrd/build.sh
Executable file
20
hack/initrd/build.sh
Executable file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
REAL_SCRIPT="$(realpath "${0}")"
|
||||
cd "$(dirname "${REAL_SCRIPT}")/../.."
|
||||
KRATA_DIR="${PWD}"
|
||||
cd "${KRATA_DIR}"
|
||||
|
||||
export RUST_LIBC="musl"
|
||||
RUST_TARGET="$(./hack/build/target.sh)"
|
||||
export RUSTFLAGS="-Ctarget-feature=+crt-static"
|
||||
|
||||
./hack/build/cargo.sh build "${@}" --release --bin krataguest
|
||||
INITRD_DIR="$(mktemp -d /tmp/krata-initrd.XXXXXXXXXXXXX)"
|
||||
cp "target/${RUST_TARGET}/release/krataguest" "${INITRD_DIR}/init"
|
||||
chmod +x "${INITRD_DIR}/init"
|
||||
cd "${INITRD_DIR}"
|
||||
mkdir -p "${KRATA_DIR}/target/initrd"
|
||||
find . | cpio -R 0:0 --reproducible -o -H newc --quiet > "${KRATA_DIR}/target/initrd/initrd"
|
||||
rm -rf "${INITRD_DIR}"
|
Reference in New Issue
Block a user