return 0
fi
+ ETH0_HEADER="auto eth0"
+ ETH0_IPV4=""
+ ETH0_IPV6=""
+
echo "auto eth0"
# see if there's a type
network_type=${NETWORK_CONFIG/,*}
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
- echo "iface eth0 inet dhcp"
+ ETH0_IPV4="iface eth0 inet dhcp"
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
INTERFACE_DETAILS="$(generate_network_config)"
-# temporarily do something stupid
-echo "$INTERFACE_DETAILS"
-exit 1
-
# rewrite the default config file
sed -i -e "/lxc./{w ${LXC_PATH}/config-auto" -e "d}" "${LXC_PATH}/config"
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"
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"
(cd "${LXC_ROOTFS}" && dpkg-deb -x ".$keyring_dpkg" .)
# replace the tar containing devices with something that doesn't contain any
-(cd "$LXC_ROOTFS/debootstrap" && rm devices.tar.gz && tar czvf devices.tar.gz --files-from=/dev/null)
+if [ -e "$LXC_ROOTFS/debootstrap/devices.tar.gz" ]; then
+ (cd "$LXC_ROOTFS/debootstrap" && rm devices.tar.gz && tar czvf devices.tar.gz --files-from=/dev/null)
+fi
# and mount a shitload of things for fun and profit...
for file in /var/lib/lxcfs/proc/*; do