}
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) {
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 */