]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
ubuntu: Various fixes
authorStéphane Graber <stgraber@ubuntu.com>
Sun, 21 Apr 2013 18:09:24 +0000 (20:09 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 22 Apr 2013 06:59:53 +0000 (08:59 +0200)
 - Drop disabled entries from allowed devices list
 - Improve generated config layout a bit
 - Drop redundant uname call
 - Re-generate the SSH host keys on container creation

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
templates/lxc-ubuntu-cloud.in
templates/lxc-ubuntu.in

index 22bce1f2779a4854cd09a7622ffbef4614de1000..d60f2c74f08b8bd9eafd55e8897677f1a15379d3 100644 (file)
@@ -70,8 +70,6 @@ lxc.cgroup.devices.allow = c 1:5 rwm
 # consoles
 lxc.cgroup.devices.allow = c 5:1 rwm
 lxc.cgroup.devices.allow = c 5:0 rwm
-#lxc.cgroup.devices.allow = c 4:0 rwm
-#lxc.cgroup.devices.allow = c 4:1 rwm
 # /dev/{,u}random
 lxc.cgroup.devices.allow = c 1:9 rwm
 lxc.cgroup.devices.allow = c 1:8 rwm
@@ -79,15 +77,15 @@ lxc.cgroup.devices.allow = c 136:* rwm
 lxc.cgroup.devices.allow = c 5:2 rwm
 # rtc
 lxc.cgroup.devices.allow = c 254:0 rwm
-#fuse
+# fuse
 lxc.cgroup.devices.allow = c 10:229 rwm
-#tun
+# tun
 lxc.cgroup.devices.allow = c 10:200 rwm
-#full
+# full
 lxc.cgroup.devices.allow = c 1:7 rwm
-#hpet
+# hpet
 lxc.cgroup.devices.allow = c 10:228 rwm
-#kvm
+# kvm
 lxc.cgroup.devices.allow = c 10:232 rwm
 EOF
 
@@ -148,8 +146,6 @@ if [ -f /etc/lsb-release ]; then
     esac
 fi
 
-arch=$(uname -m)
-
 # Code taken from debootstrap
 if [ -x /usr/bin/dpkg ] && /usr/bin/dpkg --print-architecture >/dev/null 2>&1; then
     arch=`/usr/bin/dpkg --print-architecture`
index 8c6593b15ab4499b9b22d59e70e5f4edf39dee14..8a92f955bb52bb6cae528b4236957e2736287802 100644 (file)
@@ -36,7 +36,7 @@ configure_ubuntu()
     hostname=$2
     release=$3
 
-   # configure the network using the dhcp
+    # configure the network using the dhcp
     cat <<EOF > $rootfs/etc/network/interfaces
 # This file describes the network interfaces available on your system
 # and how to activate them. For more information, see interfaces(5).
@@ -91,6 +91,14 @@ EOF
         fi
     fi
 
+    # generate new SSH keys
+    if [ -x $rootfs@LOCALSTATEDIR@/lib/dpkg/info/openssh-server.postinst ]; then
+        rm -f $rootfs/etc/ssh/ssh_host_*key*
+        mv $rootfs/etc/init/ssh.conf $rootfs/etc/init/ssh.conf.disabled
+        chroot $rootfs @LOCALSTATEDIR@/lib/dpkg/info/openssh-server.postinst configure
+        mv $rootfs/etc/init/ssh.conf.disabled $rootfs/etc/init/ssh.conf
+    fi
+
     return 0
 }
 
@@ -350,8 +358,6 @@ lxc.cgroup.devices.allow = c 1:5 rwm
 # consoles
 lxc.cgroup.devices.allow = c 5:1 rwm
 lxc.cgroup.devices.allow = c 5:0 rwm
-#lxc.cgroup.devices.allow = c 4:0 rwm
-#lxc.cgroup.devices.allow = c 4:1 rwm
 # /dev/{,u}random
 lxc.cgroup.devices.allow = c 1:9 rwm
 lxc.cgroup.devices.allow = c 1:8 rwm
@@ -359,15 +365,15 @@ lxc.cgroup.devices.allow = c 136:* rwm
 lxc.cgroup.devices.allow = c 5:2 rwm
 # rtc
 lxc.cgroup.devices.allow = c 254:0 rwm
-#fuse
+# fuse
 lxc.cgroup.devices.allow = c 10:229 rwm
-#tun
+# tun
 lxc.cgroup.devices.allow = c 10:200 rwm
-#full
+# full
 lxc.cgroup.devices.allow = c 1:7 rwm
-#hpet
+# hpet
 lxc.cgroup.devices.allow = c 10:228 rwm
-#kvm
+# kvm
 lxc.cgroup.devices.allow = c 10:232 rwm
 EOF
 
@@ -605,7 +611,6 @@ if [ -f /etc/lsb-release ]; then
 fi
 
 bindhome=
-arch=$(uname -m)
 
 # Code taken from debootstrap
 if [ -x /usr/bin/dpkg ] && /usr/bin/dpkg --print-architecture >/dev/null 2>&1; then