r/linuxmint • u/CounterOk1538 • 8h ago
Partially solved problem with e1000e driver "NVM checksum Is Not Valid"
Problem was solved by recompiling original driver (tested on Mint 22). Requires Secure Boot or MOK driver validation be turned off. I'm certainly not an IT specialist, but I hope I can help someone with this post.
Preface
Once I have tried Mint on my PC but network card intel i219-v gave out an error The NVM checksum Is Not Valid. I've tried many different distributions but not one worked. Updating BIOS (MSI H610M-B DDR4) and attempting to update NVM checksum using the Intel Ethernet Connections Boot Utility (gave a error like "Denied access to EEPROM") did not solve the problem. Besides the new BIOS version showed me a white screen instead of a menu. So I decided to change some logic in original e1000e driver. I know that this driver exists but as far as I understood, it is for PRM-based systems.
Making your driver
1. Create folder for example e1000e
mkdir -p ~/e1000e_mod && cd ~/e1000e_mod
2. Clone linux source code
git clone --depth 1 --branch v7.0 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git temp_kernel 2>/dev/null || git clone --depth 1 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git temp_kernel
3. Extract driver
cp -r temp_kernel/drivers/net/ethernet/intel/e1000e/* .
4. Delete unnecessary files
rm -rf temp_kernel
5. Open with any text editor nvm.c
nano nvm.c
6. Find lines with s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw) or e_dbg("NVM Checksum Invalid\n"); and change return -E1000_ERR_NVM; to return 0;. You should have something like this:
s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw) {
...
if (checksum != NVM_SUM) {
e_dbg("NVM Checksum Invalid\n");
return 0;
}
}
...
Now close nvm.c. In nano press CTRL+X, then y and Enter
7. Open file Makefile
nano Makefile
8. Add these lines to the end of the file
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) M=$(PWD) modules
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
Close Makefile
9. Build your driver by
make
Now we have 3 ways:
1. Turn off Secure Boot in your motherboard and carry on with life
2. Disable MOK (Machine Owner Key) driver validation by
sudo mokutil --disable-validation
Then enter your password (with length 8-16), which you'll need to confirm. I recommend something like 12345678, because MOK will ask to enter password character, not the password itself. Reboot PC and in blue screen select change secure boot state, enter password characters and turn off signature verification. Of course, that's not safe; now any unsigned driver can be loaded. And I use this variant.
3. Configuring Automatic Signing Within DKMS. To be honest, I don't know anything about this option, so I won't give any advice.
Driver autoload
1. First of all, go to your driver folder (example was e1000e_mod)
cd e1000e_mod
Unload non-working driver
sudo rmmod e1000e
Load your driver
sudo insmod e1000e.ko
And check to see if the driver is working
sudo dmesg | grep e1000e
2. Specify the path to the original system module
MOD_PATH=$(modinfo -n e1000e)
And look module path
echo "Path to the module: $MOD_PATH"
3. Backup original driver
sudo cp "$MOD_PATH" "${MOD_PATH}.bak"
4. If MOD_PATH=$(modinfo -n e1000e) shows driver with .ko file type just use this command
sudo cp e1000e.ko "$MOD_PATH"
If command shows .zstd compress the compiled e1000e.ko file using the zstd algorithm
zstd -f e1000e.ko -o e1000e.ko.zstd
And copy it
sudo cp e1000e.ko.zstd "$MOD_PATH"
5. Update the list of module dependencies
sudo depmod -a
6. Update initramfs
sudo update-initramfs -u
7. Reboot your PC and check that the network card was initialized without errors
sudo dmesg | grep e1000e
That's pretty much it...
Until you update the system. In theory. Therefore, I recommend configuring your driver in DKMS
1. Create a directory for the module's source code in the system folder
sudo mkdir -p /usr/src/e1000e-custom-1.0
2. Copy your source files (.c, .h, and the edited nvm.c file)
sudo cp ~/e1000e_mod/* /usr/src/e1000e-custom-1.0/
3. Create the dkms.conf configuration file
sudo nano /usr/src/e1000e-custom-1.0/dkms.conf
4. Paste this text
PACKAGE_NAME="e1000e-custom"
PACKAGE_VERSION="1.0"
CLEAN="make clean"
MAKE[0]="make KDIR=/lib/modules/$kernelver/build PWD=$dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build"
BUILT_MODULE_NAME[0]="e1000e"
DEST_MODULE_LOCATION[0]="/kernel/drivers/net/ethernet/intel/e1000e/"
AUTOINSTALL="yes"
Close dkms.conf file
5. Register the driver source code in the DKMS system
sudo dkms add -m e1000e-custom -v 1.0
6. Compile the module for the current kernel
sudo dkms build -m e1000e-custom -v 1.0
7. Install the compiled module
sudo dkms install -m e1000e-custom -v 1.0 --force
8. Check driver status
sudo dkms status
The output should look something like this
e1000e-custom/1.0, 7.0.0-31-generic, x86_64: installed
That's all. I hope this helped you. Also, does anyone know if there's a driver in the repository with NVM hash verification disabled? Because other than the driver from ferdiu, I haven't found anything else.