Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with lokal HTTP Driver Repo from "Lenovo Update Retriever" #113

Closed
niceguy0815 opened this issue Feb 18, 2025 · 10 comments
Closed
Labels
bug Something isn't working

Comments

@niceguy0815
Copy link

Version

1.6.2

Computer Model

many

Problem

We have tested the LSUpdate Module in our company for mass deployment on 800 ThinkPad T14 G4 and G5 devices.

However, we cannot use it over the internet to download directly from the Lenovo online repository due to too much traffic—we have up to 2000 Lenovo devices in our environment.

Instead, we have created our own repository using Lenovo Update Retriever.

Searching our local repository works fine with the following command:

$updates = Get-LSUpdate -Repository http://Servername/LenovoRepository -Verbose | Where-Object { $.Type -ne 'BIOS' -and $.Type -ne 'Firmware' }

Issue with a Large Local Repository

We maintain a large repository containing drivers for various T14 models (Gen1, Gen2, Gen4, Gen5) as well as multiple generations of ThinkStations and some other Lenovo devices and Docks.

The problem with using the LSUpdate script on a large local driver repository is that, over time, multiple versions of the same driver may accumulate in the repository.

For example, when searching for a graphics driver, the script detects and downloads all available versions instead of selecting only the latest version. It then attempts to install them in no specific order.

This results in cases where an older driver version (e.g., v1.4.1) is installed after a newer version (e.g., v1.5.0), effectively rolling back the update.

I understand that this issue only occurs with a local repository because the Lenovo online repository always provides only the latest driver version.
Question:

Is there a way to implement a version check so that only the newest version of each driver is installed?
Is there a parameter that allows installation of only drivers marked as "Active" in "Update Retriever"?

Would appreciate any suggestions or solutions!

Additional context

But aside from this problem, we love this driver update/install script because it clearly shows what the tool has searched for, found, and installed on a device in the logs.

It is difficult for us to keep the local repository updated with only the newest version of a specific driver.

The challenge is that for one device type, a certain driver version may be the latest, but for a newer generation device, it could already be outdated, with a newer version available.

However, if we delete the driver to keep only the latest version for the newer generation device, it also removes support for the older device, which may only be compatible with version xYz of the driver.

Thanks for your worke

@niceguy0815 niceguy0815 added the bug Something isn't working label Feb 18, 2025
@jantari
Copy link
Owner

jantari commented Feb 18, 2025

Thanks for the detailed explanation of your usecase and issue!

Can you please give me some examples of duplicate updates you have in your repository, and for what computer models?

Is there a way to implement a version check so that only the newest version of each driver is installed?

I think the easiest would be to pick the package with the latest ReleaseDate.

Is there a parameter that allows installation of only drivers marked as "Active" in "Update Retriever"?

No, there isn't and currently LSUClient doesn't respect the status of a package in an Update-Retriever repository at all - it will always find all packages. However that is something I could fix, I think the more correct behavior would be to ignore hidden updates at least. Would that be helpful, even if there is no parameter to configure this behavior?

@niceguy0815
Copy link
Author

Hi, and thanks for your reply.
I can provide an "extreme" example.
It is a ThinkPad T14 Gen 2, Model 20W1S9BX00.
Over time, the repository has accumulated a lot of old drivers, and the script detects over 50 drivers, but most of them are duplicates.
Here is the log file:

_LENOVO_DRIVER_LSUClient162_20250211-112831-edit.log

If LSUpdate reads the database file from the repository, I think an easy way would be to check the status to see if it is set to "active." like the Lenovo System Update and Thininstaller do?
With that, you can control exactly what is allowed to be installed per model.

Image

But checking the release date could also be a possible solution for multiple versions of a driver.

If you need any further data, I am happy to help.
Thanks

@mariusbfjeld
Copy link

I was just browsing to see if anyone had a similar issue and found this thread!
I would love it if Get-LSUpdate either skips updates not tagged with Active in "database.xml" or similar for the other type of repository, then has a parameter akin to "-IncludeAllStatus".
OR the other way around, where you have to add "-OnlyActiveStatus" to make Get-LSUpdate skip past anything not tagged with Active in "database.xml" or similar.

I have a similar issue, where I maintain an offline repository for a host of Lenovo models, using ThinkVantage UpdateRetriever. I am also running LSUClient version 1.6.2

I was running LSUClient on a P1 gen 4 (20Y3) and noticed in the output it was download and installing 3 separate versions of NVIDIA Video Features Driver. According to the output it tried the following:

  1. Install NVIDIA driver version 31.0.15.3847 - This was successful
  2. Install NVIDIA driver version 31.0.15.3878 - This failed with exit code 1, I'm assuming due to a pending reboot or something similar
  3. Install NVIDIA driver version 31.0.15.3892 - This failed with exit code 1, I'm assuming the same as above

I went to my repository to hide the updates, then had a thought and went to see how LSUClient decides which drivers should be used from the repository, but couldn't find anything relating to status.

