Commit 6fd512c2 authored by Nick Elsmore's avatar Nick Elsmore

Add docker entrypoint arguments

parent c9b342ed
......@@ -10,20 +10,70 @@ env_setup() {
export CROSS_COMPILE=arm-linux-gnueabihf-
mkdir -p $BUILD_ROOT
cd $BUILD_ROOT
}
pyra_init() {
cd $BUILD_ROOT
print_usage() {
echo "Usage: ./docker_run.sh COMMAND [OPTIONS]"
echo "Commands:"
echo " sync-current Sync all repositories to their current branches"
echo " sync-manifest Sync all repositories to master"
echo " build Run PyraOS build script (see script for arguments"
echo " build-all [2gb|4gb] Build PyraOS for 2gb or 4gb HW"
echo " bash Configure environment and start bash shell"
}
sync_current() {
repo init -u dev.pyra-handheld.com:imagebuild/pyra-manifest.git
repo sync
}
sync_to_manifest() {
repo init -u dev.pyra-handheld.com:imagebuild/pyra-manifest.git
repo sync -d
}
build() {
./build.sh $1 $2
}
build_all() {
./build.sh uboot $1
./build.sh kernel
./build.sh rootfs
./build.sh image
}
main() {
env_setup
pyra_init
exec bash
case $1 in
sync-current)
sync_current
;;
sync-manifest)
sync_to_manifest
;;
build)
build $2 $3
;;
build-all)
build_all $2
;;
bash)
exec bash
;;
*)
print_usage
exit 1
;;
esac
}
main "$@"
exit 0
......@@ -28,4 +28,4 @@ docker run \
--volume $ID_RSA:/home/docker/.ssh/id_rsa \
--volume /dev:/dev \
--privileged \
-it pyra-build
-it pyra-build "$@"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment