]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/install+setup/install/main.c
Laedt die USB-Controller von allein...
[people/teissler/ipfire-2.x.git] / src / install+setup / install / main.c
index ef8f8f60bce997746f3c7875adbddecb61eb413f..51c8969b892c42a3c600a2d92e719744241a61b6 100644 (file)
@@ -66,7 +66,7 @@ long calc_rootsize(long free, long max) {
        long root;
        
        root = max / 2;
-       if (root < 512) {
+       if (root < 256) {
                return 0;
        }
        if (root > 2048) {
@@ -143,29 +143,30 @@ int main(int argc, char *argv[])
                fprintf(flog, "Couldn't open commandline: /proc/cmdline\n");
        } else {
                fgets(line, STRING_SIZE, cmdfile);
-               if (strstr (line, "noide") == NULL) {
-                       fprintf(flog, "Initializing IDE controllers.\n");
-                       initialize_ide();
-               } else {
-                       fprintf(flog, "Skipping IDE detection.\n");
-               }
-               if (strstr (line, "nousb") == NULL) {
-                       fprintf(flog, "Initializing USB controllers.\n");
-                       initialize_usb();
-               } else {
-                       fprintf(flog, "Skipping USB detection.\n");
-               }
+               
                // check if we have to make an unattended install
                if (strstr (line, "unattended") != NULL) {
                    unattended = 1;
-               }
-               // Loading the cdrom-filesystem
-               mysystem("/sbin/modprobe iso9660");
-       }
-
-       if (unattended) {
-           runcommandwithstatus("/bin/sleep 10", "WARNING: Unattended installation will start in 10 seconds...");
-       }
+                   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");
+       mysystem("/sbin/modprobe ide-disk");
+       mysystem("/sbin/modprobe uhci_hcd");
+       mysystem("/sbin/modprobe ohci_hcd");
+       mysystem("/sbin/modprobe ehci_hcd");
+       mysystem("/sbin/modprobe ohci1394");
+       mysystem("/sbin/modprobe sd_mod");
+       mysystem("/sbin/modprobe sr_mod");
+       mysystem("/sbin/modprobe usb-storage");
+       mysystem("/sbin/modprobe usbhid");
+
+       mysystem("/sbin/modprobe iso9660"); // CDROM
+       mysystem("/sbin/modprobe ext2"); // Boot patition
+       mysystem("/sbin/modprobe vfat"); // USB key
        
        /* German is the default */
        for (choice = 0; langnames[choice]; choice++)
@@ -183,12 +184,14 @@ int main(int argc, char *argv[])
 
        ctr = langtrs[choice];
        strcpy(shortlangname, shortlangnames[choice]);
-       fprintf(flog, "Selected language: %s\n", shortlangname);
 
        newtDrawRootText(14, 0, NAME " " VERSION " - " SLOGAN );
        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);
@@ -205,9 +208,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")) {
@@ -316,12 +316,12 @@ int main(int argc, char *argv[])
        sprintf(message, ctr[TR_PREPARE_HARDDISK], hdparams.devnode_disk);
        if (unattended) {
            hardyn = 1;
+       } else {
+               yesnoharddisk[0] = ctr[TR_NO];
+               yesnoharddisk[1] = ctr[TR_YES];
+               yesnoharddisk[2] = NULL;
        }
 
-       yesnoharddisk[0] = ctr[TR_NO];
-       yesnoharddisk[1] = ctr[TR_YES];
-       yesnoharddisk[2] = NULL;
-
        while (! hardyn) {
                rc = newtWinMenu(title, message,
                                 50, 5, 5, 6, yesnoharddisk,
@@ -334,8 +334,8 @@ int main(int argc, char *argv[])
                goto EXIT;
 
        if (!unattended) {              
-               sprintf(message, "(TR) Bitte waehlen Sie ihr Dateisystem aus:");
-               rc = newtWinMenu("(TR) Dateisystemauswahl", message,
+               sprintf(message, ctr[TR_CHOOSE_FILESYSTEM]);
+               rc = newtWinMenu( ctr[TR_CHOOSE_FILESYSTEM], message,
                        50, 5, 5, 6, fstypes, &fstype, ctr[TR_OK],
                        ctr[TR_CANCEL], NULL);
        } else {
@@ -378,16 +378,15 @@ int main(int argc, char *argv[])
        
        swap_file = calc_swapsize(memory, maximum_free);
 
-       if (maximum_free < 768 + swap_file ) {
-               if (maximum_free < 768) {
+       if (maximum_free < 512 + swap_file ) {
+               if (maximum_free < 700) {
                        errorbox(ctr[TR_DISK_TOO_SMALL]);
                        goto EXIT;
                }
 
                if (!unattended) {
                    rc = newtWinChoice(title, ctr[TR_OK], ctr[TR_CANCEL], ctr[TR_CONTINUE_NO_SWAP]);
-               }
-               else {
+               } else {
                    rc = 1;
                }
                
@@ -399,7 +398,7 @@ int main(int argc, char *argv[])
        boot_partition = 20; /* in MB */
        current_free = maximum_free - boot_partition - swap_file;
 
-       if (current_free < 768) {
+       if (current_free < 700) {
                errorbox(ctr[TR_DISK_TOO_SMALL]);
                goto EXIT;
        }
@@ -532,9 +531,6 @@ int main(int argc, char *argv[])
                errorbox(ctr[TR_UNABLE_TO_INSTALL_FILES]);
                goto EXIT;
        }
-               
-       /* Save USB controller type to modules.conf */
-       write_usb_modules_conf();
        
        /* Save language und local settings */
        write_lang_configs(shortlangname);
@@ -578,16 +574,16 @@ int main(int argc, char *argv[])
                replace("/harddisk/boot/grub/grub.conf", "MOUNT", "ro");
        } else if (fstype == EXT3) {
                snprintf(commandstring, STRING_SIZE, "tune2fs -j %s3", hdparams.devnode_part);
-               if (runcommandwithstatus(commandstring, "(TR) Creating journal for ext3..."))
+               if (runcommandwithstatus(commandstring, ctr[TR_JOURNAL_EXT3]))
                {
-                       errorbox("(TR) Unable to create journal. Going back to ext2.");
+                       errorbox(ctr[TR_JOURNAL_ERROR]);
                        replace("/harddisk/etc/fstab", "FSTYPE", "ext2");
                        goto NOJOURNAL;
                }
                snprintf(commandstring, STRING_SIZE, "tune2fs -j %s4", hdparams.devnode_part);
-               if (runcommandwithstatus(commandstring, "(TR) Creating journal for ext3..."))
+               if (runcommandwithstatus(commandstring, ctr[TR_JOURNAL_EXT3]))
                {
-                       errorbox("(TR) Unable to create journal. Going back to ext2.");
+                       errorbox(ctr[TR_JOURNAL_ERROR]);
                        replace("/harddisk/etc/fstab", "FSTYPE", "ext2");
                        goto NOJOURNAL;
                }