]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/install+setup/install/main.c
Removed also the pata mkinitcpio hook if install on hda
[people/teissler/ipfire-2.x.git] / src / install+setup / install / main.c
index e0433c461a932a6efa0b5093ce21a2627ca52745..4cd8ffd07353d151391819e019ca29f532b076d4 100644 (file)
@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
        char *shortlangnames[] = { "de", "en", NULL };
        char **langtrs[] = { de_tr, en_tr, NULL };
        char hdletter;
-       char harddrive[11], sourcedrive[5];     /* Device holder. */
+       char harddrive[30], sourcedrive[5];     /* Device holder. */
        struct devparams hdparams, cdromparams; /* Params for CDROM and HD */
        int rc = 0;
        char commandstring[STRING_SIZE];
@@ -200,7 +200,7 @@ int main(int argc, char *argv[])
                errorbox(ctr[TR_NO_HARDDISK]);
                goto EXIT;
        }
-       fgets(harddrive, 11, handle);
+       fgets(harddrive, 30, handle);
        fclose(handle);
                        
        /* load unattended configuration */
@@ -501,6 +501,14 @@ int main(int argc, char *argv[])
                replace("/harddisk/boot/grub/grub.conf", "MOUNT", "ro");
        }
 
+       /* 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 hook if we install hda */
+           replace("/harddisk/etc/mkinitcpio.conf", " pata ", " ");
+       }
        /* Going to make our initrd... */
        snprintf(commandstring, STRING_SIZE, "/sbin/chroot /harddisk /sbin/mkinitcpio -g /boot/ipfirerd.img -k %s-ipfire", KERNEL_VERSION);
        runcommandwithstatus(commandstring, ctr[TR_BUILDING_INITRD]);
@@ -509,10 +517,9 @@ int main(int argc, char *argv[])
 
        sprintf(string, "root=%s3", hdparams.devnode_part_run);
        replace( "/harddisk/boot/grub/grub.conf", "root=ROOT", string);
-       replace( "/harddisk/boot/grub/grubbatch", "DEVICE", hdparams.devnode_disk);
+       mysystem("ln -s grub.conf /harddisk/boot/grub/menu.lst");
 
-       /* restore permissions */
-       chmod("/harddisk/boot/grub/grubbatch", S_IXUSR | S_IRUSR | S_IXGRP | S_IRGRP | S_IXOTH | S_IROTH);
+       system("sed -e 's#harddisk\\/##g' < /proc/mounts > /harddisk/etc/mtab");
 
        snprintf(commandstring, STRING_SIZE, 
                 "/sbin/chroot /harddisk /usr/sbin/grub-install --no-floppy %s", hdparams.devnode_disk);
@@ -520,8 +527,6 @@ int main(int argc, char *argv[])
                errorbox(ctr[TR_UNABLE_TO_INSTALL_GRUB]);
                goto EXIT;
        }
-
-       mysystem("ln -s grub.conf /harddisk/boot/grub/menu.lst");
        
        mysystem("umount /cdrom");
        snprintf(commandstring, STRING_SIZE, "eject /dev/%s", sourcedrive);