]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/install+setup/install/main.c
installer: Add bootldr partition for GRUB2 on GPT.
[ipfire-2.x.git] / src / install+setup / install / main.c
index 6a336135424143faa13fb265a0b4905db2b63b05..7667dfefff5d19bf544853647d3ea619de3b9d36 100644 (file)
@@ -410,10 +410,11 @@ int main(int argc, char *argv[]) {
        }
 
        fprintf(flog, "Destination drive: %s\n", destination->path);
-       fprintf(flog, "  boot: %s (%lluMB)\n", destination->part_boot, BYTES2MB(destination->size_boot));
-       fprintf(flog, "  swap: %s (%lluMB)\n", destination->part_swap, BYTES2MB(destination->size_swap));
-       fprintf(flog, "  root: %s (%lluMB)\n", destination->part_root, BYTES2MB(destination->size_root));
-       fprintf(flog, "  data: %s (%lluMB)\n", destination->part_data, BYTES2MB(destination->size_data));
+       fprintf(flog, "  bootldr: %s (%lluMB)\n", destination->part_bootldr, BYTES2MB(destination->size_bootldr));
+       fprintf(flog, "  boot   : %s (%lluMB)\n", destination->part_boot, BYTES2MB(destination->size_boot));
+       fprintf(flog, "  swap   : %s (%lluMB)\n", destination->part_swap, BYTES2MB(destination->size_swap));
+       fprintf(flog, "  root   : %s (%lluMB)\n", destination->part_root, BYTES2MB(destination->size_root));
+       fprintf(flog, "  data   : %s (%lluMB)\n", destination->part_data, BYTES2MB(destination->size_data));
 
        // Warn the user if there is not enough space to create a swap partition
        if (!unattended && !*destination->part_swap) {
@@ -528,45 +529,19 @@ int main(int argc, char *argv[]) {
        snprintf(commandstring, STRING_SIZE, "/bin/sed -i -e \"s#DEVICE4#UUID=$(/sbin/blkid %s -sUUID | /usr/bin/cut -d'\"' -f2)#g\" /harddisk/etc/fstab", destination->part_data);
        system(commandstring);
 
-       switch (destination->filesystem) {
-               case HW_FS_REISERFS:
-                       replace("/harddisk/etc/fstab", "FSTYPE", "reiserfs");
-                       break;
-
-               case HW_FS_EXT4:
-               case HW_FS_EXT4_WO_JOURNAL:
-                       replace("/harddisk/etc/fstab", "FSTYPE", "ext4");
-                       break;
-
-               default:
-                       assert(0);
-       }
-
-       replace("/harddisk/boot/grub/grub.conf", "KVER", KERNEL_VERSION);
-
-       snprintf(commandstring, STRING_SIZE, "/bin/sed -i -e \"s#root=ROOT#root=UUID=$(/sbin/blkid %s -sUUID | /usr/bin/cut -d'\"' -f2)#g\" /harddisk/boot/grub/grub.conf", destination->part_root);
-       system(commandstring);
-
-       mysystem("ln -s grub.conf /harddisk/boot/grub/menu.lst");
-
        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", destination->path);
-               fclose(f);
-       }
+       // Installing bootloader...
+       statuswindow(60, 4, title, ctr[TR_INSTALLING_GRUB]);
 
-       snprintf(commandstring, STRING_SIZE, 
-                "/usr/sbin/chroot /harddisk /usr/sbin/grub-install --no-floppy %s", destination->path);
-       if (runcommandwithstatus(commandstring, ctr[TR_INSTALLING_GRUB])) {
+       rc = hw_install_bootloader(destination);
+       if (rc) {
                errorbox(ctr[TR_UNABLE_TO_INSTALL_GRUB]);
                goto EXIT;
        }
 
+       newtPopWindow();
+
        /* Serial console ? */
        if (serialconsole) {
                /* grub */