Realtek 8168スクリプトが機能しない

Realtek 8168スクリプトが機能しない

最新のRealtekドライバを使用したいのですが、Ubuntu 22では利用できません。 Realtekスクリプトは以前のオープンソースドライバを削除し、USBを使用して携帯電話に接続しました。 Realtekのログは次のとおりです。

make -C src/ clean
make[1]: Entering directory '/home/deb/Downloads/r8168-8.050.03/src'
make -C /lib/modules/5.15.0-41-generic/build M=/home/deb/Downloads/r8168-8.050.03/src clean
make[2]: Entering directory '/usr/src/linux-headers-5.15.0-41-generic'
  CLEAN   /home/deb/Downloads/r8168-8.050.03/src/Module.symvers
make[2]: Leaving directory '/usr/src/linux-headers-5.15.0-41-generic'
make[1]: Leaving directory '/home/deb/Downloads/r8168-8.050.03/src'
make -C src/ modules
make[1]: Entering directory '/home/deb/Downloads/r8168-8.050.03/src'
make -C /lib/modules/5.15.0-41-generic/build M=/home/deb/Downloads/r8168-8.050.03/src modules
make[2]: Entering directory '/usr/src/linux-headers-5.15.0-41-generic'
  CC [M]  /home/deb/Downloads/r8168-8.050.03/src/r8168_n.o
  CC [M]  /home/deb/Downloads/r8168-8.050.03/src/r8168_asf.o
  CC [M]  /home/deb/Downloads/r8168-8.050.03/src/rtl_eeprom.o
  CC [M]  /home/deb/Downloads/r8168-8.050.03/src/rtltool.o
  LD [M]  /home/deb/Downloads/r8168-8.050.03/src/r8168.o
  MODPOST /home/deb/Downloads/r8168-8.050.03/src/Module.symvers
  CC [M]  /home/deb/Downloads/r8168-8.050.03/src/r8168.mod.o
  LD [M]  /home/deb/Downloads/r8168-8.050.03/src/r8168.ko
  BTF [M] /home/deb/Downloads/r8168-8.050.03/src/r8168.ko
make[2]: Leaving directory '/usr/src/linux-headers-5.15.0-41-generic'
make[1]: Leaving directory '/home/deb/Downloads/r8168-8.050.03/src'
make -C src/ install
make[1]: Entering directory '/home/deb/Downloads/r8168-8.050.03/src'
make -C /lib/modules/5.15.0-41-generic/build M=/home/deb/Downloads/r8168-8.050.03/src INSTALL_MOD_DIR=kernel/drivers/net/ethernet/realtek modules_install
make[2]: Entering directory '/usr/src/linux-headers-5.15.0-41-generic'
  INSTALL /lib/modules/5.15.0-41-generic/kernel/drivers/net/ethernet/realtek/r8168.ko
  SIGN    /lib/modules/5.15.0-41-generic/kernel/drivers/net/ethernet/realtek/r8168.ko
  DEPMOD  /lib/modules/5.15.0-41-generic
make[2]: Leaving directory '/usr/src/linux-headers-5.15.0-41-generic'
make[1]: Leaving directory '/home/deb/Downloads/r8168-8.050.03/src'

これはシェル出力です:

deb@deb:~/Downloads/r8168-8.050.03$ sudo bash autorun.sh

Check old driver and unload it. 
Build the module and install 
Skipping BTF generation for /home/deb/Downloads/r8168-8.050.03/src/r8168.ko due to unavailability of vmlinux 
arch/x86/Makefile:142: CONFIG_X86_X32 enabled but no binutils support 
At main.c:160:
    - SSL error:FFFFFFFF80000002:system library::No such file or directory: ../crypto/bio/bss_file.c:67
    - SSL error:10000080:BIO routines::no such file: ../crypto/bio/bss_file.c:75 
