From: KATOH Yasufumi Date: Fri, 6 Feb 2015 05:25:58 +0000 (+0900) Subject: plamo: Change how to create objects under /dev in the container X-Git-Tag: lxc-2.0.0.beta1~368 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a61848fe21a883720b3bf078c6ac7c2afe338030;p=thirdparty%2Flxc.git plamo: Change how to create objects under /dev in the container lxc-plamo stop: * creating objects under /dev when creating the container * removing /dev population process from original rc script now populate /dev at container boot time, and allow to enable lxc.autodev=1 Signed-off-by: KATOH Yasufumi Acked-by: Stéphane Graber --- diff --git a/config/templates/plamo.common.conf.in b/config/templates/plamo.common.conf.in index e7809e13e..888fa4b68 100644 --- a/config/templates/plamo.common.conf.in +++ b/config/templates/plamo.common.conf.in @@ -1,15 +1,9 @@ # This derives from the global common config lxc.include = @LXCTEMPLATECONFIG@/common.conf -# Default mount -lxc.mount.entry = none dev/shm tmpfs nosuid,nodev,noexec,mode=1777 0 0 - # Doesn't support consoles in /dev/lxc/ lxc.devttydir = -# /dev/* is created manually by template -lxc.autodev = 0 - # Extra cgroup device access ## rtc lxc.cgroup.devices.allow = c 254:0 rm diff --git a/templates/lxc-plamo.in b/templates/lxc-plamo.in index c588ddb72..3e2a8f2e9 100644 --- a/templates/lxc-plamo.in +++ b/templates/lxc-plamo.in @@ -147,23 +147,6 @@ install_plamo() { } configure_plamo() { - # create /dev - chmod 666 $rootfs/dev/null - mknod -m 666 $rootfs/dev/zero c 1 5 - chmod 666 $rootfs/dev/random - mknod -m 666 $rootfs/dev/urandom c 1 9 - mkdir -m 755 $rootfs/dev/pts - mkdir -m 755 $rootfs/dev/shm - chmod 666 $rootfs/dev/tty - chmod 600 $rootfs/dev/console - mknod -m 666 $rootfs/dev/tty0 c 4 0 - mknod -m 666 $rootfs/dev/tty1 c 4 1 - mknod -m 666 $rootfs/dev/tty2 c 4 2 - mknod -m 666 $rootfs/dev/tty3 c 4 3 - mknod -m 666 $rootfs/dev/tty4 c 4 4 - mknod -m 666 $rootfs/dev/full c 1 7 - mknod -m 600 $rootfs/dev/initctl p - mknod -m 666 $rootfs/dev/ptmx c 5 2 # suppress log level output for udev sed -i 's/="err"/=0/' $rootfs/etc/udev/udev.conf # /etc/fstab @@ -207,10 +190,9 @@ configure_plamo() { echo "Setting root password to 'root'..." echo "root:root" | chroot $rootfs chpasswd echo "Please change root password!" - # /etc/rc.d/rc.S ed - $rootfs/etc/rc.d/rc.S <<- "EOF" - /^mount -w -n -t proc/;/^# ln -s \/bin\/true/-1d - /^mknod \/dev\/unikey/;/^# Clean \/etc\/mtab/-2d + /^mount -w -n -t proc/;/^mkdir \/dev\/shm/-1d + /^mknod \/dev\/null/;/^# Clean \/etc\/mtab/-2d /^# copy the rules/;/^# Set the hostname/-1d /^# Check the integrity/;/^# Clean up temporary/-1d w