From 0db33b567183f1d6742976619b54253f5ad151b2 Mon Sep 17 00:00:00 2001 From: ms Date: Mon, 20 Aug 2007 13:21:16 +0000 Subject: [PATCH] Setup weiter ausgebaut. Initrd des Installationssystems verkleinert. git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@789 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- config/rootfiles/common/initscripts | 3 +- langs/de/install/lang_de.c | 10 +++--- langs/en/install/lang_en.c | 2 +- lfs/initrd | 2 +- src/initscripts/init.d/networking/red | 9 +++-- src/install+setup/install/main.c | 8 ++--- src/install+setup/install/probehw.sh | 5 ++- src/install+setup/setup/misc.c | 4 +-- src/install+setup/setup/networking.c | 47 ++++++++++++++------------- 9 files changed, 48 insertions(+), 42 deletions(-) diff --git a/config/rootfiles/common/initscripts b/config/rootfiles/common/initscripts index 810246afd..0504eafd9 100644 --- a/config/rootfiles/common/initscripts +++ b/config/rootfiles/common/initscripts @@ -1,8 +1,9 @@ +etc/init.d #etc/rc.d #etc/rc.d/helper etc/rc.d/helper/getdnsfromdhcpc.pl etc/rc.d/helper/writeipac.pl -etc/rc.d/init.d +#etc/rc.d/init.d #etc/rc.d/init.d/alsa etc/rc.d/init.d/apache #etc/rc.d/init.d/applejuice diff --git a/langs/de/install/lang_de.c b/langs/de/install/lang_de.c index a24110084..997701761 100644 --- a/langs/de/install/lang_de.c +++ b/langs/de/install/lang_de.c @@ -32,11 +32,11 @@ char *de_tr[] = { /* TR_ISDN */ "ISDN", /* TR_ERROR_PROBING_ISDN */ -"Konnte ISDN Scan nicht durchführen.", +"Konnte ISDN Scan nicht durchführen.", /* TR_PROBING_ISDN */ -"Suche und konfiguriere ISDN Geräte.", +"Suche und konfiguriere ISDN Geräte.", /* TR_MISSING_GREEN_IP */ -"Fehlende IP auf der grünen Schnittstelle!", +"Fehlende IP auf der grünen Schnittstelle!", /* TR_CHOOSE_FILESYSTEM */ "Bitte wählen Sie ihr Dateisystem aus:", /* TR_NOT_ENOUGH_INTERFACES */ @@ -178,7 +178,7 @@ char *de_tr[] = { /* TR_ENTER_SETUP_PASSWORD */ "Geben Sie das Passwort für den Benutzer 'setup' ein. Melden Sie sich als dieser Benutzer an, um das Setup-Programm zu starten.", /* TR_ENTER_THE_IP_ADDRESS_INFORMATION */ -"Geben Sie die IP-Adressinformationen für die %s Schnittstelle ein.", +"Geben Sie die IP-Adressinformationen für die folgende Schnittstelle ein - %s.", /* TR_ENTER_THE_LOCAL_MSN */ "Geben Sie Ihre lokale Telefonnummer ein (MSN/EAZ):", /* TR_ENTER_URL */ @@ -224,7 +224,7 @@ char *de_tr[] = { /* TR_INSTALLING_LANG_CACHE */ "Installiere Sprachunterstützung...", /* TR_INTERFACE */ -"%s Schnittstelle", +"Schnittstelle - %s", /* TR_INTERFACE_FAILED_TO_COME_UP */ "Schnittstelle konnte nicht aktiviert werden.", /* TR_INVALID_FIELDS */ diff --git a/langs/en/install/lang_en.c b/langs/en/install/lang_en.c index f4c7311ee..807db125e 100644 --- a/langs/en/install/lang_en.c +++ b/langs/en/install/lang_en.c @@ -220,7 +220,7 @@ char *en_tr[] = { /* TR_INSTALLING_LANG_CACHE */ "Installing language files...", /* TR_INTERFACE */ -"%s interface", +"Interface - %s", /* TR_INTERFACE_FAILED_TO_COME_UP */ "Interface failed to come up.", /* TR_INVALID_FIELDS */ diff --git a/lfs/initrd b/lfs/initrd index 8a95bf5b0..a3bcc4f3b 100644 --- a/lfs/initrd +++ b/lfs/initrd @@ -66,7 +66,7 @@ $(TARGET) : depmod -a -F /boot/System.map-$(KVER)-ipfire-smp $(KVER)-ipfire-smp cp -a /lib/modules/$(KVER)-ipfire/ /install/initrd/lib/modules/ - rm -rf /install/initrd/lib/modules/$(KVER)-ipfire/{build,source} \ + rm -rf /install/initrd/lib/modules/$(KVER)-ipfire/{build,source,misc/*,kernel/{crypro,sound,net}} \ /install/initrd/lib/modules/$(KVER)-ipfire/kernel/drivers/message/fusion/mptlan* cp /opt/$(MACHINE)-uClibc/lib/libgcc_s.so.1 /install/initrd/lib/ diff --git a/src/initscripts/init.d/networking/red b/src/initscripts/init.d/networking/red index d32793a15..d28fd9060 100644 --- a/src/initscripts/init.d/networking/red +++ b/src/initscripts/init.d/networking/red @@ -28,8 +28,8 @@ if [ "$TYPE" == "STATIC" ]; then NETADDRESS="${RED_NETADDRESS}" NETMASK="${RED_NETMASK}" GATEWAY="${DEFAULT_GATEWAY}" - DNS1="${DNS1}" - DNS2="${DNS2}" + # DNS1 + # DNS2 if [ -z "${BROADCAST}" ]; then boot_mesg "BROADCAST variable missing from input, cannot continue." ${FAILURE} @@ -77,6 +77,11 @@ case "${1}" in boot_mesg "Adding IPv4 address ${ADDRESS} to the ${DEVICE} interface..." ip addr add ${args} dev ${DEVICE} evaluate_retval + echo -n "${DEVICE}" > /var/ipfire/red/iface + echo -n "${ADDRESS}" > /var/ipfire/red/local-ipaddress + echo -n "${GATEWAY}" > /var/ipfire/red/remote-ipaddress + echo -n "${DNS1}" > /var/ipfire/red/dns1 + echo -n "${DNS2}" > /var/ipfire/red/dns2 elif [ "${TYPE}" == "DHCP" ]; then boot_mesg -n "Starting dhcpcd on the ${DEVICE} interface..." diff --git a/src/install+setup/install/main.c b/src/install+setup/install/main.c index 4d9538ad2..309f225ad 100644 --- a/src/install+setup/install/main.c +++ b/src/install+setup/install/main.c @@ -150,7 +150,7 @@ int main(int argc, char *argv[]) runcommandwithstatus("/bin/sleep 10", "WARNING: Unattended installation will start in 10 seconds..."); } } - + mysystem("/sbin/modprobe ide-generic"); mysystem("/sbin/modprobe generic"); mysystem("/sbin/modprobe ide-cd"); @@ -185,6 +185,9 @@ int main(int argc, char *argv[]) newtPushHelpLine(ctr[TR_HELPLINE]); sprintf (title, "%s %s - %s", NAME, VERSION, SLOGAN); + // Starting hardware detection + runcommandwithstatus("/bin/probehw.sh", ctr[TR_PROBING_HARDWARE]); + if (!unattended) { sprintf(message, ctr[TR_WELCOME], NAME); newtWinMessage(title, ctr[TR_OK], message); @@ -201,9 +204,6 @@ int main(int argc, char *argv[]) if (rc == 2) goto EXIT; - // Starting hardware detection - runcommandwithstatus("/bin/probehw.sh", ctr[TR_PROBING_HARDWARE]); - /* CDROM INSTALL */ if (installtype == CDROM_INSTALL) { switch (mysystem("/bin/mountsource.sh")) { diff --git a/src/install+setup/install/probehw.sh b/src/install+setup/install/probehw.sh index 6ca3e37db..6fbcb5caf 100644 --- a/src/install+setup/install/probehw.sh +++ b/src/install+setup/install/probehw.sh @@ -7,9 +7,8 @@ for MODULE in $(kudzu -qps -t 30 | grep driver: | cut -d ' ' -f 2 | sort | uniq [ "${MODULE}" = "" ]; then continue fi - echo -n "Module: $MODULE --> " - MODULE=$(basename $(find /lib/modules -name $(echo $MODULE | sed -e 's/[_-]/*/g')* ) | cut -d. -f1 | head -1) - echo "$MODULE" + MODULE=$(basename $(find /lib/modules -name $(echo $MODULE | sed -e 's/[_-]/*/g')* ) | cut -d. -f1 | head -1 2>/dev/null) + [ "${MODULE}" == "" ] && continue if grep -Eqe "^${MODULE} " /proc/modules; then continue diff --git a/src/install+setup/setup/misc.c b/src/install+setup/setup/misc.c index 10f43a285..ae4f7800f 100644 --- a/src/install+setup/setup/misc.c +++ b/src/install+setup/setup/misc.c @@ -142,8 +142,8 @@ int handleisdn(void) { char command[STRING_SIZE]; sprintf(command, "/etc/rc.d/init.d/mISDN config"); - if (!runcommandwithstatus(command, ctr[TR_PROBING_ISDN])) + if (runcommandwithstatus(command, ctr[TR_PROBING_ISDN])) errorbox(ctr[TR_ERROR_PROBING_ISDN]); // Need to write some lines that count the cards and say the names... - return 0; + return 1; } diff --git a/src/install+setup/setup/networking.c b/src/install+setup/setup/networking.c index 351902a14..6a2bb128f 100644 --- a/src/install+setup/setup/networking.c +++ b/src/install+setup/setup/networking.c @@ -134,8 +134,8 @@ int oktoleave(char *errormessage) return 0; } - strcpy(temp, "0"); findkey(kv, "CONFIG_TYPE", temp); configtype = atol(temp); - if (configtype < 1 || configtype > 4) configtype = 0; + strcpy(temp, "1"); findkey(kv, "CONFIG_TYPE", temp); configtype = atol(temp); + if (configtype < 1 || configtype > 4) configtype = 1; if (HAS_GREEN) { @@ -230,7 +230,7 @@ int firstmenu(void) static int choice = 0; struct keyvalue *kv = initkeyvalues(); char message[1000]; - char temp[STRING_SIZE]; + char temp[STRING_SIZE] = "1"; int x; int result; char networkrestart[STRING_SIZE] = ""; @@ -248,7 +248,7 @@ int firstmenu(void) strcpy(temp, ""); findkey(kv, "CONFIG_TYPE", temp); x = atol(temp); x--; - if (x < 1 || x > 4) x = 1; + if (x < 0 || x > 4) x = 0; /* Format heading bit. */ snprintf(message, 1000, ctr[TR_CURRENT_CONFIG], configtypenames[x], networkrestart); @@ -267,12 +267,10 @@ int firstmenu(void) int configtypemenu(void) { struct keyvalue *kv = initkeyvalues(); - char temp[STRING_SIZE] = "0"; + char temp[STRING_SIZE] = "1"; char message[1000]; int choise, found; - int rc; - - fprintf(flog,"Enter ConfigMenu\n"); + int rc, configtype; if (!(readkeyvalues(kv, CONFIG_ROOT "/ethernet/settings"))) { @@ -303,9 +301,13 @@ int configtypemenu(void) choise++; sprintf(temp, "%d", choise); replacekeyvalue(kv, "CONFIG_TYPE", temp); - clear_card_entry(_RED_CARD_); - clear_card_entry(_ORANGE_CARD_); - clear_card_entry(_BLUE_CARD_); + configtype = atol(temp); + if (!HAS_RED) + clear_card_entry(_RED_CARD_); + if (!HAS_ORANGE) + clear_card_entry(_ORANGE_CARD_); + if (!HAS_BLUE) + clear_card_entry(_BLUE_CARD_); writekeyvalues(kv, CONFIG_ROOT "/ethernet/settings"); netaddresschange = 1; @@ -315,17 +317,15 @@ int configtypemenu(void) return 0; } - - /* Driver menu. Choose drivers.. */ int drivermenu(void) { struct keyvalue *kv = initkeyvalues(); char message[STRING_SIZE]; - char temp[STRING_SIZE]; + char temp[STRING_SIZE] = "1"; int configtype; - int i, rc, kcount = 0, neednics; //i = 0, count = 0, + int i, rc, kcount = 0, neednics; if (!(readkeyvalues(kv, CONFIG_ROOT "/ethernet/settings"))) { @@ -334,13 +334,13 @@ int drivermenu(void) return 0; } - strcpy(temp, "0"); findkey(kv, "CONFIG_TYPE", temp); + findkey(kv, "CONFIG_TYPE", temp); configtype = atol(temp); strcpy(message, ctr[TR_CONFIGURE_NETWORK_DRIVERS]); - kcount = 0; // counter to find knowing nics. - neednics = 0; // counter to use needing nics. + kcount = 0; + neednics = 0; if (HAS_GREEN) { sprintf(temp, "GREEN: %s\n", knics[_GREEN_CARD_].description); strcat(message, temp); @@ -378,7 +378,9 @@ int drivermenu(void) neednics++; } - for ( i=0 ; i<4;i++) if (strcmp(knics[i].macaddr, "")) kcount++; + for ( i=0 ; i<4; i++) + if (strcmp(knics[i].macaddr, "")) + kcount++; if (neednics = kcount) { @@ -387,11 +389,9 @@ int drivermenu(void) ctr[TR_CANCEL], message); if (rc == 0 || rc == 1) { - /* Shit, got to do something.. */ changedrivers(); } } else { - /* Shit, got to do something.. */ changedrivers(); } freekeyvalues(kv); @@ -421,8 +421,9 @@ int changedrivers(void) errorbox(ctr[TR_UNABLE_TO_OPEN_SETTINGS_FILE]); return 0; } - runcommandwithstatus("/etc/rc.d/init.d/network stop red blue orange", - ctr[TR_PUSHING_NON_LOCAL_NETWORK_DOWN]); + if (automode == 0) + runcommandwithstatus("/etc/rc.d/init.d/network stop red blue orange", + ctr[TR_PUSHING_NON_LOCAL_NETWORK_DOWN]); findkey(kv, "CONFIG_TYPE", temp); configtype = atol(temp); if (configtype == 1) -- 2.39.2