sign-file: certs/signing_key.pem: No such file or directory 
Warning: modules_install: missing 'System.map' file. Skipping depmod. 
DEPMOD 5.15.0-41-generic 
load module r8168 
modprobe: ERROR: could not insert 'r8168': Operation not permitted 
Updating initramfs. Please wait. 
update-initramfs: Generating /boot/initrd.img-5.15.0-41-generic Completed.

Lspci-k

02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
Subsystem: Acer Incorporated [ALI] RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
Kernel modules: r8168

enp2s0 は nmcli では使用できません。

なぜLinuxを使用しようとするたびに痛みを伴うことに直面するのかわかりませんが、とにかくそのようなことが起こります。

いくつかのアドバイス?

修正===================================

@telcoM お得な回答ありがとうございます。しかし、状況はさらに悪化しました。 MOKファイルがありますが、次のようになります。

deb@deb:~$ sudo ls /var/lib/shim-signed/mok
MOK.der  MOK.priv

deb@deb:~$ ls /lib/modules/$(uname -r)/kernel/drivers/net/ethernet/realtek
8139cp.ko  8139too.ko  atp.ko  r8168.ko  r8169.bak

deb@deb:~$ sudo kmodsign sha512 \ /var/lib/shim-signed/mok/MOK.priv \ /var/lib/shim-signed/mok/MOK.der \ /lib/modules/$(uname -r)/kernel/drivers/net/ethernet/realtek/r8168.ko
At main.c:249:
- SSL error:FFFFFFFF80000002:system library::No such file or directory: ../crypto/bio/bss_file.c:67
- SSL error:10000080:BIO routines::no such file: ../crypto/bio/bss_file.c:75
kmodsign:  /var/lib/shim-signed/mok/MOK.priv: No such file or directory

だからopensslを確認しました。

deb@deb:~$ ls /usr/lib/ssl/
certs  misc  openssl.cnf  private

再インストールが役に立ったと言いましたが、Chromeと多くのアイテムも削除されました。

deb@deb:~$ sudo apt-get remove openssl
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apport-symptoms apturl-common cups-server-common gir1.2-dbusmenu-glib-0.4 gir1.2-dee-1.0 gir1.2-goa-1.0 gir1.2-snapd-1 gir1.2-unity-7.0
  gnome-software-common hplip-data libauthen-sasl-perl libclone-perl libcupsimage2 libdata-dump-perl libfile-listing-perl libflatpak0
  libfont-afm-perl libglu1-mesa libhpmud0 libhtml-form-perl libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl
  libhttp-cookies-perl libhttp-daemon-perl libhttp-date-perl libhttp-message-perl libhttp-negotiate-perl libimagequant0 libio-html-perl
  libio-socket-ssl-perl liblwp-mediatypes-perl libmailtools-perl libnet-http-perl libnet-smtp-ssl-perl libnet-ssleay-perl libraqm0
  libsane-hpaio libtie-ixhash-perl libtimedate-perl libtry-tiny-perl libvncclient1 libwww-robotrules-perl libxatracker2
  libxml-xpathengine-perl libxvmc1 perl-openssl-defaults printer-driver-postscript-hp python3-blinker python3-cffi-backend python3-chardet
  python3-cryptography python3-dateutil python3-debconf python3-debian python3-distro-info python3-distupgrade python3-idna python3-jeepney
  python3-jwt python3-keyring python3-lazr.uri python3-nacl python3-oauthlib python3-olefile python3-pexpect python3-pil
  python3-problem-report python3-protobuf python3-ptyprocess python3-pymacaroons python3-pyparsing python3-renderpm python3-reportlab
  python3-reportlab-accel python3-rfc3339 python3-secretstorage python3-six python3-systemd python3-tz python3-update-manager
  python3-urllib3 python3-wadllib ubuntu-advantage-desktop-daemon unattended-upgrades x11-apps x11-session-utils xbitmaps xinit xinput
  xserver-xorg-input-all xserver-xorg-input-libinput xserver-xorg-input-wacom xserver-xorg-video-all xserver-xorg-video-amdgpu
  xserver-xorg-video-ati xserver-xorg-video-fbdev xserver-xorg-video-intel xserver-xorg-video-nouveau xserver-xorg-video-qxl
  xserver-xorg-video-radeon xserver-xorg-video-vesa xserver-xorg-video-vmware
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  apport apport-gtk apturl bluez-cups ca-certificates cups cups-browsed cups-core-drivers cups-daemon gnome-online-accounts gnome-software
  gnome-software-plugin-flatpak gnome-software-plugin-snap google-chrome-stable hplip liblwp-protocol-https-perl libnet-dbus-perl libtpms0
  libwww-perl libxml-parser-perl libxml-twig-perl nautilus-share openssl printer-driver-hpcups printer-driver-splix python3-apport
  python3-certifi python3-httplib2 python3-launchpadlib python3-lazr.restfulclient python3-macaroonbakery python3-requests
  python3-software-properties snapd software-properties-common software-properties-gtk ssl-cert swtpm swtpm-tools ubuntu-desktop
  ubuntu-desktop-minimal ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk update-manager update-manager-core update-notifier
  update-notifier-common x11vnc xorg xserver-xorg
