mirror of
				https://github.com/edera-dev/krata.git
				synced 2025-11-03 23:29:39 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			23 lines
		
	
	
		
			705 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			705 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/sh
 | 
						|
set -e
 | 
						|
 | 
						|
REAL_SCRIPT="$(realpath "${0}")"
 | 
						|
cd "$(dirname "${REAL_SCRIPT}")/../.."
 | 
						|
KRATA_DIR="${PWD}"
 | 
						|
cd "${KRATA_DIR}"
 | 
						|
 | 
						|
TARGET_ARCH="$(./hack/build/arch.sh)"
 | 
						|
 | 
						|
export TARGET_LIBC="musl"
 | 
						|
RUST_TARGET="$(./hack/build/target.sh)"
 | 
						|
export RUSTFLAGS="-Ctarget-feature=+crt-static"
 | 
						|
 | 
						|
./hack/build/cargo.sh build "${@}" --release --bin krata-zone
 | 
						|
INITRD_DIR="$(mktemp -d /tmp/krata-initrd.XXXXXXXXXXXXX)"
 | 
						|
cp "target/${RUST_TARGET}/release/krata-zone" "${INITRD_DIR}/init"
 | 
						|
chmod +x "${INITRD_DIR}/init"
 | 
						|
cd "${INITRD_DIR}"
 | 
						|
mkdir -p "${KRATA_DIR}/target/initrd"
 | 
						|
find . | cpio -R 0:0 --ignore-devno --renumber-inodes -o -H newc --quiet > "${KRATA_DIR}/target/initrd/initrd-${TARGET_ARCH}"
 | 
						|
rm -rf "${INITRD_DIR}"
 |