I recently installed Almalinux 8 on my old PC (intel core i7 960, gigabyte GA X58A UD3R mb) as a dual boot with original windows 10. The linux install went fairly smoothly, but one bothersome issue existed whenever I tried to restart using gnome “restart” button to reboot or switch to windows. The onboard ethernet adapter would not exist on windows or linux after rebooting. I found that I had to completely shutdown linux before any reboot if I wanted the ethernet adapter to work in either OS after a reboot. After endless internet searching for solutions, it appears that there have been many issues with the standard r8169 driver and older realtek ethernet adapters which the driver supposedly supports. In trying to fall back to the realtek r8168 driver, the compile failed due to a missing include (pci-aspm.h) after the build script had already removed the default r8169 driver. Of course I lost the interner at this point, but rebooting recovered the adapter without the need to completely power off.
This has led to a pretty simple work-around for my particular problem. I created a systemd extension for the systemd-reboot.service which executes the rmmod r8169 module before performing the reboot command. In /etc/systemd/system I created a new directory “systemd-reboot.service.d” and created a “r8169-rmmod.conf” to extend the default reboot service. This file contains the following text:
[Service]
Type=oneshot
ExecStart=/usr/sbin/rmmod r8169
Problem solved!