]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/install+setup/install/main.c
Updated kernel to 2.6.25.17
[ipfire-2.x.git] / src / install+setup / install / main.c
index 7d2e573b6dc26c3219596e222bd3fc2d47768389..8e66a2694c1b928d3c8b532ce7fc773901755e8a 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;
@@ -105,7 +105,7 @@ int main(int argc, char *argv[])
 
        mysystem("/sbin/modprobe ide-generic");
        mysystem("/sbin/modprobe generic");
-       mysystem("/sbin/modprobe ide-cd");
+       mysystem("/sbin/modprobe ide-cd_mod");
        mysystem("/sbin/modprobe ide-disk");
        mysystem("/sbin/modprobe uhci-hcd");
        mysystem("/sbin/modprobe ohci-hcd");
@@ -256,7 +256,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,11 +448,11 @@ 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);
-
+*/
        /* Rename uname */
        rename ("/harddisk/bin/uname.bak", "/harddisk/bin/uname");
 
@@ -475,7 +475,6 @@ int main(int argc, char *argv[])
        
        if (fstype == REISER4) {
                replace("/harddisk/etc/fstab", "FSTYPE", "reiser4");
-               replace("/harddisk/etc/mkinitcpio.conf", "MODULES=\"", "MODULES=\"reiser4 ");
                replace("/harddisk/boot/grub/grub.conf", "MOUNT", "rw");
        } else if (fstype == REISERFS) {
                replace("/harddisk/etc/fstab", "FSTYPE", "reiserfs");
@@ -497,16 +496,35 @@ int main(int argc, char *argv[])
                }
                replace("/harddisk/etc/fstab", "FSTYPE", "ext3");
                NOJOURNAL:
-               replace("/harddisk/etc/mkinitcpio.conf", "MODULES=\"", "MODULES=\"ext3 ");
                replace("/harddisk/boot/grub/grub.conf", "MOUNT", "ro");
        }
 
+       replace("/harddisk/boot/grub/grub.conf", "KVER", KERNEL_VERSION);
+
+       /* Build the emergency ramdisk with all drivers */
+       mysystem("cp -f /harddisk/etc/mkinitcpio.conf /harddisk/etc/mkinitcpio.conf.org");
+
+       replace("/harddisk/etc/mkinitcpio.conf", " autodetect ", " ");
+       snprintf(commandstring, STRING_SIZE, "/sbin/chroot /harddisk /sbin/mkinitcpio -g /boot/ipfirerd-%s-emergency.img -k %s-ipfire", KERNEL_VERSION, KERNEL_VERSION);
+       runcommandwithstatus(commandstring, ctr[TR_BUILDING_INITRD]);
+
+       mysystem("cp -f /harddisk/etc/mkinitcpio.conf.org /harddisk/etc/mkinitcpio.conf");
+
+       /* mkinitcpio has a problem if ide and pata are included */
+       if ( scsi_disk==1 ) {
+           /* Remove the ide hook if we install sda */
+           replace("/harddisk/etc/mkinitcpio.conf", " ide ", " ");
+       } else {
+           /* Remove the pata & sata hook if we install hda */
+           replace("/harddisk/etc/mkinitcpio.conf", " pata ", " ");
+           replace("/harddisk/etc/mkinitcpio.conf", " sata ", " ");
+       }
        /* Going to make our initrd... */
-       snprintf(commandstring, STRING_SIZE, "/sbin/chroot /harddisk /sbin/mkinitcpio -g /boot/ipfirerd.img -k %s-ipfire", KERNEL_VERSION);
+       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-smp.img -k %s-ipfire-smp", 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]);
-
+*/
        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");