Browse Source

Add support to disable network configuration using preseeding in netcfg/enable template. Thanks to Anthony L. Awtrey <tony@awtrey.com> for the patch. Closes: #538265

r59735
tags/1.52
Otavio Salvador 12 years ago
parent
commit
1bcd8bfda6
3 changed files with 24 additions and 0 deletions
  1. +5
    -0
      debian/changelog
  2. +6
    -0
      debian/netcfg-common.templates
  3. +13
    -0
      netcfg.c

+ 5
- 0
debian/changelog View File

@@ -4,6 +4,11 @@ netcfg (1.52) UNRELEASED; urgency=low
* Loopback network interface name is lo on GNU/Linux and lo0 on
GNU/kFreeBSD; generalize it with a macro.

[ Otavio Salvador ]
* Add support to disable network configuration using preseeding in
netcfg/enable template. Thanks to Anthony L. Awtrey
<tony@awtrey.com> for the patch. Closes: #538265

-- Luca Favatella <slackydeb@gmail.com> Thu, 23 Jul 2009 00:44:44 +0200

netcfg (1.51) unstable; urgency=low


+ 6
- 0
debian/netcfg-common.templates View File

@@ -1,3 +1,9 @@
Template: netcfg/enable
Type: boolean
Default: true
Description: for internal use; can be preseeded
Set to false to disable netcfg entirely via preseed.

Template: netcfg/use_dhcp
Type: boolean
Default: true


+ 13
- 0
netcfg.c View File

@@ -88,6 +88,19 @@ int main(int argc, char *argv[])
/* initialize debconf */
client = debconfclient_new();
debconf_capb(client, "backup");

/* Check to see if netcfg should be run at all */
debconf_get(client, "netcfg/enable");
if (!strcmp(client->value, "false")) {
struct in_addr null_ipaddress;
char *hostname = NULL;

null_ipaddress.s_addr = 0;
netcfg_get_hostname(client, "netcfg/dhcp_hostname", &hostname, 0);

netcfg_write_common(null_ipaddress, hostname, NULL);
return 0;
}
/* always always always default back to DHCP, unless you've specified
* disable_dhcp on the command line. */


Loading…
Cancel
Save