mirror_lxc/config/init/systemd/lxc-devsetup
ChangZhuo Chen (陳昌倬) e702123afe lxc-devsetup: Don't use [[ because sh does not support it
Signed-off-by: ChangZhuo Chen (陳昌倬) <czchen@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-05-20 14:53:11 +02:00

26 lines
492 B
Bash
Executable File

#!/bin/sh -
# lxc.devsetup - Setup host /dev for container /dev subdirectories.
if [ ! -d /dev/.lxc ]
then
echo "Creating /dev/.lxc"
mkdir /dev/.lxc
chmod 755 /dev/.lxc
fi
if grep -q "/dev devtmpfs " /proc/self/mounts
then
echo "/dev is devtmpfs"
else
echo "/dev is not devtmpfs - mounting tmpfs on .lxc"
mount -t tmpfs tmpfs /dev/.lxc
fi
if [ ! -d /dev/.lxc/user ]
then
echo "Creating /dev/.lxc/user"
mkdir /dev/.lxc/user
chmod 1777 /dev/.lxc/user
fi