デスクトップとして使う(6)udlfb の更新

Debian LS-VL

まるしすなうぇぶろぐ(仮): 玄柴/ディスプレイの接続 で 紹介いただいている手順で LinkStation LS-VL でも GX-DVI/U2B が認識できたので、 X をインストールしたが、案の定 X は起動しなかった。

udlfb を更新する

git のインストール

root@vl:~# apt-get install git-core
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  ca-certificates git libcurl3-gnutls liberror-perl openssh-blacklist openssh-blacklist-extra openssh-client openssl
  rsync
Suggested packages:
  git-doc git-arch git-cvs git-svn git-email git-daemon-run git-gui gitk gitweb ssh-askpass libpam-ssh keychain
  openssh-server
Recommended packages:
  ssh-client
The following NEW packages will be installed:
  ca-certificates git git-core libcurl3-gnutls liberror-perl openssh-blacklist openssh-blacklist-extra openssh-client
  openssl rsync
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 11.8 MB of archives.
After this operation, 25.0 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
	:
	:
140 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d....done.
Setting up libcurl3-gnutls (7.21.0-2.1+squeeze1) ...
Setting up liberror-perl (0.17-1) ...
Setting up git (1:1.7.2.5-3) ...
Setting up git-core (1:1.7.2.5-3) ...
Setting up rsync (3.0.7-2) ...
update-rc.d: using dependency based boot sequencing
!root@vl:~# exit
logout
yasunari@vl:~$

最新版の udlfb のソースの取得

yasunari@vl:~$ cd /mnt/src/
yasunari@vl:/mnt/src$ git clone http://git.plugable.com/webdav/udlfb
Cloning into udlfb...
yasunari@vl:/mnt/src$

最新版の udlfb のコンパイル

yasunari@vl:/mnt/src$ cd udlfb/
yasunari@vl:/mnt/src/udlfb$ make
make -C /lib/modules/`uname -r`/build SUBDIRS=/mnt/src/udlfb modules
make[1]: Entering directory `/mnt/src/linux-2.6.31.8'
  CC [M]  /mnt/src/udlfb/udlfb.o
/mnt/src/udlfb/udlfb.c:87:2: warning: #warning CONFIG_FB_DEFERRED_IO kernel support required for fb_defio mmap support
/mnt/src/udlfb/udlfb.c:91:2: warning: #warning CONFIG_FB_SYS_IMAGEBLIT kernel support required for fb console
/mnt/src/udlfb/udlfb.c:95:2: warning: #warning FB_SYS_FOPS kernel support required for filesystem char dev access
/mnt/src/udlfb/udlfb.c:99:2: warning: #warning CONFIG_FB_MODE_HELPERS required. Expect build break
/mnt/src/udlfb/udlfb.c: In function 'dlfb_usb_disconnect':
/mnt/src/udlfb/udlfb.c:1829: error: implicit declaration of function 'unlink_framebuffer'
make[2]: *** [/mnt/src/udlfb/udlfb.o] Error 1
make[1]: *** [_module_/mnt/src/udlfb] Error 2
make[1]: Leaving directory `/mnt/src/linux-2.6.31.8'
make: *** [all] Error 2
yasunari@vl:/mnt/src/udlfb$
もー、次から次から。楽しー

ソースの修正

ソースの該当部分を見ると、、、
                /* it's safe to uncomment next line if your kernel
                   doesn't yet have this function exported */
                unlink_framebuffer(info);
コメントアウトすることを uncomment というの?逆ちゃう?
ということで、コメントアウトする。
yasunari@vl:/mnt/src/udlfb$ mv udlfb.c{,.orig}
yasunari@vl:/mnt/src/udlfb$ cp udlfb.c.orig udlfb.c
yasunari@vl:/mnt/src/udlfb$ vi udlfb.c
	:
	:
yasunari@vl:/mnt/src/udlfb$ diff -u udlfb.c.orig udlfb.c
--- udlfb.c.orig        2012-03-11 00:02:37.394765141 +0900
+++ udlfb.c     2012-03-11 00:28:56.326017677 +0900
@@ -1826,7 +1826,7 @@

                /* it's safe to uncomment next line if your kernel
                   doesn't yet have this function exported */
-               unlink_framebuffer(info);
+               /* unlink_framebuffer(info); */
        }

        usb_set_intfdata(interface, NULL);
yasunari@vl:/mnt/src/udlfb$

もう一度 make

yasunari@vl:/mnt/src/udlfb$ make
make -C /lib/modules/`uname -r`/build SUBDIRS=/mnt/src/udlfb modules
make[1]: Entering directory `/mnt/src/linux-2.6.31.8'
  CC [M]  /mnt/src/udlfb/udlfb.o
/mnt/src/udlfb/udlfb.c:87:2: warning: #warning CONFIG_FB_DEFERRED_IO kernel support required for fb_defio mmap support
/mnt/src/udlfb/udlfb.c:91:2: warning: #warning CONFIG_FB_SYS_IMAGEBLIT kernel support required for fb console
/mnt/src/udlfb/udlfb.c:95:2: warning: #warning FB_SYS_FOPS kernel support required for filesystem char dev access
/mnt/src/udlfb/udlfb.c:99:2: warning: #warning CONFIG_FB_MODE_HELPERS required. Expect build break
/mnt/src/udlfb/udlfb.c: In function 'dlfb_ops_write':
/mnt/src/udlfb/udlfb.c:700: warning: 'result' is used uninitialized in this function
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "vesa_modes" [/mnt/src/udlfb/udlfb.ko] undefined!
  CC      /mnt/src/udlfb/udlfb.mod.o
  LD [M]  /mnt/src/udlfb/udlfb.ko
make[1]: Leaving directory `/mnt/src/linux-2.6.31.8'
yasunari@vl:/mnt/src/udlfb$
warning は一杯あるものの、、、できた。

