Fix up mobyconfig startup code

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack 2016-07-25 14:03:03 +01:00
parent 7d1faa25dc
commit d045eb449b

View File

@ -15,24 +15,28 @@ fi
if [ ! -d /Database ] if [ ! -d /Database ]
then then
mkdir -p /Database mkdir -p /Database
BASE="/Database"
case "$(mobyplatform)" in case "$(mobyplatform)" in
windows) windows)
/sbin/9pmount-vsock listen db /Database /sbin/9pmount-vsock listen db /Database
[ $? -ne 0 ] && rm -rf /Database && printf "Could not mount configuration database\n" 1>&2 && exit 1 [ $? -ne 0 ] && rm -rf /Database && printf "Could not mount configuration database\n" 1>&2 && exit 1
DATABASE="com.docker.driver.amd64-linux"
BASE="/Database/branch/master/ro/${DATABASE}"
;; ;;
mac) mac)
mount -t 9p -o trans=virtio,dfltuid=1001,dfltgid=50,version=9p2000 db /Database mount -t 9p -o trans=virtio,dfltuid=1001,dfltgid=50,version=9p2000 db /Database
[ $? -ne 0 ] && rm -rf /Database && printf "Could not mount configuration database\n" 1>&2 && exit 1 [ $? -ne 0 ] && rm -rf /Database && printf "Could not mount configuration database\n" 1>&2 && exit 1
;;
esac
fi
case "$(mobyplatform)" in
windows|mac)
DATABASE="com.docker.driver.amd64-linux" DATABASE="com.docker.driver.amd64-linux"
BASE="/Database/branch/master/ro/${DATABASE}" BASE="/Database/branch/master/ro/${DATABASE}"
;; ;;
*)
# For other editions, currently all database keys will be reported as empty. # For other editions, currently all database keys will be reported as empty.
# Later they will build a tree from other sources. # Later they will build a tree from other sources.
esac BASE="/Database"
fi esac
KEY=$(echo $2 | sed 's@^/@@') KEY=$(echo $2 | sed 's@^/@@')