Browse Source
removed much from TODO create dirs as necessary install menutest into DEBIAN (fixed it's return value too) cleaned up templates, took some phrases from etherconf cleaned up overall flow handle missing data better moved functions around a bit so no need for protos (that's why the diff is unreadable) r295master

12 changed files with 626 additions and 613 deletions
@ -1,14 +1,4 @@ |
|||
* put in checks so the user can't enter data that is clearly invalid (perhaps this will be done through debconf. |
|||
* fall back to safe defaults if the user doesn't enter a particular value (ex. gateway) |
|||
* do other sorts of network configurations (pcmcia, ppp) |
|||
* inderstand the target_path() thing, and do it properly |
|||
* what do we do differently if it is a CD filesystem? |
|||
* decide what numbers you will actually present the user with for confirmation (you have overkill now) |
|||
* fix the note about what the user should do if we don't find any network interfaces. Since I don't now know what the flow of the installer is going to be I can't suggest what they should do, I've got the test in there from the old installer now. |
|||
* currently we get an internal error if the user has lots of network interfaces, find a better way of handling that. |
|||
* etherconf has some good descriptive text, perhaps I want to use it in place of the existing text. |
|||
* when the real dhcpcd installs itself we want to make sure it doesn't destroy our nice working configuration, how to do that? |
|||
* dhcp and static config udebs share a fair amount of code, perhaps a shared library? They also share templates, need to make a netcfg-shared udeb? |
|||
* /etc/dhcpc needs to be created, udpkg isn't creating it for me right now |
|||
* get the /proc filesystem working |
|||
* strdup all the dotted quads rather than playing with num2dot etc. all the time |
|||
* dhcp and static udebs share a fair amount, perhaps that can be fixed. |
|||
|
@ -1,7 +1,7 @@ |
|||
#!/bin/sh |
|||
|
|||
if [ -z "`/sbin/ifconfig -a`" ] ; then |
|||
exit 1 |
|||
exit 0 |
|||
else |
|||
exit -1 |
|||
fi |
@ -1,17 +1,51 @@ |
|||
Template: netcfg/no_interfaces |
|||
Template: netcfg/get_domain |
|||
Type: string |
|||
Description: Choose the domain name. |
|||
The domain name is the part of your Internet address to the right |
|||
of your host name. It is often something that ends in .com, .net, |
|||
.edu, or .org. If you are setting up a home network, you can make |
|||
something up, but make sure you use the same domain name on all |
|||
your computers. |
|||
|
|||
Template: netcfg/get_nameservers |
|||
Type: string |
|||
Description: please enter a network interface. |
|||
No network interfaces were found. |
|||
Description: Choose the DNS Server Addresses |
|||
Please enter the IP addresses (not host names) of up to 3 name servers, |
|||
separated by spaces. Do not use commas. The servers will be queried in the |
|||
order in which you enter them. If you don't want to use any name servers just |
|||
leave this field blank. |
|||
|
|||
Template: netcfg/choose_interface |
|||
Type: select |
|||
Choices: ${ifchoices} |
|||
Description: Choose an interface. |
|||
The following interfaces were detected. Choose the type of your primary |
|||
network interface that you will need for installing Debian (via NFS or HTTP). |
|||
network interface that you will need for installing the Debian system (via NFS or HTTP). |
|||
|
|||
Template: netcfg/error_cfg |
|||
Type: note |
|||
Description: An error occured. |
|||
Something went wrong when I tried to activate your network. |
|||
|
|||
Template: netcfg/get_hostname |
|||
Type: string |
|||
Default: debian |
|||
Description: Enter the system's hostname. |
|||
The hostname is a single word that identifies your system to the |
|||
network. If you don't know what your hostname should be, consult |
|||
your network administrator. If you are setting up your own home |
|||
network, you can make something up here. |
|||
|
|||
Template: netcfg/error |
|||
Type: note |
|||
Description: An error occured and I cannot continue. |
|||
Feel free to retry. The output of some commands is logged in /var/log/debian-installer.log. |
|||
|
|||
Template: netcfg/no_interfaces |
|||
Type: note |
|||
Description: No interfaces were detected. |
|||
No network interfaces were found. That means that the installation system |
|||
was unable to find a network device. If you do have a network card, then it |
|||
is possible that the module for it hasn't been selected yet. Go back to |
|||
'Configure Network Hardware'. |
|||
|
|||
|
File diff suppressed because it is too large
@ -0,0 +1,52 @@ |
|||
#include <stdio.h> |
|||
#include <string.h> |
|||
#include <stdlib.h> |
|||
#include <sys/types.h> |
|||
#include <sys/stat.h> |
|||
#include <unistd.h> |
|||
|
|||
|
|||
#define EXECLOG_FILE "/var/log/debian-installer.log" |
|||
#define MAXLINE 512 |
|||
#define DEBUG |
|||
|
|||
int |
|||
execlog (const char *incmd) |
|||
{ |
|||
FILE *logfile, *output; |
|||
char cmd[strlen (incmd) + 6]; |
|||
char line[MAXLINE]; |
|||
strcpy (cmd, incmd); |
|||
|
|||
if ((logfile = fopen (EXECLOG_FILE, "a")) == NULL) |
|||
{ |
|||
perror ("execlog: fopen"); |
|||
return system (cmd); |
|||
} |
|||
|
|||
/* FIXME: this can cause the shell command if there's redirection
|
|||
already in the passed string */ |
|||
strcat (cmd, " 2>&1"); |
|||
fprintf (logfile, "---- executing '%s' ----\n", cmd); |
|||
output = popen (cmd, "r"); |
|||
while (fgets (line, MAXLINE, output) != NULL) |
|||
{ |
|||
fprintf (logfile, "%s", line); |
|||
} |
|||
fprintf (logfile, "---- finished '%s' ----\n", cmd); |
|||
fclose (logfile); |
|||
/* FIXME we aren't getting the return value from the actual command
|
|||
executed, not sure how to do that cleanly */ |
|||
return (pclose (output)); |
|||
} |
|||
|
|||
|
|||
int |
|||
check_dir (const char *dirname) |
|||
{ |
|||
struct stat check; |
|||
if (stat (dirname, &check) == -1) |
|||
return -1; |
|||
else |
|||
return S_ISDIR (check.st_mode); |
|||
} |
@ -0,0 +1,7 @@ |
|||
#ifndef __DEBIAN_INSTALLER_H__ |
|||
#define __DEBIAN_INSTALLER_H__ |
|||
|
|||
int execlog(char *); |
|||
int check_dir(char *); |
|||
|
|||
#endif /* __DEBIAN_INSTALLER_H__ */ |
Loading…
Reference in new issue