Browse Source

utils.c uses syslog, change numbering scheme,

busybox sh doesn't like exit -1, so it doesn't get it
fix spacing in templates
make clean target work

r299
master
David Whedon 23 years ago
parent
commit
713b0ddb61
  1. 6
      debian/changelog
  2. 4
      debian/menutest-common
  3. 2
      debian/netcfg-common.templates
  4. 1
      debian/netcfg-dhcp.templates
  5. 3
      debian/netcfg-static.templates
  6. 2
      debian/rules
  7. 16
      utils.c

6
debian/changelog

@ -1,17 +1,17 @@
netcfg (0.3) unstable; urgency=low
netcfg (0.03) unstable; urgency=low
* cleaned up much, now it plays well with main-menu and
actually configures the network.
-- David Whedon <dwhedon@gordian.com> Sat, 30 Dec 2000 23:01:09 -0800
netcfg (0.2) unstable; urgency=low
netcfg (0.02) unstable; urgency=low
* dhcp and static config now in two separate udebs
-- David Whedon <dwhedon@gordian.com> Tue, 26 Dec 2000 20:53:58 -0800
netcfg (0.1) unstable; urgency=low
netcfg (0.01) unstable; urgency=low
* Initial Release.

4
debian/menutest-common

@ -2,9 +2,7 @@
if [ -z "`/sbin/ifconfig`" ] &&
[ -n "`cat /proc/net/dev | sed -e "s/lo://" | grep "[a-z0-9]*:[ ]*[0-9]*"`" ] ; then
echo "runme"
exit 0
else
echo "dont"
exit -1
exit 1
fi

2
debian/netcfg-common.templates

@ -39,7 +39,7 @@ Description: Enter the system's hostname.
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.
Feel free to retry.
Template: netcfg/no_interfaces
Type: note

1
debian/netcfg-dhcp.templates

@ -20,3 +20,4 @@ Template: netcfg/do_dhcp
Type: note
Description: I will now configure the network.
This may take some time. It shouldn't take more than a minute or two.

3
debian/netcfg-static.templates

@ -39,4 +39,5 @@ Description: Is this configuration correct?
ipaddress = ${ipaddress}
netmask = ${netmask}
gateway = ${gateway}
nameservers = ${nameservers}
nameservers = ${nameservers}

2
debian/rules

@ -37,7 +37,7 @@ clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
rm -f debian/*.config
rm -f debian/netcfg-dhcp.postinst debian/netcfg-static.postinst
# Add here commands to clean up after the build process.
-$(MAKE) clean

16
utils.c

@ -4,9 +4,10 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <syslog.h>
#define EXECLOG_FILE "/var/log/debian-installer.log"
#define EXECLOG_FILE "/var/log/installer.log"
#define MAXLINE 512
#define DEBUG
@ -18,23 +19,18 @@ execlog (const char *incmd)
char line[MAXLINE];
strcpy (cmd, incmd);
if ((logfile = fopen (EXECLOG_FILE, "a")) == NULL)
{
perror ("execlog: fopen");
return system (cmd);
}
openlog ("installer", LOG_PID | LOG_PERROR, LOG_USER);
syslog (LOG_DEBUG, "running cmd '%s'", 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);
syslog (LOG_DEBUG, line);
}
fprintf (logfile, "---- finished '%s' ----\n", cmd);
fclose (logfile);
closelog ();
/* FIXME we aren't getting the return value from the actual command
executed, not sure how to do that cleanly */
return (pclose (output));

Loading…
Cancel
Save