]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/install+setup/install/main.c
Merge branch 'work'
[people/pmueller/ipfire-2.x.git] / src / install+setup / install / main.c
index f992eb97949586a8c12c12ee3983ccd33e0b0141..6d6d12cf6ac01b68f91fd1c84276ced73b9b3604 100644 (file)
@@ -43,7 +43,7 @@ int main(int argc, char *argv[])
        char commandstring[STRING_SIZE];
        char mkfscommand[STRING_SIZE];
        char *fstypes[] = { "Reiser4", "ReiserFS", "ext3", NULL };
-       int fstype = REISER4;
+       int fstype = REISERFS;
        int choice;
        int i;
        int found = 0;
@@ -66,6 +66,7 @@ int main(int argc, char *argv[])
        int unattended = 0;
        struct keyvalue *unattendedkv = initkeyvalues();
        int hardyn = 0;
+       char restore_file[STRING_SIZE] = "";
 
        setlocale (LC_ALL, "");
        sethostname( SNAME , 10);
@@ -208,6 +209,7 @@ int main(int argc, char *argv[])
            fprintf(flog, "unattended: Reading unattended.conf\n");
 
            (void) readkeyvalues(unattendedkv, UNATTENDED_CONF);
+           findkey(unattendedkv, "RESTORE_FILE", restore_file);            
        }
        
        /* Make the hdparms struct and print the contents.
@@ -256,7 +258,7 @@ int main(int argc, char *argv[])
                        ctr[TR_CANCEL], NULL);
        } else {
            rc = 1;
-           fstype = REISER4; // Reiser4 is our standard filesystem. Love it or shut up!
+           fstype = REISERFS;
        }
        if (rc == 2)
                goto EXIT;
@@ -448,10 +450,15 @@ int main(int argc, char *argv[])
                "/bin/touch /harddisk/lib/modules/%s-ipfire/modules.dep",
                KERNEL_VERSION);
        mysystem(commandstring);
-       snprintf(commandstring, STRING_SIZE, 
+/*     snprintf(commandstring, STRING_SIZE, 
                "/bin/touch /harddisk/lib/modules/%s-ipfire-smp/modules.dep",
                KERNEL_VERSION);
        mysystem(commandstring);
+*/
+       snprintf(commandstring, STRING_SIZE, 
+               "/bin/touch /harddisk/lib/modules/2.6.25.17-ipfire/modules.dep");
+       mysystem(commandstring);
+
 
        /* Rename uname */
        rename ("/harddisk/bin/uname.bak", "/harddisk/bin/uname");
@@ -522,9 +529,14 @@ int main(int argc, char *argv[])
        /* Going to make our initrd... */
        snprintf(commandstring, STRING_SIZE, "/sbin/chroot /harddisk /sbin/mkinitcpio -g /boot/ipfirerd-%s.img -k %s-ipfire", KERNEL_VERSION, KERNEL_VERSION);
        runcommandwithstatus(commandstring, ctr[TR_BUILDING_INITRD]);
-       snprintf(commandstring, STRING_SIZE, "/sbin/chroot /harddisk /sbin/mkinitcpio -g /boot/ipfirerd-%s-smp.img -k %s-ipfire-smp", KERNEL_VERSION, KERNEL_VERSION );
+/*     snprintf(commandstring, STRING_SIZE, "/sbin/chroot /harddisk /sbin/mkinitcpio -g /boot/ipfirerd-%s-smp.img -k %s-ipfire-smp", KERNEL_VERSION, KERNEL_VERSION );
+       runcommandwithstatus(commandstring, ctr[TR_BUILDING_INITRD]);
+*/
+       snprintf(commandstring, STRING_SIZE, "/sbin/chroot /harddisk /sbin/mkinitcpio -g /boot/ipfirerd-2.6.25.17.img -k 2.6.25.17-ipfire");
        runcommandwithstatus(commandstring, ctr[TR_BUILDING_INITRD]);
 
+
+
        sprintf(string, "root=%s3", hdparams.devnode_part_run);
        replace( "/harddisk/boot/grub/grub.conf", "root=ROOT", string);
        mysystem("ln -s grub.conf /harddisk/boot/grub/menu.lst");
@@ -538,6 +550,14 @@ int main(int argc, char *argv[])
                goto EXIT;
        }
        
+       /* Copy restore file from cdrom */
+       if (unattended && (strlen(restore_file) > 0)) {
+               fprintf(flog, "unattended: Copy restore file\n");
+               snprintf(commandstring, STRING_SIZE, 
+                       "cp /cdrom/%s /harddisk/var/ipfire/backup", restore_file);
+               mysystem(commandstring);
+       }
+       
        mysystem("umount /cdrom");
        snprintf(commandstring, STRING_SIZE, "eject /dev/%s", sourcedrive);
        mysystem(commandstring);