モジュールのインストール

yasunari@vl:/mnt/src/udlfb$ su
Password:
root@vl:/mnt/src/udlfb# modprobe -r udlfb
root@vl:/mnt/src/udlfb# make install
make -C /lib/modules/`uname -r`/build SUBDIRS=/mnt/src/udlfb modules_install
make[1]: Entering directory `/mnt/src/linux-2.6.31.8'
  INSTALL /mnt/src/udlfb/udlfb.ko
  DEPMOD  2.6.31.8
make[1]: Leaving directory `/mnt/src/linux-2.6.31.8'
root@vl:/mnt/src/udlfb# modprobe udlfb
FATAL: Error inserting udlfb (/lib/modules/2.6.31.8/updates/udlfb.ko): Unknown symbol in module, or unknown parameter (see dmesg)
root@vl:/mnt/src/udlfb#
ふがー。つぎからつぎから

dmesg を見る

root@vl:/mnt/src/udlfb# dmesg| tail
	:
	:
usbcore: deregistering interface driver udlfb
udlfb: Unknown symbol vesa_modes
root@vl:/mnt/src/udlfb#
vesa_modes って、、、どこかで見たような。。。

エラー探し

root@vl:/mnt/src/udlfb# exit
exit
yasunari@vl:/mnt/src/udlfb$ cd ../linux-2.6.31.8
yasunari@vl:/mnt/src/linux-2.6.31.8$ cd drivers/video/
yasunari@vl:/mnt/src/linux-2.6.31.8/drivers/video$ grep vesa_modes *
fbmon.c:                mode[num++] = vesa_modes[3];
fbmon.c:                mode[num++] = vesa_modes[4];
fbmon.c:                mode[num++] = vesa_modes[5];
fbmon.c:                mode[num++] = vesa_modes[7];
fbmon.c:                mode[num++] = vesa_modes[8];
fbmon.c:                mode[num++] = vesa_modes[9];
fbmon.c:                mode[num++] = vesa_modes[10];
fbmon.c:                mode[num++] = vesa_modes[12];
fbmon.c:                mode[num++] = vesa_modes[13];
fbmon.c:                mode[num++] = vesa_modes[14];
fbmon.c:                mode[num++] = vesa_modes[15];
fbmon.c:                mode[num++] = vesa_modes[21];
fbmon.c:                mode[num++] = vesa_modes[17];
fbmon.c:                if (vesa_modes[i].xres == xres &&
fbmon.c:                    vesa_modes[i].yres == yres &&
fbmon.c:                    vesa_modes[i].refresh == refresh) {
fbmon.c:                        *mode = vesa_modes[i];
modedb.c:const struct fb_videomode vesa_modes[] = {
modedb.c:EXPORT_SYMBOL(vesa_modes);
neofb.c:                memcpy(info->monspecs.modedb, &vesa_modes[3], sizeof(struct fb_videomode));
neofb.c:                        memcpy(info->monspecs.modedb, &vesa_modes[8], sizeof(struct fb_videomode));
neofb.c:                memcpy(info->monspecs.modedb, &vesa_modes[13], sizeof(struct fb_videomode));
neofb.c:                memcpy(info->monspecs.modedb, &vesa_modes[20], sizeof(struct fb_videomode));
neofb.c:                memcpy(info->monspecs.modedb, &vesa_modes[3], sizeof(struct fb_videomode));
uvesafb.c:                                              &vesa_modes[i], info))
uvesafb.c:                      fb_add_videomode(&vesa_modes[i], &info->modelist);
yasunari@vl:/mnt/src/linux-2.6.31.8/drivers/video$
modedb.c を見る。
yasunari@vl:/mnt/src/linux-2.6.31.8/drivers/video$ less modedb.c
	:
	:
#ifdef CONFIG_FB_MODE_HELPERS
const struct fb_videomode vesa_modes[] = {
        /* 0 640x350-85 VESA */
        { NULL, 85, 640, 350, 31746,  96, 32, 60, 32, 64, 3,
	:
	:
CONFIG_FB_MODE_HELPERS が必要か、、

drivers/video/Kconfig によると、

	:
	:
config FB_MODE_HELPERS
        bool "Enable Video Mode Handling Helpers"
        depends on FB
        default n
        ---help---
          This enables functions for handling video modes using the
          Generalized Timing Formula and the EDID parser. A few drivers rely
          on this feature such as the radeonfb, rivafb, and the i810fb. If
          your driver does not take advantage of this feature, choosing Y will
          just increase the kernel size by about 5K.
	:
	:

とのこと。

カーネルの config のやり直しか、、、



LS-VL

楽天市場
Amazon
livedoor デパート
バッファローダイレクト
Yahoo!ショッピング


LS-QV1.0TL/1D 入手 / I got a LS-QV1.0TL/1D
ハックの記録
LinkStation/玄箱 をハックしよう

分解 / disassemble

Copyright (C) 2003-2012 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市