Commit bf3e09c0 by KATOH Yasufumi Committed by Serge Hallyn

plamo: Update template to use lxc.include and add plamo.common.conf

parent d08363af
templatesconfigdir=@LXCTEMPLATECONFIG@ templatesconfigdir=@LXCTEMPLATECONFIG@
templatesconfig_DATA = \ templatesconfig_DATA = \
plamo.common.conf \
ubuntu-cloud.common.conf \ ubuntu-cloud.common.conf \
ubuntu-cloud.lucid.conf \ ubuntu-cloud.lucid.conf \
ubuntu-cloud.userns.conf \ ubuntu-cloud.userns.conf \
......
# Default console settings
lxc.tty = 4
lxc.pts = 1024
# Default mount
lxc.mount.auto = proc sys cgroup
# Default capabilities
lxc.cap.drop = sys_module mac_admin mac_override sys_time
lxc.cgroup.devices.deny = a
# /dev/null and zero
lxc.cgroup.devices.allow = c 1:3 rwm
lxc.cgroup.devices.allow = c 1:5 rwm
# consoles
lxc.cgroup.devices.allow = c 5:0 rwm
lxc.cgroup.devices.allow = c 5:1 rwm
# /dev/{,u}random
lxc.cgroup.devices.allow = c 1:8 rwm
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 5:2 rwm
lxc.cgroup.devices.allow = c 136:* rwm
# rtc
lxc.cgroup.devices.allow = c 254:0 rm
# fuse
lxc.cgroup.devices.allow = c 10:229 rwm
...@@ -532,6 +532,7 @@ AC_CONFIG_FILES([ ...@@ -532,6 +532,7 @@ AC_CONFIG_FILES([
config/Makefile config/Makefile
config/etc/Makefile config/etc/Makefile
config/templates/Makefile config/templates/Makefile
config/templates/plamo.common.conf
config/templates/ubuntu-cloud.common.conf config/templates/ubuntu-cloud.common.conf
config/templates/ubuntu-cloud.lucid.conf config/templates/ubuntu-cloud.lucid.conf
config/templates/ubuntu-cloud.userns.conf config/templates/ubuntu-cloud.userns.conf
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
# ref. https://github.com/Ponce/lxc-slackware/blob/master/lxc-slackware # ref. https://github.com/Ponce/lxc-slackware/blob/master/lxc-slackware
# lxc-ubuntu script # lxc-ubuntu script
LXC_TEMPLATE_CONFIG="@LXCTEMPLATECONFIG@"
[ -r /etc/default/lxc ] && . /etc/default/lxc [ -r /etc/default/lxc ] && . /etc/default/lxc
MIRRORSRV=${MIRRORSRV:-"ftp.ne.jp"} MIRRORSRV=${MIRRORSRV:-"ftp.ne.jp"}
...@@ -243,35 +245,23 @@ configure_plamo() { ...@@ -243,35 +245,23 @@ configure_plamo() {
} }
copy_configuration() { copy_configuration() {
# Create the fstab (empty by default)
touch $path/fstab
if ! cat <<- EOF >> $path/config ; then if ! cat <<- EOF >> $path/config ; then
lxc.utsname = $name lxc.utsname = $name
lxc.tty = 4
lxc.pts = 1024
lxc.mount.auto = proc sys cgroup
lxc.arch = $arch lxc.arch = $arch
lxc.cap.drop = sys_module mac_admin mac_override sys_time lxc.mount = $path/fstab
lxc.cgroup.devices.deny = a
# /dev/null and zero
lxc.cgroup.devices.allow = c 1:3 rwm
lxc.cgroup.devices.allow = c 1:5 rwm
# consoles
lxc.cgroup.devices.allow = c 5:0 rwm
lxc.cgroup.devices.allow = c 5:1 rwm
# /dev/{,u}random
lxc.cgroup.devices.allow = c 1:8 rwm
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 5:2 rwm
lxc.cgroup.devices.allow = c 136:* rwm
# rtc
lxc.cgroup.devices.allow = c 254:0 rm
# fuse
lxc.cgroup.devices.allow = c 10:229 rwm
EOF EOF
echo "Failed to add configuration." echo "Failed to add configuration."
return 1 return 1
fi fi
if [ -e "${LXC_TEMPLATE_CONFIG}/plamo.common.conf" ] ; then
echo "lxc.include = ${LXC_TEMPLATE_CONFIG}/plamo.common.conf" >> $path/config
fi
return 0 return 0
} }
......
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