various fixes mostly for linode
[automated-distro-installer] / fai / config / scripts / DEBIAN / 30-interface
index 808aa2504f8cb3ab06cf1df47a946951b9d03168..74c3058bbdcbdd134f25d669d9385dbea564e419 100755 (executable)
@@ -93,7 +93,7 @@ case "$FAI_ACTION" in
     elif [ -d $target/etc/network/interfaces.d ]; then
         # ifupdown >= 0.7.41 (Debian >= 8, Ubuntu >= 14.04)
 
-      if ifclass VM || ifclass BUSTER_LINODE; then
+      if ifclass VM || ifclass LINODE; then
         # note, this condition would apply to the elif below too,
         # but I don't specify a static ip in fai, so not bothering
         cat > $target/etc/network/interfaces <<-EOF
@@ -103,6 +103,8 @@ iface lo inet loopback
 iface $NIC1 inet dhcp
 iface $NIC1 inet6 auto
 EOF
+
+
       else
         cat > $target/etc/network/interfaces <<EOF
 # generated by FAI
@@ -120,6 +122,18 @@ iface br0 inet dhcp
   bridge_maxwait 0
 EOF
       fi
+
+      if ifclass LINODE; then
+        mkdir -p /etc/initramfs-tools/conf.d
+        cat >/etc/initramfs-tools/conf.d/mine <<EOF
+# dhcp in initramfs doesn't work on linode. i dunno why, whatever.
+# man 5 initramfs.conf
+# /usr/share/doc/klibc-utils/README.ipconfig.gz
+# /usr/share/initramfs-tools/scripts/functions
+IP=$linode_ip::$linode_gw:255.255.255.0::$linode_if:off
+EOF
+      fi
+
     else
       (
         iface_stanza lo loopback
@@ -135,11 +149,6 @@ EOF
     fi
     ;;
 
-  if ifclass BUSTER_LINODE; then
-    f=/etc/initramfs-tools/initramfs.conf
-    ainsl $f
-    fi
-
 esac
 
 # here fcopy is mostly used, when installing a client for running in a