mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +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) {
|
int hw_umount_filesystems(struct hw_destination* dest, const char* prefix) {
|
||||||
|
// Write all buffers to disk before umounting
|
||||||
|
hw_sync();
|
||||||
|
|
||||||
// boot
|
// boot
|
||||||
if (*dest->part_boot) {
|
if (*dest->part_boot) {
|
||||||
hw_umount(dest->part_boot);
|
hw_umount(dest->part_boot);
|
||||||
|
|||||||
@@ -637,6 +637,13 @@ int main(int argc, char *argv[]) {
|
|||||||
mysystem(logfile, commandstring);
|
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
|
// Umount source drive and eject
|
||||||
hw_umount(SOURCE_MOUNT_PATH);
|
hw_umount(SOURCE_MOUNT_PATH);
|
||||||
|
|
||||||
@@ -671,13 +678,7 @@ EXIT:
|
|||||||
free(helpline);
|
free(helpline);
|
||||||
|
|
||||||
free(sourcedrive);
|
free(sourcedrive);
|
||||||
|
free(destination);
|
||||||
if (destination) {
|
|
||||||
hw_sync();
|
|
||||||
|
|
||||||
hw_umount_filesystems(destination, DESTINATION_MOUNT_PATH);
|
|
||||||
free(destination);
|
|
||||||
}
|
|
||||||
|
|
||||||
hw_stop_all_raid_arrays(logfile);
|
hw_stop_all_raid_arrays(logfile);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user