]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
installer: Help grub to find the right device to install itself on.
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 22 Aug 2012 20:03:35 +0000 (22:03 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 22 Aug 2012 20:03:35 +0000 (22:03 +0200)
src/install+setup/install/main.c

index c181e4a8e7a09b148a55013c22abfa8e9ba7f65a..e1b916149813eb88a4bfc2eaaf1faaf470f3dfaf 100644 (file)
@@ -510,6 +510,15 @@ int main(int argc, char *argv[])
 
        system("/bin/sed -e 's#/harddisk#/#g' -e 's#//#/#g'  < /proc/mounts > /harddisk/etc/mtab");
 
+       /*
+        * Generate device.map to help grub finding the device to install itself on.
+        */
+       FILE *f = NULL;
+       if (f = fopen("/harddisk/boot/grub/device.map", "w")) {
+               fprintf(f, "(hd0) %s\n", hdparams.devnode_part);
+               fclose(f);
+       }
+
        snprintf(commandstring, STRING_SIZE, 
                 "/usr/sbin/chroot /harddisk /usr/sbin/grub-install --no-floppy %s", hdparams.devnode_disk);
        if (runcommandwithstatus(commandstring, ctr[TR_INSTALLING_GRUB])) {