mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
installer: Make umounting more reliable
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user