0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Linux Kernel 6.15 をビルドしたら v4l2loopback 0.13.2 の dkms がビルドエラーになったので対処した話

Last updated at Posted at 2025-06-04

以前も似たようなことがありました👀

Ubuntu 25.04 で Linux Kernel 6.15 をビルドしたら v4l2loopback-dkms のビルドに失敗した

概要

  • Ubuntuを利用している
  • 最新のカーネルを自前でビルドしてインストールしている
  • v4l2loopbackをdkmsで利用している
    • Ubuntu 25.04でのaptでインストールされるバージョンは0.13.2

という場合にLinux Kernel 6.15をインストールした際にdkmsのビルドがエラーになった件の調査と対応になります

原因

  • Linux Kernel 6.15で del_timer_sync() 関数がなくなった
    • 以前から廃止の方向だったが互換性維持のために存続していたものが消えた
    • Linux 6.2から timer_delete_sync() という関数が作られている
  • v4l2loopback.cで該当の関数を利用している

対応

  • del_timer_sync()timer_delete_sync() で置き換える

Kernelのソースを見るとインターフェースは同じだったので単純に関数名だけ置換しましょう

diff

--- v4l2loopback.c.orig 2024-09-02 19:26:32.000000000 +0900
+++ v4l2loopback.c      2025-05-27 09:14:05.160959374 +0900
@@ -1683,8 +1683,8 @@ static int vidioc_querybuf(struct file *
 static void buffer_written(struct v4l2_loopback_device *dev,
                           struct v4l2l_buffer *buf)
 {
-       del_timer_sync(&dev->sustain_timer);
-       del_timer_sync(&dev->timeout_timer);
+       timer_delete_sync(&dev->sustain_timer);
+       timer_delete_sync(&dev->timeout_timer);
 
        spin_lock_bh(&dev->list_lock);
        list_move_tail(&buf->list_head, &dev->outbufs_list);
@@ -2261,8 +2261,8 @@ static int v4l2_loopback_close(struct fi
 
        atomic_dec(&dev->open_count);
        if (dev->open_count.counter == 0) {
-               del_timer_sync(&dev->sustain_timer);
-               del_timer_sync(&dev->timeout_timer);
+               timer_delete_sync(&dev->sustain_timer);
+               timer_delete_sync(&dev->timeout_timer);
        }
        try_free_buffers(dev);

ちなみにGitHub上の最新版では timer_delete_sync() を利用した上でKernelのバージョンが6.2未満では del_timer_sync に置き換えるマクロが定義されておりました

後処理

ソースを修正したら sudo dkms autoinstall を実行し、v4l2loopbackをビルドしましょう


それでは良いLinuxライフw

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?