]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/install+setup/install/main.c
Merge remote-tracking branch 'origin/next' into glibc-update2
[people/teissler/ipfire-2.x.git] / src / install+setup / install / main.c
index cb697a1524ca78f15d5e22fbd5c03ece027cd96e..c181e4a8e7a09b148a55013c22abfa8e9ba7f65a 100644 (file)
@@ -1,3 +1,4 @@
+
 /* SmoothWall install program.
  *
  * This program is distributed under the terms of the GNU General Public
@@ -11,7 +12,7 @@
 #include "install.h"
 #define _GNU_SOURCE
  
-#define INST_FILECOUNT 8400
+#define INST_FILECOUNT 10700
 #define UNATTENDED_CONF "/cdrom/boot/unattended.conf"
 
 #define EXT2 0
@@ -33,15 +34,17 @@ extern char *en_tr[];
 extern char *es_tr[];
 extern char *de_tr[];
 extern char *fr_tr[];
+extern char *pl_tr[];
+extern char *ru_tr[];
 
 int main(int argc, char *argv[])
 {
 
        char discl_msg[40000] = "Disclaimer\n";
 
-       char *langnames[] = { "Deutsch", "English", "Français", "Español", NULL };
-       char *shortlangnames[] = { "de", "en", "fr", "es", NULL };
-       char **langtrs[] = { de_tr, en_tr, fr_tr, es_tr, NULL };
+       char *langnames[] = { "Deutsch", "English", "Français", "Español", "Polski", "Русский", NULL };
+       char *shortlangnames[] = { "de", "en", "fr", "es", "pl", "ru", NULL };
+       char **langtrs[] = { de_tr, en_tr, fr_tr, es_tr, pl_tr, ru_tr, NULL };
        char hdletter;
        char harddrive[30], sourcedrive[5];     /* Device holder. */
        struct devparams hdparams, cdromparams; /* Params for CDROM and HD */
@@ -49,7 +52,7 @@ int main(int argc, char *argv[])
        char commandstring[STRING_SIZE];
        char mkfscommand[STRING_SIZE];
        char *fstypes[] = { "ext2", "ext3", "ext4", "ReiserFS", NULL };
-       int fstype = EXT3;
+       int fstype = EXT4;
        int choice;
        int i;
        int found = 0;
@@ -129,13 +132,13 @@ int main(int argc, char *argv[])
 
        // Load common modules
        mysystem("/sbin/modprobe iso9660"); // CDROM
-       mysystem("/sbin/modprobe ext2"); // Boot patition
+//     mysystem("/sbin/modprobe ext2"); // Boot patition
        mysystem("/sbin/modprobe vfat"); // USB key
        
        /* German is the default */
        for (choice = 0; langnames[choice]; choice++)
        {
-               if (strcmp(langnames[choice], "Deutsch") == 0)
+               if (strcmp(langnames[choice], "English") == 0)
                        break;
        }
        if (!langnames[choice])
@@ -151,10 +154,10 @@ int main(int argc, char *argv[])
 
        newtPushHelpLine(ctr[TR_HELPLINE]);
 
-       sprintf(message, ctr[TR_WELCOME], NAME);
-       newtWinMessage(title, ctr[TR_OK], message);
-
        if (!unattended) {
+               sprintf(message, ctr[TR_WELCOME], NAME);
+               newtWinMessage(title, ctr[TR_OK], message);
+
                if (disclaimerbox(discl_msg)==0) {
                        errorbox(ctr[TR_LICENSE_NOT_ACCEPTED]);
                        goto EXIT;
@@ -372,16 +375,16 @@ int main(int argc, char *argv[])
        }
        
        if (fstype == EXT2) {
-               mysystem("/sbin/modprobe ext2");
+//             mysystem("/sbin/modprobe ext2");
                sprintf(mkfscommand, "/sbin/mke2fs -T ext2");
        } else if (fstype == REISERFS) {
                mysystem("/sbin/modprobe reiserfs");
                sprintf(mkfscommand, "/sbin/mkreiserfs -f");
        } else if (fstype == EXT3) {
-               mysystem("/sbin/modprobe ext3");
+//             mysystem("/sbin/modprobe ext3");
                sprintf(mkfscommand, "/sbin/mke2fs -T ext3");
        } else if (fstype == EXT4) {
-               mysystem("/sbin/modprobe ext4");
+//             mysystem("/sbin/modprobe ext4");
                sprintf(mkfscommand, "/sbin/mke2fs -T ext4");
        }
 
@@ -460,9 +463,6 @@ int main(int argc, char *argv[])
        /* Save language und local settings */
        write_lang_configs(shortlangname);
 
-       /* Rename uname */
-       rename ("/harddisk/bin/uname.bak", "/harddisk/bin/uname");
-
        /* mount proc filesystem */
        mysystem("mkdir /harddisk/proc");
        mysystem("/bin/mount --bind /proc /harddisk/proc");
@@ -523,7 +523,7 @@ int main(int argc, char *argv[])
                replace("/harddisk/boot/grub/grub.conf", "splashimage", "#splashimage");
                replace("/harddisk/boot/grub/grub.conf", "#serial", "serial");
                replace("/harddisk/boot/grub/grub.conf", "#terminal", "terminal");
-               replace("/harddisk/boot/grub/grub.conf", " panic=10 ", " console=ttyS0,38400 panic=10 ");
+               replace("/harddisk/boot/grub/grub.conf", " panic=10 ", " console=ttyS0,38400n8 panic=10 ");
 
                /*inittab*/
                replace("/harddisk/etc/inittab", "1:2345:respawn:", "#1:2345:respawn:");
@@ -535,6 +535,9 @@ int main(int argc, char *argv[])
                replace("/harddisk/etc/inittab", "#7:2345:respawn:", "7:2345:respawn:");
        }
 
+       /* Set marker that the user has already accepted the gpl */
+       mysystem("/usr/bin/touch /harddisk/var/ipfire/main/gpl_accepted");
+
        /* Copy restore file from cdrom */
        if (unattended && (strlen(restore_file) > 0)) {
                fprintf(flog, "unattended: Copy restore file\n");
@@ -550,7 +553,7 @@ int main(int argc, char *argv[])
        if (!unattended) {
                sprintf(message, ctr[TR_CONGRATULATIONS_LONG],
                                NAME, SNAME, NAME);
-               newtWinMessage(ctr[TR_CONGRATULATIONS], ctr[TR_OK], message);
+               newtWinMessage(ctr[TR_CONGRATULATIONS], ctr[TR_PRESS_OK_TO_REBOOT], message);
        }
 
        allok = 1;
@@ -602,13 +605,13 @@ EXIT:
 
        newtFinished();
 
-       system("/bin/umount /harddisk/proc");
-       system("/bin/umount /harddisk/dev");
-       system("/bin/umount /harddisk/sys");
+       system("/bin/umount /harddisk/proc >/dev/null 2>&1");
+       system("/bin/umount /harddisk/dev >/dev/null 2>&1");
+       system("/bin/umount /harddisk/sys >/dev/null 2>&1");
 
-       system("/bin/umount /harddisk/var");
-       system("/bin/umount /harddisk/boot");
-       system("/bin/umount /harddisk");
+       system("/bin/umount /harddisk/var >/dev/null 2>&1");
+       system("/bin/umount /harddisk/boot >/dev/null 2>&1");
+       system("/bin/umount /harddisk >/dev/null 2>&1");
 
        if (!(allok))
                system("/etc/halt");