site  contact  subhomenews

Automatic NVIDIA SFS updating

November 08, 2023 — BarryK

Continuing from the previous post:

https://bkhome.org/news/202311/kernel-515137-and-nvidia-sfs-compiled.html

An NVIDIA SFS is compiled for a particular kernel version. So, if EasyOS is updated and the kernel has changed, then the NVIDIA SFS will no longer work.

While studying the code, I realised that there is a fundamental bug with SFSs when there is a EasyOS version update. SFSs that loaded in the previous version, no longer load in the new version. They are forgotten, and have to be reselected.

The code has been fixed so that previously-loaded SFS will carry-over to the new version. Subject to compatibility. The devx SFS will get dropped, as that is specific to the previous EasyOS version.

For the NVIDIA SFS, there are two scripts involved, the 'init' script in the initrd, and /usr/local/easy_version/easy-update. The latter is what runs when you click on the "update" icon on the desktop.

'easy-update' checks if you currently have the NVIDIA SFS loaded, and if the new EasyOS version is using a different kernel, then looks online to see if there is an SFS available for that kernel. If so, offers to download it.

The 'init' script in the initrd will recognise existence of either the previous NVIDIA SFS if it is still the same kernel, or the downloaded new SFS, and load it. The effect is seamless updating of NVIDIA SFS.

As mentioned in the previous post, when a kernel is compiled, a new NVIDIA SFS is also compiled. This will be uploaded and available when the user clicks the "update" icon.

The 'easy-update' script will detect if you are currently usiing an NVIDIA SFS, and if there is going to be a kernel version change will offer to download the new NVIDIA SFS. It is big, about 480MB -- hmmm, could greatly reduce that size by taking out the 'lib32' library -- do you need that? I haven't implemented a delta-difference file download mechanism for it.

Note, the new NVIDIA SFS can be downloaded manually. Download to /mnt/wkg/sfs/easyos/oe/kirkstone, then at next bootup after updating EasyOS, the 'init' script will recognise it's existence and use it.

However, that is putting the "cart before the horse". When running Easy 5.6.1, which will have 5.15.137 kernel, you will have to download the 'nvidia_5.15.137-525.125.06_amd64.sfs' and load it. SFSget will do that, via clicking on the "pkg" icon.

The automatic updating of NVIDIA SFS will apply after that, when you update to Easy 5.6.2 and beyond.

The relevant github commits:

https://github.com/bkauler/woofq/commits/0504e2076ad1ddd1c8730995a7ed95a8ccf50eab

I am only aware of two EasyOS users who would want this. I currently don't have a PC with NVIDIA GPU, so it is untested. Hopefully, there is no logic-error, typo or syntax error in the code and it will work. If you already have NVIDIA GPU driver installed, you will need to get rid of it, the kernel modules, X11 driver and the GL libraries, get back to before it was installed.    

Tags: easy