デスクトップとして使う(15)evdev ?

Debian LS-VL

まるしすなうぇぶろぐ(仮): 玄柴/ディスプレイの接続で 紹介いただいている手順を参考に、LinkStation LS-VL でも X が動いたのだが、
マウスとキーボードをつないでみたものの、うんともすんとも。
いろいろ試行錯誤しているのだが、先が見えない状態。

次に見つけたのは、 squeeze で、X が入力を受け付けなくなる問題(解決)

カーネルオプション CONFIG_INPUT_EVDEV を有効にしなければならない とのこと。

CONFIG_INPUT_EVDEV は?

yasunari@vl:/usr/src/linux-2.6.31.8$ grep CONFIG_INPUT_EVDEV .config
# CONFIG_INPUT_EVDEV is not set
yasunari@vl:/usr/src/linux-2.6.31.8$
ない。

カスタマイズ

yasunari@vl:/usr/src/linux-2.6.31.8$ mv .config{,.120313}
yasunari@vl:/usr/src/linux-2.6.31.8$ cp .config.120313 .config
yasunari@vl:/usr/src/linux-2.6.31.8$ make menuconfig
	:
見つからない。
CONFIG_INPUT_EVDEV ってどこでセットするの?
yasunari@vl:/usr/src/linux-2.6.31.8$ less drivers/input/Kconfig
	:
	:
config INPUT_EVDEV
        tristate "Event interface"
        help
          Say Y here if you want your input device events be accessible
          under char device 13:64+ - /dev/input/eventX in a generic way.

          To compile this driver as a module, choose M here: the
          module will be called evdev.
Event interface をセットすれば良いようだ。

Device Drivers → Input device support に見つけた

 .config - Linux Kernel v2.6.31.8 Configuration
 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
  lqqqqqqqqqqqqqqqqqqqqqqqqq Input device support qqqqqqqqqqqqqqqqqqqqqqqqqqk
  x  Arrow keys navigate the menu.  <Enter> selects submenus --->.          x
  x  Highlighted letters are hotkeys.  Pressing <Y> includes, <N> excludes, x
  x  <M> modularizes features.  Press <Esc><Esc> to exit, <?> for Help, </> x
  x  for Search.  Legend: [*] built-in  [ ] excluded  <M> module  < >       x
  x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
  x x    -*- Generic input layer (needed for keyboard, mouse, ...)        x x
  x x    < >   Support for memoryless force-feedback devices              x x
  x x    < >   Polled input device skeleton                               x x
  x x          *** Userland interfaces ***                                x x
  x x    -*-   Mouse interface                                            x x
  x x    [ ]     Provide legacy /dev/psaux device                         x x
  x x    (1024)  Horizontal screen resolution                             x x
  x x    (768)   Vertical screen resolution                               x x
  x x    < >   Joystick interface                                         x x
  x x    < >   Event interface                                            x x
  x x    < >   Event debugging                                            x x
  x x          *** Input Device Drivers ***                               x x
  x x    [ ]   Keyboards  --->                                            x x
  x x    [ ]   Mice  --->                                                 x x
  x x    [ ]   Joysticks/Gamepads  --->                                   x x
  x x    [ ]   Tablets  --->                                              x x
  x x    [ ]   Touchscreens  --->                                         x x
  x x    [ ]   Miscellaneous devices  --->                                x x
  x x        Hardware I/O ports  --->                                     x x
  x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj x
  tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
  x                    <Select>    < Exit >    < Help >                     x
  mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

モジュールにせずに組み込みにする。
yasunari@vl:/mnt/src/linux-2.6.31.8$ diff -u .config_120313 .config
--- .config_120313      2012-03-13 21:14:33.924024660 +0900
+++ .config     2012-03-17 19:14:42.818906927 +0900
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.31.8
-# Tue Mar 13 21:14:33 2012
+# Sat Mar 17 19:14:42 2012
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -960,7 +960,7 @@
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_EVDEV is not set
+CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_EVBUG is not set

 #
yasunari@vl:/mnt/src/linux-2.6.31.8$