0 upgraded, 0 newly installed, 50 to remove and 0 not upgraded.
After this operation, 397 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 197839 files and directories currently installed.)
Removing apport-gtk (2.20.11-0ubuntu82.1) ...
Removing apport (2.20.11-0ubuntu82.1) ...
Removing nautilus-share (0.7.3-2ubuntu6) ...
Removing apturl (0.5.2ubuntu22) ...
Removing bluez-cups (5.64-0ubuntu1) ...
Removing google-chrome-stable (103.0.5060.134-1) ...
Removing ubuntu-desktop (1.481) ...
Removing printer-driver-splix (2.0.0+svn315-7fakesync1build3) ...
Removing hplip (3.21.12+dfsg0-1) ...
Removing printer-driver-hpcups (3.21.12+dfsg0-1) ...
Removing cups (2.4.1op1-1ubuntu4.1) ...
Removing cups-browsed (1.28.15-0ubuntu1) ...
Removing cups-core-drivers (2.4.1op1-1ubuntu4.1) ...
Removing cups-daemon (2.4.1op1-1ubuntu4.1) ...
Removing gnome-online-accounts (3.44.0-1ubuntu1) ...
Removing gnome-software-plugin-flatpak (41.5-2) ...
Removing gnome-software-plugin-snap (41.5-2) ...
Removing gnome-software (41.5-2) ...
Removing libnet-dbus-perl (1.2.0-1build3) ...
Removing libxml-twig-perl (1:3.52-1) ...
Removing libxml-parser-perl:amd64 (2.46-3build1) ...
Removing swtpm-tools (0.6.3-0ubuntu3) ...
Removing swtpm (0.6.3-0ubuntu3) ...
Removing libtpms0:amd64 (0.9.3-0ubuntu1) ...
Removing x11vnc (0.9.16-8) ...
Removing ssl-cert (1.1.2) ...
Removing ubuntu-desktop-minimal (1.481) ...
Removing xorg (1:7.7+23ubuntu2) ...
Removing xserver-xorg (1:7.7+23ubuntu2) ...
Removing python3-apport (2.20.11-0ubuntu82.1) ...
Removing python3-macaroonbakery (1.3.1-2) ...
Removing python3-requests (2.25.1+dfsg-2) ...
Removing python3-certifi (2020.6.20-1) ...
Removing software-properties-gtk (0.99.22.2) ...
Removing software-properties-common (0.99.22.2) ...
Removing python3-software-properties (0.99.22.2) ...
Removing python3-launchpadlib (1.10.16-1) ...
Removing python3-lazr.restfulclient (0.14.4-1) ...
Removing python3-httplib2 (0.20.2-2) ...
Removing snapd (2.55.5+22.04) ...
Warning: Stopping snapd.service, but it can still be activated by:
  snapd.socket
