]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
installer: Make umounting more reliable
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 20 Aug 2014 19:16:25 +0000 (21:16 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 20 Aug 2014 19:16:25 +0000 (21:16 +0200)
src/installer/hw.c
src/installer/main.c

index f29db82f151357f152b8c03a88bed31c57203ab0..0e65ae96998298ae71a3b54fabca46e01437f4bf 100644 (file)
@@ -779,6 +779,9 @@ int hw_mount_filesystems(struct hw_destination* dest, const char* prefix) {
 }
 
 int hw_umount_filesystems(struct hw_destination* dest, const char* prefix) {
+       // Write all buffers to disk before umounting
+       hw_sync();
+
        // boot
        if (*dest->part_boot) {
                hw_umount(dest->part_boot);
index c5adb0adfc754ec37f668124ae3e31d00bdd9772..313b35180baf9d887d846168dd84264842bc5e7a 100644 (file)
@@ -637,6 +637,13 @@ int main(int argc, char *argv[]) {
                mysystem(logfile, commandstring);
        }
 
+       // Umount the destination drive
+       hw_umount_filesystems(destination, DESTINATION_MOUNT_PATH);
+
+       // Stop the RAID array if we are using RAID
+       if (destination->is_raid)
+               hw_stop_all_raid_arrays(logfile);
+
        // Umount source drive and eject
        hw_umount(SOURCE_MOUNT_PATH);
 
@@ -671,13 +678,7 @@ EXIT:
        free(helpline);
 
        free(sourcedrive);
-
-       if (destination) {
-               hw_sync();
-
-               hw_umount_filesystems(destination, DESTINATION_MOUNT_PATH);
-               free(destination);
-       }
+       free(destination);
 
        hw_stop_all_raid_arrays(logfile);