sudo dnf install -y openssl kernel-devel mokutil keyutils
mokutil --sb-state
mkdir keys && cd keys
cat << EOF > x509.genkey
[ req ]
default_bits = 4096
distinguished_name = req_distinguished_name
prompt = no
string_mask = utf8only
x509_extensions = myexts
[ req_distinguished_name ]
O = Org
CN = Org signing key
emailAddress = org@gmail.com
[ myexts ]
basicConstraints=critical,CA:FALSE
keyUsage=digitalSignature
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid
EOF
openssl req -new -nodes -utf8 -sha512 -days 36500 -batch -x509 -config x509.genkey -outform DER -out signing_key.x509 -keyout signing_key.pem
sudo cp signing_key.pem signing_key.x509 /lib/modules/$(uname -r)/build/certs
echo 'blacklist r8169' | sudo tee -a /etc/modprobe.d/blacklist-r8169.conf
sudo dracut -f
sudo mokutil --import signing_key.x509 # will ask you a password. keep it mind.
reboot
After reboot you will see MOK Manager interface and will be asked to enroll the key.
First select "Enroll MOK".
Then "Continue".
Hit "Yes" and enter the password.
Then select "OK" and your device will reboot again.
git clone --recursive https://github.com/jerry4718/r8168-support-kernel-5.19.x.git && cd r8168-support-kernel-5.19.x
sudo ./autorun.sh
sudo dnf install python3-dnf-plugin-post-transaction-actions
sudo cp -rf r8168-support-kernel-5.19.x /usr/local/src
echo 'kernel:in:/usr/local/src/r8168-support-kernel-5.19.x/autorun.sh' | sudo tee -a /etc/dnf/plugins/post-transaction-actions.d/r8168.action