Re: [Edmund GRIMLEY EVANS <edmundo@rano.demon.co.uk>] boot-floppies init.d/network
Hi.
In article <[🔎] 19990928114313.A3354@cistron.nl>
Marcel Harkema <marcel@debian.org> writes:
> On Tue, Sep 28, 1999 at 01:39:08AM -0400, Adam Di Carlo wrote:
> >
> > Anyone know if this problem has been fixed? If not, it should be
> > filed as a bad bug against boot-floppies.
>
> Seems to be fixed.
if boot-floppies does not have to create the /etc/init.d/network which
supports both of 2.0.xx and 2.2.xx kernel, then it will get no trouble.
Current netconfig.c in utilities/dbootstrap/ which I check out last night
from cvs tree have the setting for 2.2.xx kernel to create /etc/init.d/network.
#define NC_NETWORK_FILE "/etc/init.d/network"
(snip)
path = target_path(NC_NETWORK_FILE);
p_file=fopen(path,"w");
fprintf(p_file,
"#! /bin/sh\nifconfig lo 127.0.0.1\n");
fclose(p_file);
chmod(path,0755);
if(strcmp(netinterface,"none"))
if(strcmp(netinterface,"pcmcia")) /* PCMCIA uses a different file */
{
p_file=fopen(path,"a");
{
fprintf(p_file,"IPADDR=%s\n",IPtostr(prtbuf,ipaddr));
fprintf(p_file,"NETMASK=%s\n",IPtostr(prtbuf,netmask));
fprintf(p_file,"NETWORK=%s\n",IPtostr(prtbuf,network));
fprintf(p_file,"BROADCAST=%s\n",IPtostr(prtbuf,broadcast));
if(has_gw)
fprintf(p_file,"GATEWAY=%s\n",IPtostr(prtbuf,gateway));
else
fprintf(p_file,"GATEWAY=\n");
fprintf(p_file,
"ifconfig %s ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}\n",
netinterface);
fprintf(p_file,
"[ \"${GATEWAY}\" ] && route add default gw ${GATEWAY} metric 1\n");
}
fclose(p_file);
}
If this /etc/init.d/network is used with 2.0.xx kernel,
I wonder if it may cause some trouble since it has no "route add" command,
but I have not tested it yet.
--
Taketoshi Sano: <kgh12351@nifty.ne.jp>
Reply to: