]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
plamo: Change how to create objects under /dev in the container
authorKATOH Yasufumi <karma@jazz.email.ne.jp>
Fri, 6 Feb 2015 05:25:58 +0000 (14:25 +0900)
committerStéphane Graber <stgraber@ubuntu.com>
Sun, 8 Feb 2015 16:08:25 +0000 (18:08 +0200)
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 <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
config/templates/plamo.common.conf.in
templates/lxc-plamo.in

index e7809e13e81acd01eb104af15a75d3b6131ba6e2..888fa4b687068e16dc7e1209bb049cf17dff1b28 100644 (file)
@@ -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
index c588ddb7236ac869317fb36887711f2ac7e9bd6e..3e2a8f2e9f21cc15edb4afa0d2c616640e15488a 100644 (file)
@@ -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