Skip to content

Refactor LinuxGeneralDrivelution to inherit BaseDriverUpdater - #287

Merged
JusterZhu merged 1 commit into
masterfrom
feature/refactor-linux-updater-issue-286
May 23, 2026
Merged

Refactor LinuxGeneralDrivelution to inherit BaseDriverUpdater#287
JusterZhu merged 1 commit into
masterfrom
feature/refactor-linux-updater-issue-286

Conversation

@JusterZhu

Copy link
Copy Markdown
Collaborator

Summary

Refactor the Linux platform driver updater to inherit from BaseDriverUpdater, eliminating duplicated pipeline code and aligning error handling with the Windows implementation.

Changes

  • LinuxGeneralDrivelution now inherits BaseDriverUpdater instead of implementing IGeneralDrivelution directly
  • Linux sudo permission check injected as first pipeline step via GetPipelineSteps() override
  • Only InstallCoreAsync retained: delegates to .ko/.deb/.rpm format-specific installers
  • RollbackAsync override: unloads current module (modprobe -r) and reloads backup (insmod)
  • All retry, timeout, unified rollback, and structured error handling inherited from base
  • Error mapping via BaseDriverUpdater.MapExceptionToErrorInfo (was previously a bare ErrorInfo)

Diff

  • +279 / −387 lines (net −108)

Before vs After

Feature Before After
Error handling catch(Exception) → bare ErrorInfo Inherited MapExceptionToErrorInfo with suggested resolutions
Retry logic Not implemented Inherited from BaseDriverUpdater
Timeout Not implemented Inherited via linked CancellationTokenSource
Rollback Inline try-catch Typed exception with structured fallback

Closes #286

…seDriverUpdater

- Now inherits BaseDriverUpdater instead of implementing IGeneralDrivelution directly
- Only InstallCoreAsync and format-specific installers retained
- Linux sudo check added as a custom pipeline step via GetPipelineSteps
- RollbackAsync override: restores kernel modules by modprobe -r + insmod
- Error handling unified via BaseDriverUpdater.MapExceptionToErrorInfo
- All retry, timeout, and event logic inherited from base class
- ~500 lines -> ~390 lines

Closes #286
Copilot AI review requested due to automatic review settings May 23, 2026 10:55
@JusterZhu
JusterZhu merged commit d238c9a into master May 23, 2026
1 check failed
@JusterZhu
JusterZhu deleted the feature/refactor-linux-updater-issue-286 branch May 23, 2026 10:57
@JusterZhu
JusterZhu removed the request for review from Copilot May 23, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor LinuxGeneralDrivelution to inherit BaseDriverUpdater

1 participant