[SCM] live-debconfig branch, debian-next, updated. debian/4.0_a2-1-4-gdec57d8

Daniel Baumann daniel at debian.org
Thu Aug 16 12:41:29 UTC 2012


The following commit has been merged in the debian-next branch:
commit dec57d80b1319d188765e2f00b5c8d35c2043bd5
Author: Daniel Baumann <daniel at debian.org>
Date:   Thu Aug 16 14:41:28 2012 +0200

    Making loopback interface configuration in ifupdown script configurable.

diff --git a/scripts/debconfig/0020-ifupdown b/scripts/debconfig/0020-ifupdown
index 1bc06ef..f533d3f 100755
--- a/scripts/debconfig/0020-ifupdown
+++ b/scripts/debconfig/0020-ifupdown
@@ -14,10 +14,17 @@ set -e
 
 Defaults ()
 {
+	_LO_ENABLE="${_LO_ENABLE:-true}"
 	_ETH0_METHOD="${_ETH0_METHOD:-dhcp}"
 	_ETH0_ADDRESS="${_ETH0_ADDRESS:-192.168.1.2}"
 }
 
+db_get live-debconfig/ifupdown/lo-enable
+_LO_ENABLE="${RET}" # boolean
+
+db_get live-debconfig/ifupdown/lo-comment
+_LO_COMMENT="${RET}" # string (w/empty)
+
 db_get live-debconfig/ifupdown/eth0-method
 _ETH0_METHOD="${RET}" # select
 
@@ -44,6 +51,12 @@ _NAMESERVERS="${RET}" # string (w/ empty)
 
 Defaults
 
+db_set live-debconfig/ifupdown/lo-enable "${_LO_ENABLE}"
+db_fset live-debconfig/ifupdown/lo-enable seen false
+
+db_set live-debconfig/ifupdown/lo-comment "${_LO_COMMENT}"
+db_fset live-debconfig/ifupdown/lo-comment seen false
+
 db_set live-debconfig/ifupdown/eth0-method "${_ETH0_METHOD}"
 db_fset live-debconfig/ifupdown/eth0-method seen false
 
@@ -69,6 +82,16 @@ db_set live-debconfig/ifupdown/nameservers "${_NAMESERVERS}"
 db_fset live-debconfig/ifupdown/nameservers seen false
 
 db_settitle live-debconfig/title
+db_input high live-debconfig/ifupdown/lo-enable || true
+db_go
+
+db_get live-debconfig/ifupdown/lo-enable
+_LO_ENABLE="${RET}" # boolean
+
+db_get live-debconfig/ifupdown/lo-comment
+_LO_COMMENT="${RET}" # string (w/ empty)
+
+db_settitle live-debconfig/title
 db_input high live-debconfig/ifupdown/eth0-method || true
 db_go
 
@@ -168,11 +191,23 @@ cat > /etc/network/interfaces << EOF
 # Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
 # /usr/share/doc/ifupdown/examples for more information.
 
-# The loopback network interface
+EOF
+
+case "${_LO_ENABLE}" in
+	true)
+		if [ -n "${_LO_COMMENT}" ]
+		then
+			echo "# ${_LO_COMMENT}" >> /etc/network/interfaces
+		fi
+
+cat >> /etc/network/interfaces << EOF
 auto lo
 iface lo inet loopback
 EOF
 
+		;;
+esac
+
 for _NUMBER in $(seq 0 ${_ETH_NUMBER})
 do
 	eval _COMMENT="$`echo _ETH${_NUMBER}_COMMENT`"
diff --git a/scripts/debconfig/0020-ifupdown.templates b/scripts/debconfig/0020-ifupdown.templates
index 23e2416..5a7bde5 100644
--- a/scripts/debconfig/0020-ifupdown.templates
+++ b/scripts/debconfig/0020-ifupdown.templates
@@ -2,12 +2,33 @@ Template: live-debconfig/title
 Type: title
 Description: live-debconfig: System Configuration
 
+Template: live-debconfig/ifupdown/lo-enable
+Type: boolean
+Default: true
+Description: live-debconfig: Enable Loopback Interface?
+ Should the loopback interface be enabled?
+ .
+ On normal systems a loopback interface needs to be configured.
+ However, on Linux Containers (LXC) no loopback interface from
+ within the container should be configured as the LXC tools
+ do that on container startup.
+ .
+ This defaults to yes.
+
+Template: live-debconfig/ifupdown/lo-comment
+Type: string
+Default:
+Description: live-debconfig: Loopback Interface Comment?
+ What optional comment would you like to give to the loopback interface?
+ .
+ This defaults to empty.
+
 Template: live-debconfig/ifupdown/eth0-method
 Type: select
 Choices: dhcp, static, none
 Default: dhcp
-Description: live-debconfig: Interface Method?
- What method should be used to configure the interface?
+Description: live-debconfig: Ethernet Interface Method?
+ What method should be used to configure the ethernet interface?
  .
  This defaults to dhcp and will require that you run a dhcp-server in your
  network.
@@ -15,15 +36,15 @@ Description: live-debconfig: Interface Method?
 Template: live-debconfig/ifupdown/eth0-comment
 Type: string
 Default:
-Description: live-debconfig: Interface Comment?
- What optional comment would you like to give to the interface?
+Description: live-debconfig: Ethernet Interface Comment?
+ What optional comment would you like to give to the ethernet interface?
  .
  This defaults to empty.
 
 Template: live-debconfig/ifupdown/eth0-address
 Type: string
 Default: 192.168.1.2
-Description: live-debconfig: IP Address?
+Description: live-debconfig: Ethernet IP Address?
  What should be the IP address of the current system?
  .
  This defaults to 192.168.1.2.
@@ -31,7 +52,7 @@ Description: live-debconfig: IP Address?
 Template: live-debconfig/ifupdown/eth0-broadcast
 Type: string
 Default: 192.168.1.255
-Description: live-debconfig: Broadcast Address?
+Description: live-debconfig: Ethernet Broadcast Address?
  What should be the broadcast address of the current system?
  .
  This defaults to empty.
@@ -39,7 +60,7 @@ Description: live-debconfig: Broadcast Address?
 Template: live-debconfig/ifupdown/eth0-gateway
 Type: string
 Default: 192.168.1.1
-Description: live-debconfig: Gateway Address?
+Description: live-debconfig: Ethernet Gateway Address?
  What should be the gateway address of the current system?
  .
  This defaults to empty.
@@ -47,7 +68,7 @@ Description: live-debconfig: Gateway Address?
 Template: live-debconfig/ifupdown/eth0-netmask
 Type: string
 Default: 255.255.255.0
-Description: live-debconfig: Network Mask?
+Description: live-debconfig: Ethernet Network Mask?
  What should be the netmask of the current system?
  .
  This defaults to empty.
@@ -55,7 +76,7 @@ Description: live-debconfig: Network Mask?
 Template: live-debconfig/ifupdown/eth0-network
 Type: string
 Default: 192.168.1.0
-Description: live-debconfig: Network Address?
+Description: live-debconfig: Ethernet Network Address?
  What should be the network address of the current system?
  .
  This defaults to empty.

-- 
live-debconfig



More information about the debian-live-changes mailing list