
Ubuntu日本語フォーラム
ログインしていません。
Fujitsuの海外向け"LifeBook"用に開発された,
カーネルモジュール'apanel.ko'を使用したくて,コンパイルに挑戦しています.
'apanel.ko'は, LifeBook/FMV-BIBLOシリーズが,キーボード以外に備える
"Application"/"Disc Player"ボタンを利用するためのデバイスドライバです.
Lenobo/IBM ThinkPadのアプリケーションボタンや, SONY/VAIOのそれと
同じ役割を果たすものです.
ソースの入手はここ,
"Fujitsu lifebook application panel"
http://apanel.sourceforge.net/
最新版はこちら,
"apanel-linux-1.4.tar.gz"(2005/10/31 00:01)
http://sourceforge.net/project/showfiles.php?group_id=75115
カーネルソースを導入して,付属ドキュメントに沿って準備して,コンパイルすると
エラーが出てしまいます.
$ make KERNEL_SOURCE=/lib/modules/`uname -r`/build
make -C /lib/modules/2.6.17-12-generic/build SUBDIRS=`pwd` modules
make[1]: ディレクトリ `/usr/src/linux-headers-2.6.17-12-generic' に入ります
CC [M] /xxx/apanel-linux-1.4/linux/apanel.o
/xxx/apanel-linux-1.4/linux/apanel.c:89: error: unknown field ‘owner’ specified in initializer
/xxx/apanel-linux-1.4/linux/apanel.c:89: warning: initialization makes integer from pointer without a cast
/xxx/apanel-linux-1.4/linux/apanel.c:91: error: unknown field ‘name’ specified in initializer
/xxx/apanel-linux-1.4/linux/apanel.c:91: warning: initialization makes integer from pointer without a cast
/xxx/apanel-linux-1.4/linux/apanel.c:93: error: unknown field ‘flags’ specified in initializer
/xxx/apanel-linux-1.4/linux/apanel.c:93: error: ‘I2C_DF_NOTIFY’ undeclared here (not in a function)
/xxx/apanel-linux-1.4/linux/apanel.c: In function ‘apanel_attach’:
/xxx/apanel-linux-1.4/linux/apanel.c:604: error: ‘struct i2c_algorithm’ has no member named ‘id’
/xxx/apanel-linux-1.4/linux/apanel.c:604: error: ‘I2C_ALGO_SMBUS’ undeclared (first use in this function)
/xxx/apanel-linux-1.4/linux/apanel.c:604: error: (Each undeclared identifier is reported only once
/xxx/apanel-linux-1.4/linux/apanel.c:604: error: for each function it appears in.)
make[2]: *** [/xxx/apanel-linux-1.4/linux/apanel.o] エラー 1
make[1]: *** [_module_/xxx/apanel-linux-1.4/linux] エラー 2
make[1]: ディレクトリ `/usr/src/linux-headers-2.6.17-12-generic' から出ます
make: *** [default] エラー 2
$
"apanel.c"の89行目をみると,こんな感じです.
84: /* this structur defines the interface to the i2c sub-system */
85: static struct i2c_driver apanel_driver = {
86:
87: /* again this actually depends on the i2c version, not the kernel ... */
88: #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
89: .owner = THIS_MODULE,
90: #endif
91: .name = "Fujitsu Application Panel" ,
92: .id = 0,
93: .flags = I2C_DF_NOTIFY,
94: .attach_adapter = &apanel_attach,
95: .detach_client = &apanel_detach,
96: .command = NULL,
97: };
'owner' の定義がどうとか言われてますけれど,ソースでは,ここで定義をしている
感じなので, コンパイルスイッチか何かで,チェックを緩めてやる必要があるのかも知れません.
念のため,Ubuntu6.10と,Vine4.2の両方でやってみて,まったく同じ状態になっています.
まだ調査中なのですが,これはこうした方が良いという情報があれば是非お聞かせ下さい.
"apanel"もう使っているよ〜という情報でも良いです(笑)
よろしくお願いいたします.
オフライン
i2c_driver構造体が見えてない(or想定してるバージョンが違う)感じです。
Makefileの引数に -I /usr/src/linux-headers-2.6.17-12-generic/include/linux/ を
足すとどうなるでしょう?
オフライン
さっそくレスポンスありがとうございます.
恥ずかしいのですが, make への引数の与え方が判らなかったので,
現在のものの後と前に入れてみました.
結果は変わらないみたいです.
$ make KERNEL_SOURCE=/lib/modules/`uname -r`/build -I /usr/src/linux-headers-2.6.17-12-generic/include/linux/
make -C /lib/modules/2.6.17-12-generic/build SUBDIRS=`pwd` modules
make[1]: ディレクトリ `/usr/src/linux-headers-2.6.17-12-generic' に入ります
CC [M] /xxx/apanel-linux-1.4/linux/apanel.o
/xxx/apanel-linux-1.4/linux/apanel.c:89: error: unknown field ‘owner’ specified in initializer
/xxx/apanel-linux-1.4/linux/apanel.c:89: warning: initialization makes integer from pointer without a cast
/xxx/apanel-linux-1.4/linux/apanel.c:91: error: unknown field ‘name’ specified in initializer
/xxx/apanel-linux-1.4/linux/apanel.c:91: warning: initialization makes integer from pointer without a cast
/xxx/apanel-linux-1.4/linux/apanel.c:93: error: unknown field ‘flags’ specified in initializer
/xxx/apanel-linux-1.4/linux/apanel.c:93: error: ‘I2C_DF_NOTIFY’ undeclared here (not in a function)
/xxx/apanel-linux-1.4/linux/apanel.c: In function ‘apanel_attach’:
/xxx/apanel-linux-1.4/linux/apanel.c:604: error: ‘struct i2c_algorithm’ has no member named ‘id’
/xxx/apanel-linux-1.4/linux/apanel.c:604: error: ‘I2C_ALGO_SMBUS’ undeclared (first use in this function)
/xxx/apanel-linux-1.4/linux/apanel.c:604: error: (Each undeclared identifier is reported only once
/xxx/apanel-linux-1.4/linux/apanel.c:604: error: for each function it appears in.)
make[2]: *** [/xxx/apanel-linux-1.4/linux/apanel.o] エラー 1
make[1]: *** [_module_/xxx/apanel-linux-1.4/linux] エラー 2
make[1]: ディレクトリ `/usr/src/linux-headers-2.6.17-12-generic' から出ます
make: *** [default] エラー 2
$ make -I /usr/src/linux-headers-2.6.17-12-generic/include/linux/ KERNEL_SOURCE=/lib/modules/`uname -r`/build
make -C /lib/modules/2.6.17-12-generic/build SUBDIRS=`pwd` modules
make[1]: ディレクトリ `/usr/src/linux-headers-2.6.17-12-generic' に入ります
CC [M] /xxx/apanel-linux-1.4/linux/apanel.o
/xxx/apanel-linux-1.4/linux/apanel.c:89: error: unknown field ‘owner’ specified in initializer
/xxx/apanel-linux-1.4/linux/apanel.c:89: warning: initialization makes integer from pointer without a cast
/xxx/apanel-linux-1.4/linux/apanel.c:91: error: unknown field ‘name’ specified in initializer
/xxx/apanel-linux-1.4/linux/apanel.c:91: warning: initialization makes integer from pointer without a cast
/xxx/apanel-linux-1.4/linux/apanel.c:93: error: unknown field ‘flags’ specified in initializer
/xxx/apanel-linux-1.4/linux/apanel.c:93: error: ‘I2C_DF_NOTIFY’ undeclared here (not in a function)
/xxx/apanel-linux-1.4/linux/apanel.c: In function ‘apanel_attach’:
/xxx/apanel-linux-1.4/linux/apanel.c:604: error: ‘struct i2c_algorithm’ has no member named ‘id’
/xxx/apanel-linux-1.4/linux/apanel.c:604: error: ‘I2C_ALGO_SMBUS’ undeclared (first use in this function)
/xxx/apanel-linux-1.4/linux/apanel.c:604: error: (Each undeclared identifier is reported only once
/xxx/apanel-linux-1.4/linux/apanel.c:604: error: for each function it appears in.)
make[2]: *** [/xxx/apanel-linux-1.4/linux/apanel.o] エラー 1
make[1]: *** [_module_/xxx/apanel-linux-1.4/linux] エラー 2
make[1]: ディレクトリ `/usr/src/linux-headers-2.6.17-12-generic' から出ます
make: *** [default] エラー 2
現在の"KERNEL_SOURCE=..."の部分を取り除くのも試してみました.
$ make -I /usr/src/linux-headers-2.6.17-12-generic/include/linux/
make -C SUBDIRS=`pwd` modules
make: *** SUBDIRS=/xxx/apanel-linux-1.4/linux: No such file or directory. 中止.
make: *** [default] エラー 2
これもダメかぁ.
"Makefile"の中身もあげときます.
obj-m += apanel.o
default:
make -C ${KERNEL_SOURCE} SUBDIRS=`pwd` modules
こんだけ?ってくらいシンプルです.
"apanel.c" のヘッダインクルード部分も,
#include <linux/kernel.h> /* we just need that */
#include <linux/module.h> /* in case we're compiled as module */
#include <linux/fs.h> /* struct file_operations */
#include <linux/ioport.h> /* iomem_resource and stuff */
#include <asm/page.h> /* __va macro */
#include <linux/miscdevice.h> /* struct miscdevice */
#include <linux/i2c.h> /* i2c interface */
#include <linux/version.h> /* KERNEL_VERSION macro */
"KERNEL_SOURCE=..."で与えているパスの直下には無いので,
<include/linux/kernel.h>とか書き換えてみたりしましたが,
$ make KERNEL_SOURCE=/lib/modules/`uname -r`/build
make -C /lib/modules/2.6.17-12-generic/build SUBDIRS=`pwd` modules
make[1]: ディレクトリ `/usr/src/linux-headers-2.6.17-12-generic' に入ります
CC [M] /xxx/apanel-linux-1.4/linux/apanel.o
/xxx/apanel-linux-1.4/linux/apanel.c:20:58: error: include/linux/kernel.h: No such file or directory
/xxx/apanel-linux-1.4/linux/apanel.c:21:73: error: include/linux/module.h: No such file or directory
/xxx/apanel-linux-1.4/linux/apanel.c:22:60: error: include/linux/fs.h: No such file or directory
/xxx/apanel-linux-1.4/linux/apanel.c:23:65: error: include/linux/ioport.h: No such file or directory
/xxx/apanel-linux-1.4/linux/apanel.c:24:48: error: include/asm/page.h: No such file or directory
/xxx/apanel-linux-1.4/linux/apanel.c:25:62: error: include/linux/miscdevice.h: No such file or directory
/xxx/apanel-linux-1.4/linux/apanel.c:26:52: error: include/linux/i2c.h: No such file or directory
/xxx/apanel-linux-1.4/linux/apanel.c:27:62: error: include/linux/version.h: No such file or directory
<以下略>(インクルードに失敗してるのでエラーが延々続きます)
<include/...>と付け加えると, ファイルが見付からないエラーが出てしまうので,
ヘッダのインクルードは, 元のままでうまく行ってるみたいです.
と,いうことは, "想定しているバージョンが違う" の方かも知れませんね.
ヘッダの方も読んでみます.
最後の編集者: youre (2008-02-28 09:54:58)
オフライン
他にも同様のプロジェクトがないか調べてみました.
Infoseek で "apanel lifebook"をキーワードにして検索しています.
引っかかってくるのは,海外の情報が多いです.
"[PATCH -mm] apanel: fix kconfig dependencies"
http://www.gossamer-threads.com/lists/linux/kernel/875536
投稿日付が,"Feb 6, 2008, 4:27 PM" まだ地味に改良が進んでいるみたいです.
まったく別のプロジェクトもあるみたいです.
"fjpanel"
"Fujitsu-Siemens application panel Linux driver"
http://code.google.com/p/fjpanel/
こっちは, 2007/05頃のコードです.
"fjpanel"を一応ダウンロードしてコンパイルすると〜するっと出来てしまいましたorz
件のコード部分は, 'owner' の部分が無いみたいです.
"apanel"のソースで"#if()〜#endif"で囲ってあるコードを外すといけるのかも知れません.
あとで試してみます.
追伸 :
コメントアウトするとそのまま進みますが,同じstractセクションの"name"でまた止まってしまいます.
デバイスドライバの作成情報のあるWebサイトをながめていくと, "owner"もデバイスドライバの
管理動作上必要となる情報の様なので, 元に戻して置きます.
他の解決方法を更に探ってみます.
更に追伸です.
以下に気になることが書かれてました.
"らくがき"
(hiroさん GLANTANK用Linuxをメンテされてる方みたいですね.)
http://www.wildtree.jp/~araki/rakugaki/2006/05/2616178.html
2006年5月23日 11:47
> 2.6.15と2.6.16とではI2CデバイスドライバとカーネルとのIFが変更になっています。
> 具体的には、i2c_driverとi2c_clientの二つが変わっています。
> より標準のドライバIFに近づけたというか、そんな感じの修正が入っています。
> なのでdrivers/i2c/chips/rs5c372.cを修正しなければなりません。
>
> 具体的には、i2c_client.flags が廃止になり、i2cdriver.ownerとi2cdriver.flagsも廃止です。
> なのでこれらに関するコード(初期化部分を含めて)は削除しなければなりません。
> また、i2cdriver.nameはi2cdriver.driverが追加されたことによって、そっちの中に移動になっています。
"apanel.c" が, 2005/10/31 日付なので, 2006/05/23 日付で言われている変更が
盛りこまれていないのは確かです. 他にドキュメントが無いのなら, i2c周りのソースを
読むしか無いということみたいですね〜orz
と,いうことで,しばらく自力で探るとこになりました.
並行して探ってくれる方がいらっしゃいましたら〜
i2c周りは任せとけ!って方もいらっしゃいましたら〜
御意見下さい〜 m(_ _)m よろしくお願い致します.
追加 (2008/03/04 13:00)
kernel 2.6.14と2.6.15か16あたりで, i2c_driver 構造体 の内容が大きく書き換えられた様子です.
上記でダウンロードできるapanel-1.4は, 2.6.14までのi2cに対応するものの様です.
キーワードを"fujitsu apanel patch"としてAltavistaで検索すると, 昨年末ぐらいから盛んにパッチが
作られています. 下記はメーリングリストのアーカイブらしいのですが, どうも, 2.6カーネルへマージする
予定で動いているひとがいるみたいです. 2.6.25-rc1とかあるので, 次のリリースに含まれるのかも
知れませんね.
http://www.gossamer-threads.com/lists/engine?do=search_results;search_forum_id=1;search_string=apanel;forum_id=1;search_user_username=;search_user_id=;search_time=;search_forum_type=forum;search_forum=forum_1;search_fields=sb;search_type=AND;page=2;sb=post_time;so=DESC;mh=25;list=linux
しばらく静観してた方が良さそうです.
最後の編集者: youre (2008-03-04 13:02:52)
オフライン