Adding support for mtu values in ifupdown script.
authorDaniel Baumann <daniel@debian.org>
Tue, 23 Oct 2012 12:53:48 +0000 (14:53 +0200)
committerDaniel Baumann <daniel@debian.org>
Tue, 23 Oct 2012 12:53:48 +0000 (14:53 +0200)
scripts/debconfig/0020-ifupdown
scripts/debconfig/0020-ifupdown.templates

index 33250bd..45400f0 100755 (executable)
@@ -61,6 +61,9 @@ _ETH0_BROADCAST="${RET}" # string (w/ empty)
 db_get live-debconfig/ifupdown/eth0-gateway
 _ETH0_GATEWAY="${RET}" # string (w/ empty)
 
+db_get live-debconfig/ifupdown/eth0-mtu
+_ETH0_MTU="${RET}" # string (w/ empty)
+
 db_get live-debconfig/ifupdown/eth0-netmask
 _ETH0_NETMASK="${RET}" # string (w/o empty)
 
@@ -105,6 +108,9 @@ db_fset live-debconfig/ifupdown/eth0-broadcast seen false
 db_set live-debconfig/ifupdown/eth0-gateway "${_ETH0_GATEWAY}"
 db_fset live-debconfig/ifupdown/eth0-gateway seen false
 
+db_set live-debconfig/ifupdown/eth0-mtu "${_ETH0_MTU}"
+db_fset live-debconfig/ifupdown/eth0-mtu seen false
+
 db_set live-debconfig/ifupdown/eth0-netmask "${_ETH0_NETMASK}"
 db_fset live-debconfig/ifupdown/eth0-netmask seen false
 
@@ -166,6 +172,10 @@ case "${_ETH0_METHOD}" in
                db_go
 
                db_settitle live-debconfig/title
+               db_input high live-debconfig/ifupdown/eth0-mtu || true
+               db_go
+
+               db_settitle live-debconfig/title
                db_input high live-debconfig/ifupdown/eth0-netmask || true
                db_go
 
@@ -212,6 +222,11 @@ do
                eval _ETH${_NUMBER}_GATEWAY="\"${RET}\"" # string (w/ empty)
        fi
 
+       if db_get live-debconfig/ifupdown/eth${_NUMBER}-mtu
+       then
+               eval _ETH${_NUMBER}_MTU="\"${RET}\"" # string (w/o empty)
+       fi
+
        if db_get live-debconfig/ifupdown/eth${_NUMBER}-netmask
        then
                eval _ETH${_NUMBER}_NETMASK="\"${RET}\"" # string (w/o empty)
@@ -278,6 +293,7 @@ do
        eval _ADDRESS="$`echo _ETH${_NUMBER}_ADDRESS`"
        eval _BROADCAST="$`echo _ETH${_NUMBER}_BROADCAST`"
        eval _GATEWAY="$`echo _ETH${_NUMBER}_GATEWAY`"
+       eval _MTU="$`echo _ETH${_NUMBER}_MTU`"
        eval _NETMASK="$`echo _ETH${_NUMBER}_NETMASK`"
        eval _NETWORK="$`echo _ETH${_NUMBER}_NETWORK`"
        eval _POST_UP="$`echo _ETH${_NUMBER}_POST_UP`"
@@ -333,6 +349,11 @@ EOF
                                echo "  gateway         ${_GATEWAY}" >> /etc/network/interfaces.tmp
                        fi
 
+                       if [ -n "${_MTU}" ]
+                       then
+                               echo "  mtu             ${_MTU}" >> /etc/network/interfaces.tmp
+                       fi
+
                        if [ -n "${_NETMASK}" ]
                        then
                                echo "  netmask         ${_NETMASK}" >> /etc/network/interfaces.tmp
index 131dbe9..d759e30 100644 (file)
@@ -65,6 +65,14 @@ Description: live-debconfig: Ethernet Gateway Address?
  .
  This defaults to empty.
 
+Template: live-debconfig/ifupdown/eth0-mtu
+Type: string
+Default:
+Description: live-debconfig: Ethernet MTU?
+ What should be the MTU for the Ethernet device?
+ .
+ This defaults to empty.
+
 Template: live-debconfig/ifupdown/eth0-netmask
 Type: string
 Default: