feature: Lenovo OEM hybrid pattern (LSU + WMI BIOS + debloat)#73
feature: Lenovo OEM hybrid pattern (LSU + WMI BIOS + debloat)#73Gumbees wants to merge 1 commit into
Conversation
Replicates the Dell OEM hybrid pattern (PR #69) for Lenovo. LSU is the public default (no Lenovo Partner Hub enrollment required), BIOS config goes through WMI (Lenovo has no cctk-equivalent CLI), and the debloat keep-list protects LSU and Lenovo enterprise security agents while removing consumer Vantage. Closes #71.
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, push a new commit or reopen this pull request to trigger a review.
|
Closing in favor of the OEM redo design captured at #74. The original approach (runtime lib bootstrap via jsDelivr, "baseline" naming with static policy files, hash placeholders) is being replaced with CI-generated fat scripts, internet check only at the install step, and RMM-env-var-driven Branch retained ... cherry-pick anything worth preserving from the new PR's branch. |
Summary
Replicates the Dell OEM hybrid pattern (PR #69) for Lenovo. LSU is the public default (no Lenovo Partner Hub enrollment required), BIOS config goes through WMI (Lenovo has no
cctk-equivalent CLI), and the debloat keep-list protects LSU and Lenovo enterprise security agents but removes consumer Vantage.Closes #71.
Files added
oem-lenovo/lenovo-baseline.ps1... orchestrator, mirrorsdell-baseline.ps1oem-lenovo/lenovo-system-update-install.ps1... installs Lenovo System Update 5.08.03.59 via Inno Setup/verysilent /norestartoem-lenovo/lenovo-system-update-run.ps1... runsTvsu.exe /CM -search A -action INSTALL -includerebootpackages 1,3,4 -noreboot -nolicense -noiconoem-lenovo/lenovo-bios-config.ps1... appliesname,valuepolicy viaLenovo_SetBiosSetting+Lenovo_SaveBiosSettings(root\wmi)oem-lenovo/lenovo-debloat.ps1... removes consumer Lenovo Vantage / Smart Communication / Smart Privacy / Smart Appearance / Voice / Now / Welcome / Migration Assistant / McAfee bundles + provisioned AppX (E0469640.*,LenovoCorporation.LenovoVantage)oem-lenovo/lib/lenovo-detection.ps1...Test-LenovoHardware,Get-LenovoInstalledModel(SystemFamily),Get-LenovoMachineType,Test-LSUInstalled,Get-LSUVersion,Get-LSUCliPathLib bootstrap pattern
Uses the new commit-SHA-pinned pattern (no
Sha256field, noREPLACE_WITH_REAL_HASHplaceholder). Libs pinned to5b1b16c4b19816343145138941c3c5fa51a095e8(currentorigin/developmentHEAD).# TODO: bump SHA when oem-shared/lib or oem-lenovo/lib changesnear each$libBaseUrl.Lenovo-specific divergence from Dell pattern
Lenovo_SetBiosSetting/Lenovo_SaveBiosSettings(WMI). Policy file format is onename,valuetuple per line (#for comments), parsed in PowerShell, looped per setting, thenLenovo_SaveBiosSettingscommits once at the end.$env:LenovoBiosSupervisorPasswordis set, the tuple becomesName,Value,<pwd>,ascii,usper the Lenovo CDRT WMI BIOS guide.Test-LenovoHardwareusesWin32_ComputerSystem.Manufacturer -like "LENOVO*"(uppercase per Lenovo firmware convention).SystemFamily(e.g. "ThinkPad T14") for the Ninja custom field.Modelis exposed separately as the 4-char machine-type prefix viaGet-LenovoMachineType.Tvsu.exeexit code documentation is thin. Current mapping is 0 = success, non-zero = error, with a session.xml stub for post-run parsing once the schema is confirmed on a live endpoint. (Dell's DCU has a full documented exit code table; LSU does not.)Commercial Vantage stub
$env:LenovoVantageCommercialAvailable = "1"is documented in the baseline header but the branch is not implemented. The orchestrator currently emitsWrite-Host "LenovoVantageCommercialAvailable=1: Commercial Vantage path not yet implemented; falling back to LSU"and continues down the LSU path. A# TODO: Commercial Vantage opt-in pathcomment inlenovo-baseline.ps1marks the spot for the future swap.TODOs captured in code
system_update_5.08.03.59.exedtc-baseline.lenovobiosonce that policy file is authored (NOT included in this PR)Lenovo_SaveBiosSettings("")no-password call succeeds on test endpoint (older models may require a tuple even with empty password)%PROGRAMDATA%\Lenovo\SystemUpdate\session.xmlfor the Ninja custom field summaryTest plan
lenovo-baseline.ps1on a real Lenovo ThinkPad endpoint with$env:RMM=0(interactive)Test-LenovoHardwarereturns true (uppercase manufacturer match)${env:ProgramFiles(x86)}\Lenovo\System Update\Tvsu.exe... 32-bit vs 64-bit Program Files variation)Tvsu.exe /CM -search A -action INSTALL -includerebootpackages 1,3,4installs reboot-required packages (without this flag, BIOS and firmware are skipped)Lenovo_SetBiosSetting+Lenovo_SaveBiosSettingsround-trip on a test endpoint with no supervisor passwordLenovoCorporation.LenovoVantage) but keeps Commercial Vantage (LenovoCorporation.LenovoSettings) when both happen to be presentexit 0, Ninja custom field "Skipped: not Lenovo")