Fix mount failures in configure_target_system and ensure progress never goes backward

- Add graceful error handling for mount operations in live system environment
- Check if mount points are already mounted before attempting to mount
- Continue installation despite mount failures with proper logging
- Ensure progress bar never decreases by only updating when progress increases
- Update re-estimation to show progress every 5 seconds with detailed ETA
- Add proper unmount error handling for cleanup operations
parent 1ae64b33
......@@ -859,20 +859,33 @@ class InstallerWorker(QThread):
new_estimated_time = remaining_bytes / current_rate
estimated_copy_time = elapsed_time + new_estimated_time
# Update progress text with 5-second estimation
# Update progress text with actual progress and 5-second estimation
rate_mb_s = current_rate / (1024 * 1024)
remaining_mb = remaining_bytes / (1024 * 1024)
eta_minutes = int(new_estimated_time // 60)
eta_seconds = int(new_estimated_time % 60)
# Calculate actual progress percentage
if total_bytes > 0:
progress_percent = (bytes_copied / total_bytes) * 100
progress_text = f"Copying... {progress_percent:.1f}% complete, {rate_mb_s:.1f} MB/s, ETA: {eta_minutes}:{eta_seconds:02d}, {remaining_mb:.0f} MB remaining"
else:
progress_text = f"Copying... {rate_mb_s:.1f} MB/s, ETA: {eta_minutes}:{eta_seconds:02d}, {remaining_mb:.0f} MB remaining"
self.copy_progress.emit(progress_text)
last_reestimate_time = current_time
last_reestimate_bytes = bytes_copied
# Use adaptive time-based progress estimation based on estimated copy time
# Calculate progress based on actual bytes copied vs total bytes
if total_bytes and bytes_copied > 0:
# Use actual data transfer progress for more accurate calculation
data_progress = min(bytes_copied / total_bytes, 0.95) # Cap at 95% to leave room for final steps
current_progress = copy_progress_start + (data_progress * copy_progress_range)
else:
# Fallback to time-based estimation when we don't have byte information
if estimated_copy_time > 0:
# Use the estimated copy time for more accurate progression
# Use the re-estimated copy time for more accurate progression
time_progress = min(elapsed_time / estimated_copy_time, 0.95)
else:
# Fallback to adaptive time-based estimation
......@@ -886,6 +899,7 @@ class InstallerWorker(QThread):
time_progress = 0.9 + min((elapsed_time - 240) / 120, 0.05)
current_progress = copy_progress_start + (time_progress * copy_progress_range)
current_progress = min(current_progress, copy_progress_end - 2) # Leave room for final update
# Update progress more frequently during copy (every 1% change or 3 seconds)
......@@ -899,6 +913,8 @@ class InstallerWorker(QThread):
should_update = True
if should_update:
# Ensure progress never goes backward
if not hasattr(self, '_last_progress') or current_progress > self._last_progress:
self.progress_updated.emit(int(current_progress))
self._last_progress = current_progress
self._last_update_time = current_time
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment