]> git.sommitrealweird.co.uk Git - lxc-debian-unprivileged.git/commitdiff
debootstrap now may use extra options in mknod, this means that our fake mknod needs...
authorBrett Parker <iDunno@sommitrealweird.co.uk>
Tue, 21 Jun 2016 21:02:24 +0000 (22:02 +0100)
committerBrett Parker <iDunno@sommitrealweird.co.uk>
Tue, 21 Jun 2016 21:02:24 +0000 (22:02 +0100)
templates/lxc-debian-unprivileged

index a5128bf99c5ce15c6185395431c18144a2c1e6b3..abb925f75ee8040d2dba7b16be0b180e89cfc8a2 100755 (executable)
@@ -139,6 +139,10 @@ generate_network_config() {
         return 0
     fi
 
         return 0
     fi
 
+    ETH0_HEADER="auto eth0"
+    ETH0_IPV4=""
+    ETH0_IPV6=""
+
     echo "auto eth0"
     # see if there's a type
     network_type=${NETWORK_CONFIG/,*}
     echo "auto eth0"
     # see if there's a type
     network_type=${NETWORK_CONFIG/,*}
@@ -148,15 +152,15 @@ generate_network_config() {
     v6_configured=no
 
     if [ "$network_type" == "dhcp" ]; then
     v6_configured=no
 
     if [ "$network_type" == "dhcp" ]; then
-        echo "iface eth0 inet dhcp"
-        echo "iface eth0 inet6 dhcp"
+        ETH0_IPV4="iface eth0 inet dhcp"
+        ETH0_IPV6="iface eth0 inet6 dhcp"
         v4_configured=yes
         v6_configured=yes
     elif [ "$network_type" == "dhcp4" ]; then
         v4_configured=yes
         v6_configured=yes
     elif [ "$network_type" == "dhcp4" ]; then
-        echo "iface eth0 inet dhcp"
+        ETH0_IPV4="iface eth0 inet dhcp"
         v4_configured=yes
     elif [ "$network_type" == "dhcp6" ]; then
         v4_configured=yes
     elif [ "$network_type" == "dhcp6" ]; then
-        echo "iface eth0 inet6 dhcp"
+        ETH0_IPV6="iface eth0 inet6 dhcp"
         v6_configured=yes
     elif [ "$network_type" != "static" ]; then
         echo "Unknown network type: $network_type" 1>&2
         v6_configured=yes
     elif [ "$network_type" != "static" ]; then
         echo "Unknown network type: $network_type" 1>&2
@@ -281,7 +285,15 @@ mkdir "${LXC_PATH}/bin"
 cat <<EOF > "${LXC_PATH}/bin/mknod"
 #!/bin/sh
 
 cat <<EOF > "${LXC_PATH}/bin/mknod"
 #!/bin/sh
 
-exec touch "\$1"
+# look for the first argument that looks like a path
+for i do
+    case \$i in
+        /*)
+            exec touch "\$i"
+            ;;
+    esac
+done
+
 EOF
 
 chmod 755 "${LXC_PATH}/bin/mknod"
 EOF
 
 chmod 755 "${LXC_PATH}/bin/mknod"
@@ -290,6 +302,8 @@ export PATH="${LXC_PATH}/bin:$PATH"
 
 debootstrap --foreign --include debian-archive-keyring,ifupdown,isc-dhcp-client,locales,openssh-server $DEBIAN_RELEASE "${LXC_ROOTFS}" $DEBIAN_MIRROR
 
 
 debootstrap --foreign --include debian-archive-keyring,ifupdown,isc-dhcp-client,locales,openssh-server $DEBIAN_RELEASE "${LXC_ROOTFS}" $DEBIAN_MIRROR
 
+echo "DEBOOTSTRAP STAGE 1 COMPLETE"
+
 # now totally skip that check in the new root, because it sucks.
 sed -i -e 's#check_sane_mount () {#check_sane_mount () {\n\treturn 0#;' "${LXC_ROOTFS}/debootstrap/functions"
 
 # now totally skip that check in the new root, because it sucks.
 sed -i -e 's#check_sane_mount () {#check_sane_mount () {\n\treturn 0#;' "${LXC_ROOTFS}/debootstrap/functions"