@jantari
Copy link
Owner

jantari commented Feb 20, 2025

Currently I'm thinking Get-LSUpdate should return / show all drivers in the repository except for those explicitly marked as Status "Hidden" (because hidden should mean hidden, I think it's unexpected to see these updates returned)

Then I also add a Status property to the update objects returned so it's easy to filter out updates with other Statuses ( "Test" or "Archived" ) because that would still be close enough to the current behavior (all packages being returned regardless of Status) to not totally break other users' scripts whilst also enabling the option to include or filter updates based on Status.

Thoughts?

@mariusbfjeld
Copy link

Sounds perfect, especially just showing the Status property so we can filter out ourselves as needed

@jantari
Copy link
Owner

jantari commented Feb 22, 2025

I have pushed a change to the develop branch that adresses this.

Hidden updates are now ignored (this is logged in Verbose output) and any other statuses are returned. The status set for an update in Update Retriever is now shown in the Status property of each update returned by Get-LSUpdate.

So for example if you want to ignore Test updates:

# Only 'Active' updates
Get-LSUpdate -Repository 'https://pkgs.domain.tld/lenovo-drivers' | Where-Object Status -eq 'Active'

or alternatively:

# All except 'Test' updates
Get-LSUpdate -Repository 'https://pkgs.domain.tld/lenovo-drivers' | Where-Object Status -ne 'Test'

If you could clone/download the develop branch to test this it would be great. If there are no issues with this implementation I plan to release it as v1.7.0 soon.

@niceguy0815
Copy link
Author

Hi, this change is awesome!
Thanks :)
Tomorrow at work, I will set up a test for this and give you feedback after the test.
But again, big thanks for this feature.

@niceguy0815
Copy link
Author

Hi,
the tests took a bit longer because I had problems detecting two drivers.
But this was not an LSUpdate script problem—it was a Lenovo detection logic issue in the XML of the drivers.
It took me some time to understand Lenovo’s strange logic.

I also had a firmware update for a camera that threw a PowerShell error.
But this was also a Lenovo problem because there was no detection logic in the XML, just a tag, which caused an error:

AUSFÜHRLICH: Processing package http://servername/LenovoRepository/n2yl405w/n2yl405w_2_.xml
AUSFÜHRLICH: Downloading 'http://servername/LenovoRepository/n2yl405w/n2yl405w_2_.xml' to 'C:\Windows\TEMP\qv15jtxz.b3s\ah25ycm4.ri1\n2yl405w_2_.xml'
AUSFÜHRLICH: Downloading 'http://servername/LenovoRepository/n2yl405w/n2yl405w_0sf114n3_version.exe' to 'C:\Windows\TEMP\qv15jtxz.b3s\ah25ycm4.ri1\n2yl405w_0sf114n3_version.exe'
AUSFÜHRLICH: Downloading 'http://servername/LenovoRepository/n2yl405w/n2yl405w_0sf114n3_rtkfwversions.config' to 'C:\Windows\TEMP\qv15jtxz.b3s\ah25ycm4.ri1\n2yl405w_0sf114n3_rtkfwversions.config'
Save-PackageFile : Ausnahme beim Aufrufen von "DownloadFile" mit 2 Argument(en):  "Der Remoteserver hat einen Fehler 
zurückgegeben: (404) Nicht gefunden."
In C:\drivers\1.7.0\public\Get-LSUpdate.ps1:250 Zeichen:29
+                     $null = Save-PackageFile @SpfParams
+                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Save-PackageFile], MethodInvocationException
    + FullyQualifiedErrorId : WebException,Save-PackageFile
Save-PackageFile : Ausnahme beim Aufrufen von "DownloadFile" mit 2 Argument(en):  "Der Remoteserver hat einen Fehler
zurückgegeben: (404) Nicht gefunden."
In C:\drivers\1.7.0\public\Get-LSUpdate.ps1:250 Zeichen:29
+                     $null = Save-PackageFile @SpfParams
+                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Save-PackageFile], MethodInvocationException
    + FullyQualifiedErrorId : WebException,Save-PackageFile

AUSFÜHRLICH: Package n2yl405w doesn't have a DetectInstall section

n2yl405w_2.xml.txt

_LENOVO_DRIVER_LSUClient170_20250225-100504-edit.log

But after disabling this firmware, everything works fine now.

So, disabling works, and scanning and only installing with status "active" works as well.

Thanks for your work!

@mariusbfjeld
Copy link

I have tested a couple of times as well, and can confirm that updates with status "Hidden" now get filtered out properly when using Where-Object Status -eq 'Active'.

Thank you for the quick fix! I love this module, you're saving me an insane amount of work trying to make Commercial Vantage actually work.

@jantari
Copy link
Owner

jantari commented Mar 1, 2025

Thanks for the feedback and kind words. It's going to take me a few more days to finish up 1.7.0.

@jantari jantari closed this as completed in 698b964 Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants