mirror of
				https://github.com/linuxkit/linuxkit.git
				synced 2025-11-04 03:12:58 +00:00 
			
		
		
		
	The new hiearchy is:
- pkg/{init,mirage-compile}: additional Moby packages
- src/sdk -> the begining of the MirageOS SDK for Moby
- src/dhcp-client -> the code for the MirageOS dhcp-client service
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
		
	
		
			
				
	
	
		
			49 lines
		
	
	
		
			587 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			587 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/sh
 | 
						|
 | 
						|
set -e
 | 
						|
 | 
						|
usage() {
 | 
						|
	echo "Usage: -o file"
 | 
						|
	exit 1
 | 
						|
}
 | 
						|
 | 
						|
[ $# = 0 ] && usage
 | 
						|
 | 
						|
while [ $# -gt 0 ]
 | 
						|
do
 | 
						|
	flag="$1"
 | 
						|
	case "$flag" in
 | 
						|
	-o)
 | 
						|
		[ $# -eq 1 ] && usage
 | 
						|
		out="$2"
 | 
						|
		mkdir -p "$(dirname $2)"
 | 
						|
		shift
 | 
						|
	;;
 | 
						|
	*)
 | 
						|
		echo "Unknown option $1"
 | 
						|
		exit 1
 | 
						|
	esac
 | 
						|
	shift
 | 
						|
done
 | 
						|
 | 
						|
[ -z "$out" ] && usage
 | 
						|
 | 
						|
package=$(basename "$out")
 | 
						|
 | 
						|
dir="/src"
 | 
						|
 | 
						|
# untar input
 | 
						|
tar xf - -C $dir
 | 
						|
 | 
						|
(
 | 
						|
    cd $dir
 | 
						|
    opam config exec -- mirage configure -o $out -t unix
 | 
						|
    opam config exec -- make depend
 | 
						|
    opam config exec -- make
 | 
						|
    mv $(readlink $out) $out
 | 
						|
) > /src/logs 2>&1
 | 
						|
 | 
						|
cd $dir && tar -cf - $out
 | 
						|
 | 
						|
exit 0
 |