From 3ada3219269c9ad533c0818f43903d279e62fbda Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Thu, 21 Jul 2016 18:37:34 +0100 Subject: [PATCH] only try to mount db for desktop editions Signed-off-by: Justin Cormack --- alpine/packages/mobyconfig/mobyconfig | 32 ++++++++++++++------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/alpine/packages/mobyconfig/mobyconfig b/alpine/packages/mobyconfig/mobyconfig index c9ca32d6b..acb448e52 100755 --- a/alpine/packages/mobyconfig/mobyconfig +++ b/alpine/packages/mobyconfig/mobyconfig @@ -15,23 +15,25 @@ fi if [ ! -d /Database ] then mkdir -p /Database - if [ -d /sys/bus/vmbus ]; then - # Running on a Hyper-V hypervisor - /sbin/9pmount-vsock listen db /Database - else - mount -t 9p -o trans=virtio,dfltuid=1001,dfltgid=50,version=9p2000 db /Database - fi - if [ $? -ne 0 ] - then - rm -rf /Database - printf "Could not mount configuration database\n" 1>&2 - exit 1 - fi + BASE="/Database" + case "$(mobyconfig)" in + windows) + /sbin/9pmount-vsock listen db /Database + [ $? -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) + 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 + DATABASE="com.docker.driver.amd64-linux" + BASE="/Database/branch/master/ro/${DATABASE}" + ;; + # For other editions, currently all database keys will be reported as empty. + # Later they will build a tree from other sources. + esac fi -DATABASE="com.docker.driver.amd64-linux" -BASE="/Database/branch/master/ro/${DATABASE}" - KEY=$(echo $2 | sed 's@^/@@') if [ $1 == "exists" ]