mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-29 05:27:41 +00:00
mobyconfig: on Hyper-V connect to the db over AF_HYPERV
We detect Hyper-V by the presence of /sys/bus/vmbus and then run the /sbin/9pmount-vsock command to establish a socket connection and then pass the fd to /bin/mount This patch also hard-codes the database directory com.docker.driver.amd64-linux since we can't use the kernel commandline on Hyper-V hosts. It would probably be better to expose a generic directory name ( / ?) on all platforms and configure the datbase to store each VM's configuration in a different directory. Signed-off-by: David Scott <dave.scott@docker.com>
This commit is contained in:
parent
49ca65ede8
commit
129f7836fd
@ -12,16 +12,15 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! cat /proc/cmdline | grep -q 'com.docker.database'
|
||||
then
|
||||
printf "Could not find database configuration information\n" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d /Database ]
|
||||
then
|
||||
mkdir -p /Database
|
||||
mount -t 9p -o trans=virtio,dfltuid=1001,dfltgid=50,version=9p2000 db /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
|
||||
@ -30,7 +29,7 @@ then
|
||||
fi
|
||||
fi
|
||||
|
||||
DATABASE="$(cat /proc/cmdline | sed -e 's/.*com.docker.database="//' -e 's/".*//')"
|
||||
DATABASE="com.docker.driver.amd64-linux"
|
||||
BASE="/Database/branch/master/ro/${DATABASE}"
|
||||
|
||||
KEY=$(echo $2 | sed 's@^/@@')
|
||||
|
Loading…
Reference in New Issue
Block a user