Removing liblwp-protocol-https-perl (6.10-1) ...
Removing libwww-perl (6.61-1) ...
Removing update-notifier (3.192.54) ...
Removing update-manager (1:22.04.9) ...
Removing update-notifier-common (3.192.54) ...
Removing update-manager-core (1:22.04.9) ...
Removing ubuntu-release-upgrader-gtk (1:22.04.11) ...
Removing ubuntu-release-upgrader-core (1:22.04.11) ...
Removing ca-certificates (20211016) ...
Removing dangling symlinks from /etc/ssl/certs... done.
Removing openssl (3.0.2-0ubuntu1.6) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for libglib2.0-0:amd64 (2.72.1-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for dbus (1.12.20-2ubuntu4) ...
Processing triggers for shared-mime-info (2.1-2) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...

そして

deb@deb:~$ sudo apt-get install openssl
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apport-symptoms apturl-common cups-server-common gir1.2-dbusmenu-glib-0.4 gir1.2-dee-1.0 gir1.2-goa-1.0 gir1.2-snapd-1 gir1.2-unity-7.0
  gnome-software-common hplip-data libauthen-sasl-perl libclone-perl libcupsimage2 libdata-dump-perl libfile-listing-perl libflatpak0
  libfont-afm-perl libglu1-mesa libhpmud0 libhtml-form-perl libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl
  libhttp-cookies-perl libhttp-daemon-perl libhttp-date-perl libhttp-message-perl libhttp-negotiate-perl libimagequant0 libio-html-perl
  libio-socket-ssl-perl liblwp-mediatypes-perl libmailtools-perl libnet-http-perl libnet-smtp-ssl-perl libnet-ssleay-perl libraqm0
  libsane-hpaio libtie-ixhash-perl libtimedate-perl libtry-tiny-perl libvncclient1 libwww-robotrules-perl libxatracker2
  libxml-xpathengine-perl libxvmc1 perl-openssl-defaults printer-driver-postscript-hp python3-blinker python3-cffi-backend python3-chardet
  python3-cryptography python3-dateutil python3-debconf python3-debian python3-distro-info python3-distupgrade python3-idna python3-jeepney
  python3-jwt python3-keyring python3-lazr.uri python3-nacl python3-oauthlib python3-olefile python3-pexpect python3-pil
  python3-problem-report python3-protobuf python3-ptyprocess python3-pymacaroons python3-pyparsing python3-renderpm python3-reportlab
  python3-reportlab-accel python3-rfc3339 python3-secretstorage python3-six python3-systemd python3-tz python3-update-manager
  python3-urllib3 python3-wadllib ubuntu-advantage-desktop-daemon unattended-upgrades x11-apps x11-session-utils xbitmaps xinit xinput
  xserver-xorg-input-all xserver-xorg-input-libinput xserver-xorg-input-wacom xserver-xorg-video-all xserver-xorg-video-amdgpu
  xserver-xorg-video-ati xserver-xorg-video-fbdev xserver-xorg-video-intel xserver-xorg-video-nouveau xserver-xorg-video-qxl
  xserver-xorg-video-radeon xserver-xorg-video-vesa xserver-xorg-video-vmware
Use 'sudo apt autoremove' to remove them.
Suggested packages:
  ca-certificates
The following NEW packages will be installed:
  openssl
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1.184 kB of archives.
After this operation, 2.102 kB of additional disk space will be used.
Selecting previously unselected package openssl.
(Reading database ... 195686 files and directories currently installed.)
Preparing to unpack .../openssl_3.0.2-0ubuntu1.6_amd64.deb ...
Unpacking openssl (3.0.2-0ubuntu1.6) ...
Setting up openssl (3.0.2-0ubuntu1.6) ...
Processing triggers for man-db (2.10.2-1) ...

Ubuntuのプライベートラベルキーとは何かわかりません。たぶん問題は "..crypto/"ディレクトリですか?

ベストアンサー1

セキュアブートが有効になっており、ドライバパッケージをメンテナンスする人がセキュアブート要件を知らなかったり、まったく気にしないことがあります。

インストールするドライバはこのドライバですか?https://github.com/mtorromeo/r8168

次のメッセージは無害です。

Skipping BTF generation for /home/deb/Downloads/r8168-8.050.03/src/r8168.ko due to unavailability of vmlinux 
arch/x86/Makefile:142: CONFIG_X86_X32 enabled but no binutils support 

ただし、このメッセージは、セキュアブートが有効になっているときに使用するすべての標準モジュールに署名するようにカーネルが構成されており、ドライバが同じプロセスを使用しようとしましたが、デフォルトではUbuntuの秘密署名キーがないため失敗することを示しています。

At main.c:160:
    - SSL error:FFFFFFFF80000002:system library::No such file or directory: ../crypto/bio/bss_file.c:67
    - SSL error:10000080:BIO routines::no such file: ../crypto/bio/bss_file.c:75 
sign-file: certs/signing_key.pem: No such file or directory 

これは結果モジュールが署名されていないことを意味するため、セキュアブートが有効になっているシステムはそれを拒否する必要があります。

次の手順で直接問題を解決できます。

  1. まだセキュアブートマシン所有者キー(MOK)を作成していない場合は、今すぐ作成してください。
sudo update-secureboot-policy --new-key

MOKがすでに存在する場合(つまり、/var/lib/shim-signed/mok/ディレクトリが存在し、空でない場合)、この手順をスキップして使用できます。

Ubuntu 22のインストール中に「グラフィック、Wi-Fiハードウェア、およびその他のメディアフォーマット用のサードパーティ製ソフトウェアのインストール」オプションと「セキュアブート構成」サブオプションを有効にした場合は、既存のMOKを作成した必要があります。 。この場合、システムですでに使用されている他のサードパーティドライバに問題が発生する可能性があるため、新しいMOKを作成しないでください。

  1. 次のコマンドを使用してkmodsignモジュールに署名します。
sudo kmodsign sha512 \
    /var/lib/shim-signed/mok/MOK.priv \
    /var/lib/shim-signed/mok/MOK.der \
    /lib/modules/$(uname -r)/kernel/drivers/net/r8168.ko
  1. initramfsを更新してください。
sudo update-initramfs -u
  1. 手順1で新しいMOKを作成した場合は、MOK登録手順を実行する必要があります。まず、次のコマンドを実行すると、新しい MOK 登録パスワードを生成するように求められます。
sudo mokutil --import /var/lib/shim-signed/mok/MOK.der

コマンドが完了したら、再起動する必要があります。これにより、起動プロセスが中断され、shimx64.efi上部にブルースクリーンが表示されます。Perform MOK management「MOK登録」オプションを選択して確認したら、上記のコマンドを使用して作成したばかりのMOK登録パスワードを入力する必要があります。成功すると、上部に「再起動」という小さなメニューが表示されます。これを選択すると、システムはセキュアブート署名r8168.koモジュールを使用して正常に起動します。

MOK登録が正常に完了すると、MOK登録パスワードが生成されます。もう必要ありません。:MOKを再登録する必要がある場合(おそらくBIOSを更新した後)、この操作のために新しい登録パスワードが設定されます。

システムがカーネル更新を受信するたびに、新しいカーネルがr8168.koモジュールを再度ロードできないことがあります。これが発生した場合は、このドライバを手動で再構築する必要があります。

  1. cdドライバパッケージを抽出したディレクトリに移動します。
cd ~/Downloads/r8168-8.050.03
  1. 再放送autorun.sh:
sudo bash autorun.sh
  1. 再構築されたモジュールに署名します。 (読みやすくするために複数行にまとめています。このコマンドを単一のコマンドラインで入力するには、バックスラッシュを削除してください。)
sudo kmodsign sha512 \
    /var/lib/shim-signed/mok/MOK.priv \
    /var/lib/shim-signed/mok/MOK.der \
    /lib/modules/$(uname -r)/kernel/drivers/net/r8168.ko
  1. initramfsを更新してください。
sudo update-initramfs -u

はい、ドライバパッケージマネージャがDKMSシステムを使用するようにパッケージを更新すると、自動化される可能性があります。

おすすめ記事