On Wed, Jan 23, 2002 at 10:32:34AM -0500, Brian Mays wrote: > David Kimdon <dwhedon@debian.org> responded: > > I'm hearing that we shouldn't be doing anything to > > /etc/pcmcia/network.opts and just write everything to > > /etc/network/interfaces ? > > Yes. The pcmcia-cs package now supports this as of version 3.1.25-1. I > figured that this would make it easier for the boot-floppies team, since > network configuration can now be confined to one file. > > Use the stock (unmodified) versions of /etc/pcmcia/network and > /etc/pcmcia/network.opts from the pcmcia-cs package. As you can see, > the last part of the network.opts file calls ifup/ifdown. If you need > anything changed in the pcmcia packages, please let me know. The attached patch rips out the special PCMCIA support. Could someone with such hardware please test it? Matt
Index: netconfig.c =================================================================== RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/netconfig.c,v retrieving revision 1.80 diff -u -p -r1.80 netconfig.c --- netconfig.c 2002/01/03 19:19:54 1.80 +++ netconfig.c 2002/01/23 16:31:23 @@ -32,8 +32,6 @@ #define NC_ETC_NETWORK_DIR "/etc/network" #define NC_INTERFACES_FILE "/etc/network/interfaces" #define NC_HOSTS_FILE "/etc/hosts" -#define NC_PCMCIA_DIR "/etc/pcmcia" -#define NC_PCMCIA_FILE "/etc/pcmcia/network.opts" /* Use 2.2.x because dhclient forces -q (quiet) and I like logging. Using dhclient would make adding 2.0.x support just a matter of @@ -634,74 +632,7 @@ int write_common_network() { } -#ifdef PCMCIA -/* - * Write the PCMCIA network configuration (static and DHCP) - */ -int write_pcmcia_network() { - FILE *p_file; - char *tmp, *ns, *aux; - const char* path; - int ix; - - path = target_path(NC_PCMCIA_DIR); - if (check_dir(path) == -1) mkdir(path, 0755); - - if ((p_file = fopen(target_path(NC_PCMCIA_FILE), "w"))) { - fprintf(p_file, "# Network adapter configuration\n#\n# Automatically generated during the Debian installation\n#\n"); - fprintf(p_file, "# The address format is \"scheme,socket,instance,hwaddr\".\n#\ncase \"$ADDRESS\" in\n*,*,*,*)\n"); - fprintf(p_file, "\t# Transceiver selection, for some cards -- see 'man ifport'\n"); - if (transceiver) { - fprintf(p_file, "\tIF_PORT=\"%s\"\n", transceiver); - } else { - fprintf(p_file, "\tIF_PORT=\"\"\n"); - } - if(use_dhcp) { - if( NAME_ISEXE( NC_DHCLIENT_FILE, &nc_statbuf )) - fprintf(p_file, "\tDHCLIENT=\"y\"\n"); - else - fprintf(p_file, "\tPUMP=\"y\"\n"); - } else { - fprintf(p_file, "\tPUMP=\"n\"\n"); - fprintf(p_file, "\t# Host's IP address, netmask, network address, broadcast address\n"); - fprintf(p_file, "\tIPADDR=\"%s\"\n", IP4tostr(prtbuf, ipaddr)); - fprintf(p_file, "\tNETMASK=\"%s\"\n", IP4tostr(prtbuf, netmask)); - fprintf(p_file, "\tNETWORK=\"%s\"\n", IP4tostr(prtbuf, network)); - fprintf(p_file, "\tBROADCAST=\"%s\"\n", IP4tostr(prtbuf, broadcast)); - if (has_gw) { - fprintf(p_file, "\tGATEWAY=\"%s\"\n", IP4tostr(prtbuf, gateway)); - } else { - fprintf(p_file, "\tGATEWAY=\"\"\n"); - } - if (domain) { - fprintf(p_file, "\tDOMAIN=\"%s\"\n", domain); - } - if (nameserver) { - aux = ns = strdup(nameserver); - ix = 1; - while ((tmp = strchr(ns, ' ')) != NULL) { - *tmp = '\0'; - tmp++; - fprintf(p_file, "\tDNS_%d=\"%s\"\n", ix, ns); - ns = tmp; - ix++; - } - fprintf(p_file, "\tDNS_%d=\"%s\"\n", ix, ns); - free(aux); - } else { - fprintf(p_file, "\tDNS_1=\"\"\n"); - } - } - fprintf(p_file, "\t;;\nesac\n"); - fclose(p_file); - return 0; - } else { - return 255; - } -} -#endif /* PCMCIA */ - /* * Write the static network configuration * NOTE: This function must not be called with netinterface == NULL @@ -756,36 +687,28 @@ int write_static_network() { } else { ret = 255; } -#ifdef PCMCIA - /* - * Only write /etc/network/interfaces if we have a non-PCMCIA interface. - */ - if (has_pcmcia) { - ret = write_pcmcia_network(); - } else -#endif /* PCMCIA */ - { - if ((p_file = fopen(target_path(NC_INTERFACES_FILE), "a"))) { - fprintf(p_file, "\n# The first network card - this entry was created during the Debian installation\n"); - fprintf(p_file, "# (network, broadcast and gateway are optional)\n"); - fprintf(p_file, "auto %s\n", netinterface); - fprintf(p_file, "iface %s inet static\n", netinterface); - fprintf(p_file, "\taddress %s\n", IP4tostr(prtbuf, ipaddr)); - fprintf(p_file, "\tnetmask %s\n", IP4tostr(prtbuf, netmask)); - if (!has_pointopoint) { - fprintf(p_file, "\tnetwork %s\n", IP4tostr(prtbuf, network)); - fprintf(p_file, "\tbroadcast %s\n", IP4tostr(prtbuf, broadcast)); - } else { - fprintf(p_file, "\tpointopoint %s\n", IP4tostr(prtbuf, peer)); - } - if (has_gw) { - fprintf(p_file, "\tgateway %s\n", IP4tostr(prtbuf, gateway)); - } - fclose(p_file); + + if ((p_file = fopen(target_path(NC_INTERFACES_FILE), "a"))) { + fprintf(p_file, "\n# The first network card - this entry was created during the Debian installation\n"); + fprintf(p_file, "# (network, broadcast and gateway are optional)\n"); + fprintf(p_file, "auto %s\n", netinterface); + fprintf(p_file, "iface %s inet static\n", netinterface); + fprintf(p_file, "\taddress %s\n", IP4tostr(prtbuf, ipaddr)); + fprintf(p_file, "\tnetmask %s\n", IP4tostr(prtbuf, netmask)); + if (!has_pointopoint) { + fprintf(p_file, "\tnetwork %s\n", IP4tostr(prtbuf, network)); + fprintf(p_file, "\tbroadcast %s\n", IP4tostr(prtbuf, broadcast)); } else { - ret = 255; + fprintf(p_file, "\tpointopoint %s\n", IP4tostr(prtbuf, peer)); } + if (has_gw) { + fprintf(p_file, "\tgateway %s\n", IP4tostr(prtbuf, gateway)); + } + fclose(p_file); + } else { + ret = 255; } + return ret; } @@ -803,18 +726,11 @@ int write_dhcp_network() { /* Copy /etc/resolv.conf (created by dhcp) to the target system */ vexeclog (LOG_DEBUG, "cp %s %s", NC_RESOLV_FILE, target_path(NC_RESOLV_FILE)); -#ifdef PCMCIA - if (has_pcmcia) { - write_pcmcia_network(); - } else -#endif /* PCMCIA */ - { - p_file = fopen(target_path(NC_INTERFACES_FILE), "a"); - fprintf(p_file, "\n# The first network card - this entry was created during the Debian installation\n"); - fprintf(p_file, "auto %s\n", netinterface); - fprintf(p_file, "iface %s inet dhcp\n", netinterface); - fclose(p_file); - } + p_file = fopen(target_path(NC_INTERFACES_FILE), "a"); + fprintf(p_file, "\n# The first network card - this entry was created during the Debian installation\n"); + fprintf(p_file, "auto %s\n", netinterface); + fprintf(p_file, "iface %s inet dhcp\n", netinterface); + fclose(p_file); return 0; }
Attachment:
pgpBsh9xIHuLT.pgp
Description: PGP signature