mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-05-02 00:02:55 +02:00
Ich hab mal ein bisschen die Arbeit vom Cuebernommen :D
Aber trotzdem geht die Routine noch kein bisschen. SegFault :( Ansonsten: Busyboy erweitert, PCMCIA Support begonnen zu entfernen git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@375 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
#define CDROM_INSTALL 0
|
||||
#define URL_INSTALL 1
|
||||
#define DISK_INSTALL 2
|
||||
#define INST_FILECOUNT 5600
|
||||
#define INST_FILECOUNT 6600
|
||||
#define UNATTENDED_CONF "/cdrom/boot/unattended.conf"
|
||||
|
||||
int raid_disk = 0;
|
||||
@@ -288,23 +288,6 @@ int main(int argc, char *argv[])
|
||||
fprintf(flog, "Manual FDISK selected.\n");
|
||||
fdisk = 1;
|
||||
}
|
||||
if (strstr (line, "nopcmcia") == NULL) {
|
||||
fprintf(flog, "Initializing PCMCIA controllers.\n");
|
||||
pcmcia = initialize_pcmcia();
|
||||
if (pcmcia) {
|
||||
fprintf (flog, "Detected PCMCIA Controller: %s.\n", pcmcia);
|
||||
sprintf(commandstring, "/sbin/modprobe %s", pcmcia);
|
||||
mysystem("/sbin/modprobe pcmcia_core");
|
||||
mysystem(commandstring);
|
||||
mysystem("/sbin/modprobe ds");
|
||||
/* pcmcia netcard drivers are not available from Boot floppy,
|
||||
* they will be loaded from Drivers floppy later */
|
||||
} else {
|
||||
fprintf (flog, "Detected No PCMCIA Controller.\n");
|
||||
}
|
||||
} else {
|
||||
fprintf(flog, "Skipping PCMCIA detection.\n");
|
||||
}
|
||||
if (strstr (line, "nousb") == NULL) {
|
||||
fprintf(flog, "Initializing USB controllers.\n");
|
||||
initialize_usb();
|
||||
@@ -697,30 +680,6 @@ int main(int argc, char *argv[])
|
||||
/* Rename uname */
|
||||
rename ("/harddisk/bin/uname.bak", "/harddisk/bin/uname");
|
||||
|
||||
/* Write PCMCIA Config */
|
||||
if (pcmcia) {
|
||||
handle = fopen("/harddisk/etc/modules.conf", "a");
|
||||
if (handle != NULL) {
|
||||
fprintf (handle, "# PCMCIA Settings\n");
|
||||
fprintf (handle, "alias pcmcia-controller %s\n", pcmcia);
|
||||
fclose(handle);
|
||||
}
|
||||
}
|
||||
|
||||
handle = fopen("/harddisk/etc/pcmcia.conf", "w");
|
||||
if (handle != NULL) {
|
||||
if (pcmcia) {
|
||||
fprintf (handle, "PCMCIA=yes\n");
|
||||
fprintf (handle, "PCIC=%s\n", pcmcia);
|
||||
} else {
|
||||
fprintf (handle, "PCMCIA=no\n");
|
||||
fprintf (handle, "PCIC=\n");
|
||||
}
|
||||
fprintf (handle, "CARDMGR_OPTS=\n");
|
||||
fprintf (handle, "SCHEME=\n");
|
||||
fclose(handle);
|
||||
}
|
||||
|
||||
/* *always* write disk configuration */
|
||||
if (!(write_disk_configs(&hdparams))){
|
||||
errorbox(ctr[TR_ERROR_WRITING_CONFIG]);
|
||||
|
||||
@@ -24,89 +24,47 @@ extern struct nic nics[];
|
||||
|
||||
int networkmenu(struct keyvalue *ethernetkv)
|
||||
{
|
||||
int i;
|
||||
int count;
|
||||
char nics;
|
||||
char number;
|
||||
char cbValue;
|
||||
int rc;
|
||||
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];
|
||||
FILE *handle;
|
||||
int done;
|
||||
char description[1000];
|
||||
char message[1000];
|
||||
char title[STRING_SIZE];
|
||||
done = 0;
|
||||
|
||||
/* 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++)
|
||||
while (!done)
|
||||
{
|
||||
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;
|
||||
}
|
||||
fgets(driver, STRING_SIZE, handle);
|
||||
fclose(handle);
|
||||
findnicdescription(driver, description);
|
||||
if ( i == 0 )
|
||||
rb[i] = newtRadiobutton(1, i+2, description, 1, NULL);
|
||||
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)
|
||||
{
|
||||
probecards(driver, driveroptions);
|
||||
if (!strlen(driver))
|
||||
errorbox(ctr[TR_PROBE_FAILED]);
|
||||
else
|
||||
{
|
||||
findnicdescription(driver, description);
|
||||
sprintf (title, "%s v%s - %s", NAME, VERSION, SLOGAN);
|
||||
sprintf(message, ctr[TR_FOUND_NIC], NAME, description);
|
||||
newtWinMessage(title, ctr[TR_OK], message);
|
||||
}
|
||||
}
|
||||
else if (rc == 2)
|
||||
choosecards(driver, driveroptions);
|
||||
else
|
||||
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]);
|
||||
done = 1;
|
||||
|
||||
if (strlen(driver))
|
||||
done = 1;
|
||||
}
|
||||
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]);
|
||||
|
||||
if (!strlen(driver))
|
||||
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
|
||||
@@ -134,8 +92,6 @@ int networkmenu(struct keyvalue *ethernetkv)
|
||||
result = 1;
|
||||
|
||||
EXIT:
|
||||
freekeyvalues(kv);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
MODULES=$(/bin/kudzu -qps -t 30 -c NETWORK | grep driver | cut -d ' ' -f 2 | sort)
|
||||
|
||||
if [ "$1" == "count" ]; then
|
||||
echo $(echo $MODULES | wc -l)
|
||||
/bin/kudzu -qps -t 30 -c NETWORK | grep driver | wc -l | awk '{ print $1 }' > /drivercount
|
||||
exit 0
|
||||
else
|
||||
NUMBER=$1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user