ビルド

スクリプトを作った
yasunari@vl:/usr/src/linux-2.6.31.8$ cat ../build.sh
make uImage
make modules
sudo rm /boot/uImage.buffalo
sudo cp arch/arm/boot/uImage /boot/uImage.buffalo
sudo make modules_install
yasunari@vl:/usr/src/linux-2.6.31.8$
実行する
yasunari@vl:/usr/src/linux-2.6.31.8$ sh ../build.sh
scripts/kconfig/conf -s arch/arm/Kconfig
  CHK     include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
  CHK     include/linux/utsrelease.h
	:
	:
  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready
  UIMAGE  arch/arm/boot/uImage
Image Name:   Linux-2.6.31.8
Created:      Sat Mar 17 22:01:06 2012
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    2782424 Bytes = 2717.21 kB = 2.65 MB
Load Address: 0x00008000
Entry Point:  0x00008000
  Image arch/arm/boot/uImage is ready
  CHK     include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-arm	:
	:
	:
  Building modules, stage 2.
  MODPOST 108 modules
[sudo] password for yasunari:
  INSTALL crypto/authenc.ko
  INSTALL crypto/ecb.ko
	:
	:
  INSTALL net/ipv4/xfrm4_tunnel.ko
  INSTALL net/xfrm/xfrm_ipcomp.ko
  INSTALL net/xfrm/xfrm_user.ko
  DEPMOD  2.6.31.8
yasunari@vl:/mnt/src/linux-2.6.31.8$

再起動

yasunari@vl:/usr/src/linux-2.6.31.8$ sudo reboot

デバイスの認識

HUB を刺す
yasunari@vl:~$ tail -f /var/log/messages
	:
	:
Mar 17 22:04:48 vl kernel: usb 1-1: new high speed USB device using ehci_marvell and address 2
Mar 17 22:04:48 vl kernel: usb 1-1: configuration #1 chosen from 1 choice
Mar 17 22:04:48 vl kernel: hub 1-1:1.0: USB hub found
Mar 17 22:04:48 vl kernel: hub 1-1:1.0: 4 ports detected
GX-DVI/U2B を刺す
Mar 17 22:05:55 vl kernel: usb 1-1.1: new high speed USB device using ehci_marvell and address 3
Mar 17 22:05:55 vl kernel: usb 1-1.1: configuration #1 chosen from 1 choice
Mar 17 22:05:55 vl kernel: udlfb: DisplayLink GX-DVI_U2B - serial #201210913457
Mar 17 22:05:55 vl kernel: udlfb: vid_17e9&pid_0223&rev_0106 driver's dlfb_data struct at c8f53000
Mar 17 22:05:55 vl kernel: udlfb: console enable=1
Mar 17 22:05:55 vl kernel: udlfb: fb_defio enable=1
Mar 17 22:05:55 vl kernel: udlfb: shadow enable=1
Mar 17 22:05:55 vl kernel: udlfb: vendor descriptor length:1b data:1b 5f 01 0019 05 00 01 03 00 04
Mar 17 22:05:55 vl kernel: udlfb: udlfb: DL chip limited to 2080000 pixel modes
Mar 17 22:05:55 vl kernel: udlfb: allocated 4 65024 byte urbs
Mar 17 22:05:55 vl kernel: usbcore: registered new interface driver udlfb
Mar 17 22:05:55 vl kernel:      Display is GTF capable
Mar 17 22:05:55 vl kernel: udlfb: 1440x900 valid mode
Mar 17 22:05:55 vl kernel: udlfb: 720x400 valid mode
Mar 17 22:05:55 vl kernel: udlfb: 640x480 valid mode
Mar 17 22:05:55 vl kernel: udlfb: 640x480 valid mode
Mar 17 22:05:55 vl kernel: udlfb: 800x600 valid mode
Mar 17 22:05:55 vl kernel: udlfb: 800x600 valid mode
Mar 17 22:05:55 vl kernel: udlfb: 1024x768 valid mode
Mar 17 22:05:55 vl kernel: udlfb: 1024x768 valid mode
Mar 17 22:05:55 vl kernel: udlfb: 1024x768 valid mode
Mar 17 22:05:55 vl kernel: udlfb: 1280x1024 valid mode
Mar 17 22:05:55 vl kernel: udlfb: 1280x1024 valid mode
Mar 17 22:05:55 vl kernel: udlfb: 1440x1440 valid mode
Mar 17 22:05:55 vl kernel: udlfb: udlfb: Reallocating framebuffer. Addresses will change!
Mar 17 22:05:55 vl kernel: udlfb: 1440x900 valid mode
Mar 17 22:05:55 vl kernel: udlfb: set_par mode 1440x900
Mar 17 22:05:55 vl kernel: udlfb: DisplayLink USB device /dev/fb0 attached. 1440x900 resolution. Using 5064K framebuffer memory
マウスを刺す
Mar 17 22:06:33 vl kernel: usb 1-1.2: new low speed USB device using ehci_marvell and address 4
Mar 17 22:06:33 vl kernel: usb 1-1.2: configuration #1 chosen from 1 choice
Mar 17 22:06:33 vl kernel: usbcore: registered new interface driver hiddev
Mar 17 22:06:33 vl kernel: input: Logitech Optical USB Mouse as /devices/platform/ehci_marvell.70059/usb1/1-1/1-1.2/1-1.2:1.0/input/input0
Mar 17 22:06:33 vl kernel: generic-usb 0003:046D:C016.0001: input: USB HID v1.10 Mouse [Logitech Optical USB Mouse] on usb-ehci_marvell.70059-1.2/input0
Mar 17 22:06:33 vl kernel: usbcore: registered new interface driver usbhid
Mar 17 22:06:33 vl kernel: usbhid: v2.6:USB HID core driver
キーボードを刺す
Mar 17 22:06:53 vl kernel: usb 1-1.3: new low speed USB device using ehci_marvell and address 5
Mar 17 22:06:53 vl kernel: usb 1-1.3: configuration #1 chosen from 1 choice
Mar 17 22:06:53 vl kernel: input: Sony FKP-U01 as /devices/platform/ehci_marvell.70059/usb1/1-1/1-1.3/1-1.3:1.0/input/input1
Mar 17 22:06:53 vl kernel: generic-usb 0003:054C:01A9.0002: input,hiddev96: USB HID v1.11 Keyboard [Sony FKP-U01] on usb-ehci_marvell.70059-1.3/input0
Mar 17 22:06:53 vl kernel: input: Sony FKP-U01 as /devices/platform/ehci_marvell.70059/usb1/1-1/1-1.3/1-1.3:1.1/input/input2
Mar 17 22:06:53 vl kernel: generic-usb 0003:054C:01A9.0003: input: USB HID v1.11 Mouse [Sony FKP-U01] on usb-ehci_marvell.70059-1.3/input1

順調。

X を起動する

yasunari@vl:~$ startx


X.Org X Server 1.7.7
Release Date: 2010-05-04
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.32 armv5tel Debian
Current Operating System: Linux vl 2.6.31.8 #12 Sat Mar 17 22:00:46 JST 2012 armv5tel
Kernel command line: console=ttyS0,115200 root=/dev/sda2 rw initrd=0x00800040,12M panic=5 BOOTVER=0.25
Build Date: 30 October 2011  09:07:45PM
xorg-server 2:1.7.7-14 (Julien Cristau )
Current version of pixman: 0.16.4
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sat Mar 17 22:07:18 2012
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
SELinux: Disabled on system, not enabling in X server
(EE) Sony FKP-U01: failed to initialize for relative axes.

これでマウス、キーボードは動くか?

マウスを動かしてみた。It works!。
見事にマウスカーソルが動いた!

キーボードを叩いてみた!

きたー!



LS-VL

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


デスクトップとして使う(14)デバイスファイルはある?
ハックの記録
LinkStation/玄箱 をハックしよう

標準ファームの HDD の中身(4)散歩

ツイート Tweet to @yasunari_y @yasunari_yをフォロー

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