... Viel zu tun :D

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@353 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
ms
2006-11-30 21:30:57 +00:00
parent 02c629b9ff
commit 33634aa878
208 changed files with 183 additions and 154095 deletions

View File

@@ -15,7 +15,7 @@
#define URL_INSTALL 1
#define DISK_INSTALL 2
#define INST_FILECOUNT 6600
#define UNATTENDED_CONF "/cdrom/data/unattended.conf"
#define UNATTENDED_CONF "/cdrom/boot/unattended.conf"
int raid_disk = 0;
FILE *flog = NULL;
@@ -347,7 +347,7 @@ int main(int argc, char *argv[])
// make some beeps before wiping the system :)
if (unattended) {
runcommandwithstatus("/bin/beep -f 450 -r 10 -D 800 -n -f 900 -l 1000", "WARNING: Unattended installation will start in 10 seconds...");
runcommandwithstatus("/bin/sleep 10", "WARNING: Unattended installation will start in 10 seconds...");
}
/* German is the default */
@@ -370,7 +370,7 @@ int main(int argc, char *argv[])
mysystem("/bin/setfont lat0-16");
newtDrawRootText(14, 0, NAME " v" VERSION " - " SLOGAN );
newtDrawRootText(14, 0, NAME " " VERSION " - " SLOGAN );
newtPushHelpLine(ctr[TR_HELPLINE]);
if (!unattended) {
@@ -412,7 +412,8 @@ int main(int argc, char *argv[])
/* read source drive letter */
if ((handle = fopen("/source_device", "r")) == NULL) {
errorbox("ERROR reading source_device");
errorbox(ctr[TR_ERROR_PROBING_CDROM]);
goto EXIT;
}
fgets(sourcedrive, 5, handle);
fprintf(flog, "Source drive: %s\n", sourcedrive);

View File

@@ -24,56 +24,89 @@ extern struct nic nics[];
int networkmenu(struct keyvalue *ethernetkv)
{
int rc;
int i;
int count;
char nics;
char number;
char cbValue;
char driver[STRING_SIZE] = "";
char driveroptions[STRING_SIZE] = "";
struct keyvalue *kv = initkeyvalues();
int result = 0;
char commandstring[STRING_SIZE];
char address[STRING_SIZE], netmask[STRING_SIZE];
int done;
FILE *handle;
char line[STRING_SIZE];
char description[1000];
char message[1000];
char title[STRING_SIZE];
done = 0;
while (!done)
/* Detect and count nics */
count = mysystem("/bin/probenic.sh count");
fprintf(flog, "Number of detected nics: %s\n", count);
/* sprintf(commandstring, "/bin/probenic.sh");
sprintf(message, ctr[TR_PROBING_FOR_NICS]);
runcommandwithstatus(commandstring, message); */
/* handle = fopen("/nicdriver", "r");
fgets(nics, STRING_SIZE, handle);
fclose(handle); */
/* fprintf(flog, "Detected NIC drivers: %s\n",driver); */
/* sprintf (title, "%s %s - %s", NAME, VERSION, SLOGAN);
sprintf(message, ctr[TR_FOUND_NIC], NAME, description);
newtWinMessage(title, ctr[TR_OK], message); */
newtComponent form, checkbox, rb[count], button;
newtOpenWindow(10, 5, 60, 11, "Checkboxes and Radio buttons");
for (i = 1; i <= 2; i++)
{
rc = newtWinTernary(ctr[TR_CONFIGURE_NETWORKING], ctr[TR_PROBE],
ctr[TR_SELECT], ctr[TR_CANCEL], ctr[TR_CONFIGURE_NETWORKING_LONG]);
if (rc == 0 || rc == 1)
{
sprintf(commandstring, "/bin/probenic.sh 1");
sprintf(message, ctr[TR_PROBING_FOR_NICS]);
runcommandwithstatus(commandstring, message);
if ((handle = fopen("/nicdriver", "r")))
{
char *driver;
fgets(line, STRING_SIZE-1, handle);
fclose(handle);
line[strlen(line) - 1] = 0;
driver = strtok(line, ".");
fprintf(flog, "Detected NIC driver: %s\n",driver);
if (strlen(driver) > 1) {
strcpy(driveroptions, "");
findnicdescription(driver, description);
sprintf (title, "%s %s - %s", NAME, VERSION, SLOGAN);
sprintf(message, ctr[TR_FOUND_NIC], NAME, description);
newtWinMessage(title, ctr[TR_OK], message);
} else {
errorbox(ctr[TR_PROBE_FAILED]);
}
}
fprintf(flog, "Scan: %d\n", i);
snprintf(commandstring, STRING_SIZE, "/bin/probenic.sh %i", i);
mysystem(commandstring);
if ((handle = fopen("/nicdriver", "r")) == NULL) {
errorbox(ctr[TR_ERROR]);
goto EXIT;
}
else if (rc == 2)
choosecards(driver, driveroptions);
fgets(driver, STRING_SIZE, handle);
fclose(handle);
findnicdescription(driver, description);
if ( i == 0 )
rb[i] = newtRadiobutton(1, i+2, description, 1, NULL);
else
done = 1;
rb[i] = newtRadiobutton(1, i+2, description, 0, rb[i-1]);
}
button = newtButton(1, count+3, "OK");
form = newtForm(NULL, NULL, 0);
newtFormAddComponent(form, checkbox);
for (i = 1; i <= 2; i++) {
fprintf(flog, "Add: %d\n", i);
newtFormAddComponent(form, rb[i]);
}
newtFormAddComponent(form, button);
newtRunForm(form);
newtFinished();
for (i = 1; i <= 2; i++)
if (newtRadioGetCurrent(rb[0]) == rb[i])
printf("radio button picked: %d\n", i);
newtFormDestroy(form);
/* snprintf(commandstring, STRING_SIZE, "/bin/probenic.sh 1");
mysystem(commandstring);
if ((handle = fopen("/nicdriver", "r")) == NULL) {
errorbox(ctr[TR_ERROR]);
goto EXIT;
}
fgets(driver, STRING_SIZE, handle);
fprintf(flog, "Green nic driver: %s\n", driver);
fclose(handle); */
/* Default is a GREEN nic only. */
/* Smoothie is not untarred yet, so we have to delay actually writing the

View File

@@ -1,12 +1,15 @@
#!/bin/sh
NUMBER=$1
MODULES=`/bin/kudzu -qps -t 30 -c NETWORK | grep driver | cut -d ' ' -f 2 | sort | uniq`
MODULES=$(/bin/kudzu -qps -t 30 -c NETWORK | grep driver | cut -d ' ' -f 2 | sort)
if [ "$NUMBER" ]; then
NICS=`echo $MODULES | head -$NUMBER`
if [ "$1" == "count" ]; then
echo $(echo $MODULES | wc -l)
else
NICS=$MODULES
NUMBER=$1
fi
echo "$NICS" > /nicdriver
if [ "$NUMBER" ]; then
echo "$(echo $MODULES | grep -n $NUMBER | cut -c 1-2 )" > /nicdriver
else
echo "$MODULES" > /nicdriver
fi