という組合せで,ipw3945.ko が compile できないという問題.つまり,
% sudo module-assistant build ipw3945-source
で,.deb ができないという問題.で,調べてみた.
/usr/src/modules/ipw3945/ipw3945.c: In function 'ipw_start_association': /usr/src/modules/ipw3945/ipw3945.c:4459: error: implicit declaration of function 'ieee80211_tx_frame'
という感じで remove ieee80211_tx_frame() という変更のため、文字通り ieee80211_tx_frame が無くなってしまったのが原因。
ということで
/usr/src/linux-source-2.6.25/net/ieee80211/ieee80211_tx.c
から
static struct ieee80211_txb *ieee80211_alloc_txb(...){...}
static int ieee80211_encrypt_fragment(...){...}
int ieee80211_tx_frame(...){...}
を ipw3945.c の適当な部分に copy。あと、
/usr/src/modules/ipw3945/Makefile
から
/usr/src/modules/ipw3945/snapshot/check_ieee80211_compat
という script で API の version を調べて -DIPW3945_COMPAT=1 とかしている(なってしまう)ようなので、
#if IPW3945_COMPAT >= 2 rc = ieee80211_tx_frame(priv->ieee, &priv->assoc_sequence_frame->u. frame, 0, priv->assoc_sequence_frame->len, 0); #else rc = ieee80211_tx_frame(priv->ieee, &priv->assoc_sequence_frame->u. frame, priv->assoc_sequence_frame-> len); #endif
の箇所で、引数の数がおかしいと言われてコケる。 ということで無理矢理 -DIPW3945_COMPAT=2 を渡す (Makefile を修正するか、check_ieee80211_compat で echo 2 する)。
以下、自分用メモ。
% cd /usr/src/modules/ipw3945/ % sudo make -f debian/rules KVERS=`uname -r` KSRC=/usr/src/linux-headers-`uname -r` KDREV=0.1 binary-modules
で原因を探る([myn:2007090900])。
[myn:2008051100]と同様でいける. procfs.c に対する patch は以下のようにしたほうがいいらしい.
diff -uwr vmnet-only.orig/procfs.c vmnet-only/procfs.c
--- vmnet-only.orig/procfs.c 2007-05-14 14:57:41.000000000 +0900
+++ vmnet-only/procfs.c 2008-05-13 13:35:25.000000000 +0900
@@ -63,7 +63,7 @@
{
int retval;
- retval = VNetProc_MakeEntry(&proc_root, "vmnet", S_IFDIR, &base);
+ retval = VNetProc_MakeEntry(NULL, "vmnet", S_IFDIR, &base);
if (retval) {
return retval;
}
@@ -95,7 +95,7 @@
void
VNetProc_Cleanup(void)
{
- VNetProc_RemoveEntry(base, &proc_root);
+ remove_proc_entry(base->name, NULL);
base = NULL;
}
VNetProc_RemoveEntry の 2つ目の引数が NULL だと, 別の意味に解釈されるので. これで /proc/vmnet/ が2つ出来てしまう(消えない)問題が解決.
vmware-any-any-update117 は <URL:http://download.rsbac.org/tmp/> にあるものを使う.
まず vmmon の comple でこける.
make: Entering directory `/tmp/vmware-config0/vmmon-only' make -C /usr/src/linux-headers-2.6.26-rc1-20080507-myn-01/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules make[1]: Entering directory `/usr/src/linux-headers-2.6.26-rc1-20080507-myn-01' CC [M] /tmp/vmware-config0/vmmon-only/linux/driver.o /tmp/vmware-config0/vmmon-only/linux/driver.c:171: error: unknown field 'nopage' specified in initializer /tmp/vmware-config0/vmmon-only/linux/driver.c:172: warning: initialization from incompatible pointer type /tmp/vmware-config0/vmmon-only/linux/driver.c:175: error: unknown field 'nopage' specified in initializer /tmp/vmware-config0/vmmon-only/linux/driver.c:176: warning: initialization from incompatible pointer type make[2]: *** [/tmp/vmware-config0/vmmon-only/linux/driver.o] Error 1 make[1]: *** [_module_/tmp/vmware-config0/vmmon-only] Error 2 make[1]: Leaving directory `/usr/src/linux-headers-2.6.26-rc1-20080507-myn-01' make: *** [vmmon.ko] Error 2 make: Leaving directory `/tmp/vmware-config0/vmmon-only' Unable to build the vmmon module.
これについては,
diff -uwr vmmon-only.orig/linux/driver.c vmmon-only/linux/driver.c
--- vmmon-only.orig/linux/driver.c 2007-11-28 19:59:26.000000000 +0900
+++ vmmon-only/linux/driver.c 2008-05-11 17:41:57.000000000 +0900
@@ -168,11 +168,9 @@
static void LinuxDriverPollTimeout(unsigned long clientData);
static struct vm_operations_struct vmuser_mops = {
- .nopage = LinuxDriverNoPage
};
struct vm_operations_struct vmuser_locked_mops = {
- .nopage = LinuxDriverLockedNoPage
};
static struct file_operations vmuser_fops;
とかで対応.include/linux/mm.h の struct vm_operations_struct から nopage が無くなったのは mm: remove nopage で,本当は mm: merge populate and nopage into fault (fixes nonlinear) で導入された fault を使わなければならないような気もする.
次に vmnet の comple でこける.
make: Entering directory `/tmp/vmware-config0/vmnet-only' make -C /usr/src/linux-headers-2.6.26-rc1-20080507-myn-01/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules make[1]: Entering directory `/usr/src/linux-headers-2.6.26-rc1-20080507-myn-01' CC [M] /tmp/vmware-config0/vmnet-only/driver.o CC [M] /tmp/vmware-config0/vmnet-only/hub.o CC [M] /tmp/vmware-config0/vmnet-only/userif.o CC [M] /tmp/vmware-config0/vmnet-only/netif.o CC [M] /tmp/vmware-config0/vmnet-only/bridge.o /tmp/vmware-config0/vmnet-only/bridge.c: In function 'VNetBridgeDevCompatible': /tmp/vmware-config0/vmnet-only/bridge.c:278: error: 'struct net_device' has no member named 'nd_net' /tmp/vmware-config0/vmnet-only/bridge.c:278: error: 'struct net_device' has no member named 'nd_net' /tmp/vmware-config0/vmnet-only/bridge.c: In function 'VNetBridgeUp': /tmp/vmware-config0/vmnet-only/bridge.c:905: error: 'struct net_device' has no member named 'nd_net' /tmp/vmware-config0/vmnet-only/bridge.c:943: error: 'struct net_device' has no member named 'nd_net' make[2]: *** [/tmp/vmware-config0/vmnet-only/bridge.o] Error 1 make[1]: *** [_module_/tmp/vmware-config0/vmnet-only] Error 2 make[1]: Leaving directory `/usr/src/linux-headers-2.6.26-rc1-20080507-myn-01' make: *** [vmnet.ko] Error 2 make: Leaving directory `/tmp/vmware-config0/vmnet-only' Unable to build the vmnet module.
これについては,[myn:2008041900] と同じ.次に以下.
make: Entering directory `/tmp/vmware-config0/vmnet-only' make -C /usr/src/linux-headers-2.6.26-rc1-20080507-myn-01/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules make[1]: Entering directory `/usr/src/linux-headers-2.6.26-rc1-20080507-myn-01' CC [M] /tmp/vmware-config0/vmnet-only/driver.o CC [M] /tmp/vmware-config0/vmnet-only/hub.o CC [M] /tmp/vmware-config0/vmnet-only/userif.o CC [M] /tmp/vmware-config0/vmnet-only/netif.o CC [M] /tmp/vmware-config0/vmnet-only/bridge.o CC [M] /tmp/vmware-config0/vmnet-only/filter.o CC [M] /tmp/vmware-config0/vmnet-only/procfs.o /tmp/vmware-config0/vmnet-only/procfs.c: In function 'VNetProc_Init': /tmp/vmware-config0/vmnet-only/procfs.c:66: error: 'proc_root' undeclared (first use in this function) /tmp/vmware-config0/vmnet-only/procfs.c:66: error: (Each undeclared identifier is reported only once /tmp/vmware-config0/vmnet-only/procfs.c:66: error: for each function it appears in.) /tmp/vmware-config0/vmnet-only/procfs.c: In function 'VNetProc_Cleanup': /tmp/vmware-config0/vmnet-only/procfs.c:98: error: 'proc_root' undeclared (first use in this function) make[2]: *** [/tmp/vmware-config0/vmnet-only/procfs.o] Error 1 make[1]: *** [_module_/tmp/vmware-config0/vmnet-only] Error 2 make[1]: Leaving directory `/usr/src/linux-headers-2.6.26-rc1-20080507-myn-01' make: *** [vmnet.ko] Error 2 make: Leaving directory `/tmp/vmware-config0/vmnet-only' Unable to build the vmnet module.
これは,include/linux/proc_fs.h から proc_root が無くなったのは proc: remove proc_root from drivers. 見た感じ NULL にしておけばいいらしい.ということで,以下のような感じに.
diff -uwr vmnet-only.orig/procfs.c vmnet-only/procfs.c
--- vmnet-only.orig/procfs.c 2007-05-14 14:57:41.000000000 +0900
+++ vmnet-only/procfs.c 2008-05-11 18:08:43.000000000 +0900
@@ -63,7 +63,7 @@
{
int retval;
- retval = VNetProc_MakeEntry(&proc_root, "vmnet", S_IFDIR, &base);
+ retval = VNetProc_MakeEntry(NULL, "vmnet", S_IFDIR, &base);
if (retval) {
return retval;
}
@@ -95,7 +95,7 @@
void
VNetProc_Cleanup(void)
{
- VNetProc_RemoveEntry(base, &proc_root);
+ VNetProc_RemoveEntry(base, NULL);
base = NULL;
}
がしかしただし,vmnet を組込む時に,
proc_dir_entry 'vmnet' already registered Pid: 10683, comm: insmod Tainted: P 2.6.26-rc1-20080507-myn-01 #1 [<c018abfd>] proc_register+0xf2/0x11d [<c018ad23>] create_proc_entry+0x6d/0x80 [<f8ae0dc1>] VNetProc_MakeEntry+0x18/0x28 [vmnet] [<f8ae0de7>] VNetProc_Init+0x16/0x1b [vmnet] [<f8add6f8>] init_module+0x7/0xce [vmnet] [<c013989e>] sys_init_module+0x157f/0x1716 [<c02587e2>] _write_unlock_irqrestore+0x0/0xa [<c0103816>] syscall_call+0x7/0xb =======================
とか怒られて,かつ実際,
% ls -ld /proc/vmnet* dr-xr-xr-x 2 root root 0 2008-05-11 18:10 /proc/vmnet/ dr-xr-xr-x 2 root root 0 2008-05-11 18:10 /proc/vmnet/
みたいな素敵なことになる(一応動く).
なんかメール転送先のサーバが数日止っていたので,qmail-qstat の結果結構 メールがたまっていて,まあしばらく放置していれば次第に届くのであるが, 一気に送ってしまう方法があるはず(sendmail の場合は sendmail -q)なので, 調べてみた.
[% man qmail-send] If qmail-send receives an ALRM signal, it will reschedule every message in the queue for immediate delivery.
とかいうことで,
% sudo kill -ALRM (qmail-send's pid)
ということらしい.
[myn:2008041800] の続き.Linux 2.6.25 の git の最新版にあげると,
/tmp/vmware-config0/vmnet-only/bridge.c: In function 'VNetBridgeDevCompatible': /tmp/vmware-config0/vmnet-only/bridge.c:278: error: 'struct net_device' has no member named 'nd_net' /tmp/vmware-config0/vmnet-only/bridge.c:278: error: 'struct net_device' has no member named 'nd_net' /tmp/vmware-config0/vmnet-only/bridge.c: In function 'VNetBridgeUp': /tmp/vmware-config0/vmnet-only/bridge.c:913: error: 'struct net_device' has no member named 'nd_net' /tmp/vmware-config0/vmnet-only/bridge.c:951: error: 'struct net_device' has no member named 'nd_net'
とか怒られる.これは,
[include/linux/netdevice.h]
#ifdef CONFIG_NET_NS
/* Network namespace this network device is inside */
struct net *nd_net;
#endif
とかになっていて CONFIG_NET_NS が設定されていないから. とはいえ CONFIG_NET_NS は !CONFIG_SYSFS でなければ設定不能 (ということで普通は設定されない).ということで,
[include/linux/netdevice.h]
/*
* Net namespace inlines
*/
static inline
struct net *dev_net(const struct net_device *dev)
{
#ifdef CONFIG_NET_NS
return dev->nd_net;
#else
return &init_net;
#endif
}
という method を使うことにする.
diff -ruw vmnet-only.orig/bridge.c vmnet-only/bridge.c
--- vmnet-only.orig/bridge.c 2007-11-28 19:25:06.000000000 +0900
+++ vmnet-only/bridge.c 2008-04-19 19:08:45.000000000 +0900
@@ -275,7 +275,7 @@
struct net_device *net) // IN: Network device
{
#ifdef VMW_NETDEV_HAS_NET
- if (net->nd_net != bridge->internalDev->nd_net) {
+ if (dev_net(net) != dev_net(bridge->internalDev)) {
return 0;
}
#endif
と,
diff -ruw vmnet-only.orig/vmnet-only/vmnetInt.h vmnet-only/vmnetInt.h
--- vmnet-only.orig/vmnet-only/vmnetInt.h 2007-11-28 19:25:06.000000000 +0900
+++ vmnet-only/vmnetInt.h 2008-04-20 23:09:00.000000000 +0900
@@ -63,7 +63,7 @@
# define dev_lock_list() read_lock(&dev_base_lock)
# define dev_unlock_list() read_unlock(&dev_base_lock)
# ifdef VMW_NETDEV_HAS_NET
-# define DEV_GET(x) __dev_get_by_name((x)->internalDev->nd_net, (x)->name)
+# define DEV_GET(x) __dev_get_by_name((dev_net((x)->internalDev)), (x)->name)
# else
# define DEV_GET(x) __dev_get_by_name((x)->name)
# endif
@@ -85,7 +85,7 @@
#ifdef VMW_NETDEV_HAS_NET
extern struct proto vmnet_proto;
-# define compat_sk_alloc(_bri, _pri) sk_alloc((_bri)->internalDev->nd_net, \
+# define compat_sk_alloc(_bri, _pri) sk_alloc((dev_net((_bri)->internalDev)), \
PF_NETLINK, _pri, &vmnet_proto)
#elif defined(VMW_HAVE_SK_ALLOC_WITH_PROTO)
extern struct proto vmnet_proto;
みたいな感じで(なんか無駄に括弧が多くしてしまったような気もする).
該当する Linux 側の変更は, [NET] NETNS: Omit net_device->nd_net without CONFIG_NET_NS.
2.6.24-rc8 git 20080124版であれば vmware-any-any-update116 で vmware が動くが,それ以降の Linux だと compile がとおらず,放置してた.
2.6.25 も出てことだし,ちょっと見てみた.
ちなみに vmware-any-any-update116 は <URL:http://groups.google.com/group/vmkernelnewbies/files> にある(開発が 115 までとは別系統?).
で,まず,
In file included from /tmp/vmware-config0/vmmon-only/common/hostKernel.h:56,
from /tmp/vmware-config0/vmmon-only/common/task.c:30:
include/asm/page.h: In function 'pte_t native_make_pte(pteval_t)':
include/asm/page.h:128: error: expected primary-expression before ')' token
include/asm/page.h:128: error: expected ';' before '{' token
include/asm/page.h:128: error: expected primary-expression before '.' token
include/asm/page.h:128: error: expected `;' before '}' token
とか.これは [myn:2007072000] と同様に include/asm/page.h の native_make_pte 付近を修正.次に,
/tmp/vmware-config0/vmnet-only/bridge.c: In function 'VNetBridgeUp': /tmp/vmware-config0/vmnet-only/bridge.c:949: error: implicit declaration of function 'sock_valbool_flag'
とか.これは「[NET]: Move sock_valbool_flag to socket.c」 由来の問題ぽい.
diff -ruw vmnet-only.orig/bridge.c vmnet-only/bridge.c
--- vmnet-only.orig/bridge.c 2007-11-28 19:25:06.000000000 +0900
+++ vmnet-only/bridge.c 2008-04-18 10:43:53.000000000 +0900
@@ -886,6 +886,14 @@
*----------------------------------------------------------------------
*/
+static inline void sock_valbool_flag(struct sock *sk, int bit, int valbool)
+{
+ if (valbool)
+ sock_set_flag(sk, bit);
+ else
+ sock_reset_flag(sk, bit);
+}
+
int
VNetBridgeUp(VNetBridge *bridge, // IN: bridge struct
Bool rtnlLock) // IN: acquire RTNL lock
という感じで bridge.c に宣言を記述して対応(というか手動で inline 展開 しても可).やるきなしなし.次に,
/tmp/vmware-config0/vmnet-only/filter.c:48: error: 'NF_IP_LOCAL_IN' undeclared here (not in a function) /tmp/vmware-config0/vmnet-only/filter.c:53: error: 'NF_IP_POST_ROUTING' undeclared here (not in a function) /tmp/vmware-config0/vmnet-only/filter.c: In function 'VNetFilterHookFn': /tmp/vmware-config0/vmnet-only/filter.c:233: warning: comparison between pointer and integer
とか.NF_IP_LOCAL_IN および NF_IP_POST_ROUTING は linux/netfilter_ipv4.h で define されており, filter.c からこの file を include しようとしているのだが,失敗してるぽい. ということで
diff -ruw vmnet-only.orig/filter.c vmnet-only/filter.c
--- vmnet-only.orig/filter.c 2007-11-28 19:11:12.000000000 +0900
+++ vmnet-only/filter.c 2008-04-18 10:50:24.000000000 +0900
@@ -41,6 +41,9 @@
/* netfilter hooks for filtering. */
static nf_hookfn VNetFilterHookFn;
+#define NF_IP_LOCAL_IN 1
+#define NF_IP_POST_ROUTING 4
+
static struct nf_hook_ops vmnet_nf_ops[] = {
{ .hook = VNetFilterHookFn,
compat_nf_hook_owner
という感じで filter.c に #define を記述して対応.やるきなしなし.
Building for VMware Workstation 4.5.[23] or VMware GSX Server 3.1.0.
Using 2.6.x kernel build system.
make: ディレクトリ `/tmp/vmware-config0/vmmon-only' に入ります
make -C /usr/src/linux-headers-2.6.24-rc6-20071221-myn-01/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: ディレクトリ `/usr/src/linux-headers-2.6.24-rc6-20071221-myn-01' に入ります
CC [M] /tmp/vmware-config0/vmmon-only/linux/driver.o
CC [M] /tmp/vmware-config0/vmmon-only/linux/driverLog.o
CC [M] /tmp/vmware-config0/vmmon-only/linux/hostif.o
CC [M] /tmp/vmware-config0/vmmon-only/common/comport.o
CC [M] /tmp/vmware-config0/vmmon-only/common/cpuid.o
In file included from include/asm/bitops.h:2,
from /tmp/vmware-config0/vmmon-only/./include/vcpuset.h:74,
from /tmp/vmware-config0/vmmon-only/./include/modulecall.h:23,
from /tmp/vmware-config0/vmmon-only/common/vmx86.h:19,
from /tmp/vmware-config0/vmmon-only/common/hostif.h:18,
from /tmp/vmware-config0/vmmon-only/common/cpuid.c:15:
include/asm/bitops_32.h:9:2: error: #error only <linux/bitops.h> can be included directly
make[2]: *** [/tmp/vmware-config0/vmmon-only/common/cpuid.o] エラー 1
make[1]: *** [_module_/tmp/vmware-config0/vmmon-only] エラー 2
make[1]: ディレクトリ `/usr/src/linux-headers-2.6.24-rc6-20071221-myn-01' から出ます
make: *** [vmmon.ko] エラー 2
make: ディレクトリ `/tmp/vmware-config0/vmmon-only' から出ます
Unable to build the vmmon module.
という感じで,asm/bitops.h ではなく linux/bitops.h を include しなさいと怒られるので,
diff -uwr vmmon-only.orig/include/vcpuset.h vmmon-only/include/vcpuset.h
--- vmmon-only.orig/include/vcpuset.h 2007-07-22 20:21:17.000000000 +0900
+++ vmmon-only/include/vcpuset.h 2007-12-23 15:36:11.000000000 +0900
@@ -71,7 +71,7 @@
#define ffs(x) ffs_x86_64(x)
#elif defined MODULE
- #include "asm/bitops.h"
+ #include "linux/bitops.h"
#elif defined __APPLE__ && defined KERNEL
/*
* XXXMACOS An ugly hack to resolve redefinition of PAGE_ defines
といった感じの patch で対応.
9月頃からの一連の xorg の version up に関連して,icewm で Alt+TAB (quick switch とか言われるあれ)をすると固まるという症状に陥った.
package は以下のような組み合わせ(かなり抜粋).
ということで,他の Window Manager (できれば軽量)を探すことにした. 今回とりあえず候補とした(候補として試してみた)のは以下.
この中から結局 metacity を使うことにした.
ただし metacity には taskbar (Windows 以外では panel と言うらしい) が付属していないので,metacity + gnome-panel で使うことに.
以前のボスに呼び出されてボスの Dell 計算機(Dimension E520 w/Windows Vista Ultimate)の設定とかを行う.
がしかし,
このドライバーは互換性の問題のためブロックされています ドライバ Sonic Solutions DLA 発行元 Sonic Solutions
みたいなダイアログが起動する度に出てうざいので対応.具体的には ここ の適当なスレッドを参照.一番素直な解決法っぽい Dell のサポート で解決させた.
という組合せで,ipw3945.ko が compile できないという問題.つまり,
% sudo module-assistant build ipw3945-source
で,.deb ができないという問題.で,調べてみた.まず,普通は,
/usr/src/linux/include/asm -> asm-i386/
といった感じになっていて,最新の kernel で作った linux-headers deb package も同様の symlink を張るのであるが,これがまちがい. 最新の kernel では
/usr/src/linux/include/asm -> asm-x86/
としなければならないらしい(手動で ln -s しなおす).次に,
の余波により ipw3945.c の compile がとおらない.前者に関しては,
MAC_ARG(addr)
とかの箇所を,まずどこかで,
DECLARE_MAC_BUF(mac);
してから,
print_mac(mac, addr)
する,みたいな修正が必要ならしい.ipw3945.c では MAC_ARG が 52 箇所で 使われていて面倒なので,ipw3945.c の適当なところで MAC_ARG を define することにする.
次に後者に関してであるが,SET_MODULE_OWNER の箇所をそのまま削除してや ればいいらしい.
ということで,以下のような感じに.
diff -uw ipw3945.c.orig ipw3945.c
--- ipw3945.c.orig 2007-10-17 15:43:17.000000000 +0900
+++ ipw3945.c 2007-10-17 15:42:45.000000000 +0900
@@ -108,6 +108,8 @@
#define DRV_COPYRIGHT "Copyright(c) 2003-2006 Intel Corporation"
#define DRV_VERSION IPW3945_VERSION
+#define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]
+
MODULE_DESCRIPTION(DRV_DESCRIPTION);
MODULE_VERSION(DRV_VERSION);
MODULE_AUTHOR(DRV_COPYRIGHT);
@@ -16591,7 +16593,6 @@
goto out_release_ucode;
}
- SET_MODULE_OWNER(net_dev);
SET_NETDEV_DEV(net_dev, &pdev->dev);
mutex_lock(&priv->mutex);
priv->ieee->hard_start_xmit = ipw_net_hard_start_xmit;
/usr/src/ipw3945.tar.bz2 内の該当 file を修正して,あとは,
% sudo module-assistant build ipw3945-source
して dpkg -i して完了.
でも同様なのであるが,なぜか linux-headers に
が含まれていない(arch/x86/Makefile は有る)ので,
% rsync -avz /usr/src/linux-2.6/arch/x86/Makefile* \ /usr/src/linux-headers-2.6.24-rc2-20071112-hoge-01/arch/x86/
とかで適当に調達しなければいけない (上を書いたときもそのようにしていたような気がする).
Let's Note CF-T5 に Debian を入れて,testing(sid) を追いかけてて,
Section "InputDevice" Identifier "Generic Keyboard" Driver "kbd" Option "CoreKeyboard" Option "XkbRules" "xorg" Option "XkbModel" "pc104" Option "XkbLayout" "us" Option "XkbVariant" "nodeadkeys" Option "XkbOptions" "ctrl:swapcaps" EndSection
といった感じの xorg.conf なのであるが,9月頃からの一連の xorg の version up のために keyboard まわりが非常に混乱した状況になっている...
で,今日(xserver-xorg-core 2:1.4-3)のは一番非道くて, ctrl:swapcaps が効かなくなった. ちなみにどうでもいいが私の key 配列は qwerty US 配列を無理矢理日本語キーボードで使っている (日本語キーボードな Note PC ではいつものこと).
で「ctrl:swapcaps が効かなくなった」に関しては xserver-xorg-core を 2:1.4-2 に downgrade することにより解決.
ちなみに,上で混乱した状況と書いているのは,
VMWare を使うと混乱する.
具体的には,VMWare 上の Windows XP では AltIME で caps と ctrl を swap しているのであるが,その設定にひっぱられてか,xserver 側の swapcaps が効かなくなる(もしくは2回適用されてもとにもどっている?).
なんか keyboard の反応が遅くなったような気がする.
VMWare 上ではより顕著で,高速で入力していると普通に入力順が入れ替わる.
とかとか.知人によるとちょっと違う他の症状も出ているとのこと. どれがどの packege の時の話かは完全に失念 (たぶん9月に入ってからの一連の xorg まわりの update に起因) ちなみに,現在は以下のような package 構成.
% dpkg -l '*xserver-xorg*' | grep ^ii ii xserver-xorg 1:7.3+2 the X.Org X server ii xserver-xorg-core 2:1.4-2 X.Org X server -- core server ii xserver-xorg-dev 2:1.4-3 Xorg X server - development files ii xserver-xorg-input-all 1:7.3+2 the X.Org X server -- input driver metapacka ii xserver-xorg-input-evdev 1:1.2.0~git20070819-3 X.Org X server -- evdev input driver ii xserver-xorg-input-kbd 1:1.2.2-3 X.Org X server -- keyboard input driver ii xserver-xorg-input-mouse 1:1.2.2-6 X.Org X server -- mouse input driver ii xserver-xorg-input-synaptics 0.14.7~git20070706-1 Synaptics TouchPad driver for X.Org/XFree86 ii xserver-xorg-input-wacom 0.7.7.11-1 X.Org X server -- wacom input driver ii xserver-xorg-video-all 1:7.3+2 the X.Org X server -- output driver metapack ii xserver-xorg-video-apm 1:1.1.1-10 X.Org X server -- APM display driver ii xserver-xorg-video-ark 1:0.6.0-9 X.Org X server -- ark display driver ii xserver-xorg-video-ati 1:6.6.193-3 X.Org X server -- ATI display driver ii xserver-xorg-video-chips 1:1.1.1-9 X.Org X server -- Chips display driver ii xserver-xorg-video-cirrus 1:1.1.0-8 X.Org X server -- Cirrus display driver ii xserver-xorg-video-cyrix 1:1.1.0-8 X.Org X server -- Cyrix display driver ii xserver-xorg-video-dummy 1:0.2.0-7 X.Org X server -- dummy display driver ii xserver-xorg-video-fbdev 1:0.3.1-4 X.Org X server -- fbdev display driver ii xserver-xorg-video-glint 1:1.1.1-8 X.Org X server -- Glint display driver ii xserver-xorg-video-i128 1:1.2.1-4 X.Org X server -- i128 display driver ii xserver-xorg-video-i740 1:1.1.0-7 X.Org X server -- i740 display driver ii xserver-xorg-video-i810 2:2.1.1-4 X.Org X server -- Intel i8xx, i9xx display d ii xserver-xorg-video-imstt 1:1.1.0-7 X.Org X server -- IMSTT display driver ii xserver-xorg-video-intel 2:2.1.1-4 X.Org X server -- Intel i8xx, i9xx display d ii xserver-xorg-video-mga 1:1.4.7.dfsg.1-3 X.Org X server -- MGA display driver ii xserver-xorg-video-neomagic 1:1.1.1-8 X.Org X server -- Neomagic display driver ii xserver-xorg-video-newport 1:0.2.1-4 X.Org X server -- Newport display driver ii xserver-xorg-video-nsc 1:2.8.3-2 X.Org X server -- NSC display driver ii xserver-xorg-video-nv 1:2.1.5-1 X.Org X server -- NV display driver ii xserver-xorg-video-rendition 1:4.1.3.dfsg.1-4 X.Org X server -- Rendition display driver ii xserver-xorg-video-s3 1:0.5.0-4 X.Org X server -- legacy S3 display driver ii xserver-xorg-video-s3virge 1:1.9.1-7 X.Org X server -- S3 ViRGE display driver ii xserver-xorg-video-savage 1:2.1.3-3 X.Org X server -- Savage display driver ii xserver-xorg-video-siliconmotion 1:1.5.1-3 X.Org X server -- SiliconMotion display driv ii xserver-xorg-video-sis 1:0.9.3-5 X.Org X server -- SiS display driver ii xserver-xorg-video-sisusb 1:0.8.1-9 X.Org X server -- SiS USB display driver ii xserver-xorg-video-tdfx 1:1.3.0-6 X.Org X server -- tdfx display driver ii xserver-xorg-video-tga 1:1.1.0-9 X.Org X server -- TGA display driver ii xserver-xorg-video-trident 1:1.2.3-6 X.Org X server -- Trident display driver ii xserver-xorg-video-tseng 1:1.1.1-4 X.Org X server -- Tseng display driver ii xserver-xorg-video-v4l 0.1.1-6 X.Org X server -- Video 4 Linux display driv ii xserver-xorg-video-vesa 1:1.3.0-4 X.Org X server -- VESA display driver ii xserver-xorg-video-vga 1:4.1.0-8 X.Org X server -- VGA display driver ii xserver-xorg-video-via 1:0.2.2-5 X.Org X server -- VIA display driver ii xserver-xorg-video-vmware 1:10.15.0-1 X.Org X server -- VMware display driver ii xserver-xorg-video-voodoo 1:1.1.1-5 X.Org X server -- Voodoo display driver
不要なものがいろいろ入っている気がするが.
という組合せで,nvidia.ko が compile できないという問題.
具体的には,
/usr/src/modules/nvidia-kernel/nv/nv.c: In function 'nvidia_init_module': /usr/src/modules/nvidia-kernel/nv/nv.c:1326: error: too many arguments to function 'kmem_cache_create' /usr/src/modules/nvidia-kernel/nv/nv.c:1435: error: too many arguments to function 'kmem_cache_create' /usr/src/modules/nvidia-kernel/nv/nv.c:1569: error: void value not ignored as it ought to be /usr/src/modules/nvidia-kernel/nv/nv.c: In function 'nvidia_exit_module': /usr/src/modules/nvidia-kernel/nv/nv.c:1601: error: void value not ignored as it ought to be
という error でこける.kmem_cache_create に関しては <URL:http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=9a79b2274186fade17134929d4f85b70d59a3840#patch115> の
struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
unsigned long,
- void (*)(void *, struct kmem_cache *, unsigned long),
void (*)(void *, struct kmem_cache *, unsigned long));
という部分の影響.これに関しては,
diff -uw nv/nv-linux.h.orig nv/nv-linux.h
--- nv/nv-linux.h.orig 2007-09-09 13:49:04.000000000 +0900
+++ nv/nv-linux.h 2007-09-09 13:49:14.000000000 +0900
@@ -533,7 +533,7 @@
#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type) \
{ \
kmem_cache = kmem_cache_create(name, sizeof(type), \
- 0, 0, NULL, NULL); \
+ 0, 0, NULL); \
}
#define NV_KMEM_CACHE_DESTROY(kmem_cache) \
とかして対応.
void value not ignored as it ought to be
-extern int unregister_chrdev(unsigned int, const char *); +extern void unregister_chrdev(unsigned int, const char *);
という部分の影響.これに関しては,
diff -uw nv/nv.c.orig nv/nv.c
--- nv/nv.c.orig 2007-09-09 13:50:30.000000000 +0900
+++ nv/nv.c 2007-09-09 13:52:11.000000000 +0900
@@ -1566,8 +1566,7 @@
if (apm_nv_dev[i] != NULL) pm_unregister(apm_nv_dev[i]);
#endif
- if (unregister_chrdev(nv_major, "nvidia") < 0)
- nv_printf(NV_DBG_ERRORS, "NVRM: unregister nv chrdev failed\n");
+ unregister_chrdev(nv_major, "nvidia");
for (i = 0; i < num_nv_devices; i++)
{
@@ -1598,8 +1597,7 @@
nv_printf(NV_DBG_INFO, "NVRM: nvidia_exit_module\n");
- if (unregister_chrdev(nv_major, "nvidia") < 0)
- nv_printf(NV_DBG_ERRORS, "NVRM: unregister nv chrdev failed\n");
+ unregister_chrdev(nv_major, "nvidia");
for (i = 0; i < num_nv_devices; i++)
{
とかして対応.
ちなみに普通に nvidia.ko (というか,それを含む .deb) を作る時は,
% sudo module-assistant build nvidia-kernel
とかで済ますのであるが,こけた時の原因を探るには,
% cd /usr/src/modules/nvidia-kernel % sudo make -f debian/rules KVERS=`uname -r` KSRC=/lib/modules/`uname -r`/source KDREV=0.1 binary_modules
とかで探ってやれば良さげ.nvidia-kernel-source の本体は
/usr/src/nvidia-kernel-source.tar.gz
にあるので,本来はそこに patch をあててやるべきな気がしないでもないが, 上述の make で .deb が吐けるので, kernel をあげる度に対応することに適当に修正をかけることにする.
ある商用 Linux プログラムを動かしたら
arch: Command not found.
とかで唐突に落ちて悩む.どうやら util-linux に /bin/arch が含まれなくなったのが原因で,changelog によると
util-linux (2.13~rc2-2) experimental; urgency=low * arch is dealt with upstream now. (snip)
とのこと(2.13~rc2-2 以降では arch が無いっぽい).DEPRECATED という file によると
The following is a list of commands or features that are going to be
removed in the util-linux-ng source tree.
(snip)
What: arch(1) command
When: 2.14
Why: deprecated in favor of uname(1) or arch(1) from coreutils
The arch(1) has been added (during 2.13 development cycle) to coreutuls
where it will be maintained as an alias for uname(1) command.
ということらしい.がしかしまだ coreutil (今の version は 5.97-5.3) には含まれていないっぽくて,とりあえず,
% apt-get source util-linux % cd util-linux-2.13\~rc2/sys-utils % make arch % sudo cp arch /bin
といった感じでやるきなしなし対応.
まず,vmmon の compile で
Using 2.6.x kernel build system. make: ディレクトリ `/tmp/vmware-config0/vmmon-only' に入ります make -C /usr/src/linux-headers-2.6.22-2007072001/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules make[1]: ディレクトリ `/usr/src/linux-headers-2.6.22-2007072001' に入ります CC [M] /tmp/vmware-config0/vmmon-only/linux/driver.o /tmp/vmware-config0/vmmon-only/linux/driver.c: In function '__LinuxDriver_Ioctl': /tmp/vmware-config0/vmmon-only/linux/driver.c:1833: error: 'struct mm_struct' has no member named 'dumpable' make[2]: *** [/tmp/vmware-config0/vmmon-only/linux/driver.o] エラー 1 make[1]: *** [_module_/tmp/vmware-config0/vmmon-only] エラー 2 make[1]: ディレクトリ `/usr/src/linux-headers-2.6.22-2007072001' から出ます make: *** [vmmon.ko] エラー 2 make: ディレクトリ `/tmp/vmware-config0/vmmon-only' から出ます Unable to build the vmmon module.
とかでこける.これは <URL:http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6c5d523826dc639df709ed0f88c5d2ce25379652> の影響.mm_struct.dumpable に変更があったとのこと.
diff -uwr vmmon-only/linux/driver.c vmmon-only.new/linux/driver.c
--- vmmon-only/linux/driver.c 2007-04-09 10:20:35.000000000 +0900
+++ vmmon-only.new/linux/driver.c 2007-07-21 18:18:34.000000000 +0900
@@ -1494,6 +1494,26 @@
*/
#include <linux/sched.h>
+static void set_dumpable0(struct mm_struct *mm, int value)
+{
+ switch (value) {
+ case 0:
+ clear_bit(MMF_DUMPABLE, &mm->flags);
+ smp_wmb();
+ clear_bit(MMF_DUMP_SECURELY, &mm->flags);
+ break;
+ case 1:
+ set_bit(MMF_DUMPABLE, &mm->flags);
+ smp_wmb();
+ clear_bit(MMF_DUMP_SECURELY, &mm->flags);
+ break;
+ case 2:
+ set_bit(MMF_DUMP_SECURELY, &mm->flags);
+ smp_wmb();
+ set_bit(MMF_DUMPABLE, &mm->flags);
+ break;
+ }
+}
static int
__LinuxDriver_Ioctl(
struct file *filp,
@@ -1830,7 +1850,7 @@
current->egid == current->gid &&
current->fsgid == current->gid) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 7)
- current->mm->dumpable = 1;
+ set_dumpable0(current->mm, 1);
#else
current->dumpable = 1;
#endif
という感じでやるきなしなし対応.
set_dumpable(current->mm, 1);
として,include/linux/sched.h に用意されているっぽい
extern void set_dumpable(struct mm_struct *mm, int value);
を使ってもいいのだけれども,insmod 時に
vmmon: Unknown symbol set_dumpable
とかでこけるようになる(上記 pache は fs/exec.c から set_dumpable を copy して流用している).
次に,vmnet の compile で,
make: ディレクトリ `/tmp/vmware-config0/vmnet-only' に入ります make -C /usr/src/linux-headers-2.6.22-2007072001/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules make[1]: ディレクトリ `/usr/src/linux-headers-2.6.22-2007072001' に入ります CC [M] /tmp/vmware-config0/vmnet-only/driver.o /tmp/vmware-config0/vmnet-only/driver.c: In function 'cleanup_module': /tmp/vmware-config0/vmnet-only/driver.c:531: error: void value not ignored as it ought to be make[2]: *** [/tmp/vmware-config0/vmnet-only/driver.o] エラー 1 make[1]: *** [_module_/tmp/vmware-config0/vmnet-only] エラー 2 make[1]: ディレクトリ `/usr/src/linux-headers-2.6.22-2007072001' から出ます make: *** [vmnet.ko] エラー 2 make: ディレクトリ `/tmp/vmware-config0/vmnet-only' から出ます Unable to build the vmnet module.
-extern int unregister_chrdev(unsigned int, const char *); +extern void unregister_chrdev(unsigned int, const char *);
といった変更による.ということで,
diff -uwr vmnet-only/driver.c vmnet-only.new/driver.c
--- vmnet-only/driver.c 2007-05-14 15:03:03.000000000 +0900
+++ vmnet-only.new/driver.c 2007-07-21 18:29:45.000000000 +0900
@@ -528,11 +528,7 @@
int retval;
unregister_ioctl32_handlers();
- retval = unregister_chrdev(VNET_MAJOR_NUMBER, "vmnet");
- if (retval != 0 ) {
- LOG(0, (KERN_WARNING "/dev/vmnet: could not unregister major device %d\n",
- VNET_MAJOR_NUMBER));
- }
+ unregister_chrdev(VNET_MAJOR_NUMBER, "vmnet");
VNetProtoUnregister();
VNetProc_Cleanup();
#ifdef CONFIG_NETFILTER
といった感じに.
[myn:2007062600] の続き.
の組み合わせの場合の話.で,前回の
とかいった話は,vmware-any-any-update110 で対応されているっぽい. ちなみに any-any patch は今までは <URL:http://ftp.cvut.cz/vmware/> で配布されていたんですが,vmware-any-any-update110 は <URL:http://knihovny.cvut.cz/ftp/pub/vmware/> にあって, まだあまり Google にひっかかってくれません.
今回の問題は include/asm/page.h の,
static inline pte_t native_make_pte(unsigned long val)
{
return (pte_t) { .pte_low = val };
}
の箇所.前回 はこれをまるごと comment out して対応したのであるが,この 関数を他の .h (linux の) が参照しているらしく,comment out すると compile がとおらなくなる.ということで,
static inline pte_t native_make_pte(unsigned long val)
{
pte_t t;
t.pte_low=val;
return t;
}
とか適当にそれっぽく修正して対応.やるきなしなし.
[myn:2007021000] の続き.
undefined reference to `__ctype_b' undefined reference to `__ctype_tolower' undefined reference to `__ctype_toupper'
とかで怒られるというあれ.いわゆる上記の symbol 入り libc をつくる件.
% apt-get source glibc (これで glibc-2.6 という directory ができる) % cd glibc-2.6 % head -1 debian/changelog glibc (2.6-2) unstable; urgency=low % emacs debian/changelog C-c C-v (要 debian-changelog-mode) 2.6-3 となるところをなんとなく 2.6-3.1 とかに修正 C-c C-f, C-x C-s, C-x C-c % head -1 debian/changelog glibc (2.6-3.1) unstable; urgency=low % cp somewhere/glibc26-ctype-compat.dpatch debian/patches/any % echo any/glibc26-ctype-compat.dpatch >> debian/patches/series
ここまでが下準備.
glibc26-ctype-compat.dpatch は自前で用意したので <URL:http://myn.meganecco.org/files/glibc26-ctype-compat.dpatch> に置いてあります (無保証).
で,前回 は
% nice -19 fakeroot make -f debian/rules binary \ "RUN_TESTSUITE=no" \ "DEB_INDEP_REGULAR_PACKAGES=locales" \ "DEB_ARCH_REGULAR_PACKAGES=libc6 libc6-dev libc6-amd64 libc6-dev-amd64" \ "DEB_UDEB_PACKAGES=" \ "GLIBC_PASSES=libc nptl amd64"
とかで OK だったのであるが,今回は,
% nice -19 fakeroot make -f debian/rules binary \ "RUN_TESTSUITE=no" \ "DEB_INDEP_REGULAR_PACKAGES=locales" \ "DEB_ARCH_REGULAR_PACKAGES=libc6 libc6-dev libc6-i686 libc6-xen libc6-amd64 libc6-dev-amd64" \ "DEB_UDEB_PACKAGES=" \ "GLIBC_PASSES=libc i686 xen amd64"
という感じで,
xen は不要なのであるが,これがなければ
# extra_debhelper_pkg_install is used for debhelper.mk only. # when you want to install extra packages, use extra_pkg_install. mkdir -p debian/libc6-dev/usr/lib/xen cp -af debian/tmp-xen/usr/lib/*.a debian/libc6-dev/usr/lib/xen cp: cannot stat `debian/tmp-xen/usr/lib/*.a': そのようなファイルやディレクトリはありません make: *** [/home/myn/glibc-2.6/stamp-dir/binaryinst_libc6-dev] エラー 1
とかで build に失敗するので.
[myn:2007062600] に書いたとおり Linux 2.6.22-rc5 (git 経由で取得したので,たぶん rc5 と rc6 の間) を使っているのであるが,この状態で linux-image*.deb を dpkg -i しよう とすると yaird (0.0.12-20) が
Using mkinitrd.yaird to build the ramdisk. yaird error: unrecognised line in /proc/bus/input/devices: U: Uniq= (fatal) mkinitrd.yaird failed to create initrd image. Failed to create initrd image.
とかでこける.
U: Uniq=
という行が /proc/bus/input/devices に出現するようになったのが原因っぽい.
ということで,
diff -uw /usr/lib/yaird/perl/InputTab.pm.orig /usr/lib/yaird/perl/InputTab.pm
--- /usr/lib/yaird/perl/InputTab.pm.orig 2007-06-28 15:54:37.000000000 +0900
+++ /usr/lib/yaird/perl/InputTab.pm 2007-06-28 15:59:54.000000000 +0900
@@ -73,6 +73,8 @@
elsif ($line =~ /^B: ([A-Z]+)=(.*)$/) {
$work->{capabilities}{$1} = $2;
}
+ elsif ($line =~ /^U: Uniq=/) {
+ }
elsif ($line =~ /^$/) {
if (! exists ($work->{info})) {
Base::fatal ("missing I: in $name");
といったやるきなしなし patch を yaird にあてて回避.
の組み合わせの場合の話.
まず,vmmon.o の compile で
include/asm/page.h: In function 'pte_t native_make_pte(long unsigned int)':
include/asm/page.h:111: error: expected primary-expression before ')' token
include/asm/page.h:111: error: expected ';' before '{' token
include/asm/page.h:111: error: expected primary-expression before '.' token
include/asm/page.h:111: error: expected `;' before '}' token
とかでこける.これに関しては,
diff -uwr /usr/src/linux-headers-2.6.22-rc5/include/asm/page.h.orig /usr/src/linux-headers-2.6.22-rc5/include/asm/page.h
--- /usr/src/linux-headers-2.6.22-rc5/include/asm/page.h.orig 2007-06-26 14:51:30.000000000 +0900
+++ /usr/src/linux-headers-2.6.22-rc5/include/asm/page.h 2007-06-26 14:51:48.000000000 +0900
@@ -106,10 +106,12 @@
{
return (pgd_t) { val };
}
+/*
static inline pte_t native_make_pte(unsigned long val)
{
return (pte_t) { .pte_low = val };
}
+*/
#define HPAGE_SHIFT 22
#include <asm-generic/pgtable-nopmd.h>
みたいな header 側に patch をあててとりあえず回避. ちなみに該当箇所の kernel 側の変更は <URL:http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=3dc494e86d1c93afd4c66385f270899dbfae483d> に由来.
次に,vmnet.o の compile で
/tmp/vmware-config0/vmnet-only/userif.c: In function 'VNetCopyDatagramToUser': /tmp/vmware-config0/vmnet-only/userif.c:633: error: 'const struct sk_buff' has no member named 'h' /tmp/vmware-config0/vmnet-only/userif.c:633: error: 'const struct sk_buff' has no member named 'nh' /tmp/vmware-config0/vmnet-only/userif.c:639: error: 'const struct sk_buff' has no member named 'h'
とかでこける.これは,kernel 側の <URL:http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=b0e380b1d8a8e0aca215df97702f99815f05c094> という変更に由来.
つまり
変更すれば OK.以下のような patch を vmnet.tar 内の file にあてる.
diff -uwr a/vmnet-only/bridge.c b/vmnet-only/bridge.c
--- a/vmnet-only/bridge.c 2006-11-13 07:50:53.000000000 +0900
+++ b/vmnet-only/bridge.c 2007-06-26 14:44:58.000000000 +0900
@@ -1072,12 +1072,12 @@
VNetBridgeComputeHeaderPos(struct sk_buff *skb) // IN: buffer to examine
{
/* Maybe some kernel gets it right... */
- if (skb->h.raw != skb->nh.raw) {
+ if (skb->transport_header != skb->network_header) {
return;
}
switch (be16_to_cpu(skb->protocol)) {
case ETH_P_IP:
- skb->h.raw = skb->nh.raw + (skb->nh.raw[0] & 0x0F) * 4;
+ skb->transport_header = skb->network_header + (skb->network_header[0] & 0x0F) * 4;
return;
default:
LOG(3, (KERN_DEBUG "Unknown EII protocol %04X: csum at %d\n",
@@ -1163,7 +1163,7 @@
# endif
if (bridge->smac) {
- if (VNetCallSMACFunc(bridge->smac, &skb, skb->mac.raw,
+ if (VNetCallSMACFunc(bridge->smac, &skb, skb->mac_header,
SMAC_CheckPacketFromHost) !=
PacketStatusForwardPacket) {
LOG(4, (KERN_NOTICE "bridge-%s: packet dropped .\n",
@@ -1187,7 +1187,7 @@
#endif
#endif
- skb_push(skb, skb->data - skb->mac.raw);
+ skb_push(skb, skb->data - skb->mac_header);
LOG(3, (KERN_DEBUG "bridge-%s: receive %d\n",
bridge->name, (int) skb->len));
diff -uwr a/vmnet-only/userif.c b/vmnet-only/userif.c
--- a/vmnet-only/userif.c 2006-11-13 07:04:40.000000000 +0900
+++ b/vmnet-only/userif.c 2007-06-26 14:38:37.000000000 +0900
@@ -630,13 +630,13 @@
*/
if (skb->pkt_type == PACKET_OUTGOING && /* Packet must be outgoing */
skb->ip_summed == VM_CHECKSUM_PARTIAL && /* Without checksum */
- skb->h.raw != skb->nh.raw && /* We must know where header is */
+ skb->transport_header != skb->network_header && /* We must know where header is */
skb->len == count) { /* No truncation may occur */
size_t skl;
int csum;
u_int16_t csum16;
- skl = skb->h.raw - skb->data;
+ skl = skb->transport_header - skb->data;
if (VNetCopyDatagram(skb, buf, skl)) {
return -EFAULT;
}
diff -uwr a/vmnet-only/vnetInt.h b/vmnet-only/vnetInt.h
--- a/vmnet-only/vnetInt.h 2005-06-19 10:00:03.000000000 +0900
+++ b/vmnet-only/vnetInt.h 2007-06-26 14:43:34.000000000 +0900
@@ -25,8 +25,8 @@
#define DEV_QUEUE_XMIT(skb, dev, pri) ( \
(skb)->dev = (dev), \
(skb)->priority = (pri), \
- (skb)->mac.raw = (skb)->data, \
- (skb)->nh.raw = (skb)->data + sizeof (struct ethhdr), \
+ (skb)->mac_header = (skb)->data, \
+ (skb)->network_header = (skb)->data + sizeof (struct ethhdr), \
dev_queue_xmit(skb) \
)
#ifdef KERNEL_2_3_15
いつのまにか
fontname="Kochi Gothic"
とかが通らなくなっていた(graphviz 2.12-3 @Debian).
% dot -v -Tpng test.dot | display -
とかによると
dot: fontname "Kochi Gothic" resolved to "[internal times]"
らしい.ちなみに
% echo 'digraph{"A"->"B";}' | dot -v -Tpng | display -
とかによると
dot: fontname "Times-Roman" resolved to "[internal times]"
とのことで,Times-Roman さえ見付けてくれないっぽい.
% fc-match 'Kochi Gothic' KochiGothic-Regular.ttf: "Kochi Gothic" "Regular" % fc-match Times-Roman timR12-ISO8859-1.pcf.gz: "Times" "Regular"
とかで,fontconfig は問題なさげ.ちなみに KochiGothic-Regular.ttf とかは
% ls -l /var/lib/defoma/fontconfig.d/K/KochiGothic-Regular.ttf lrwxrwxrwx 1 root root 54 2007-04-02 17:53 /var/lib/defoma/fontconfig.d/K/KochiGothic-Regular.ttf -> /usr/share/fonts/truetype/kochi/kochi-gothic-subst.ttf
という感じのところにあるらしい.
<URL:http://www.graphviz.org/bugs/b1087.html> とかも参照したが <URL:http://www.graphviz.org/doc/FAQ.html> 追えず.
% (echo 'digraph{"A"->"B";}' | strace -f dot -v -Tpng | display -) |& less
とかによると
open("/usr/lib/libfontconfig.so.1", O_RDONLY) = 3
しているのは分るのであるが,こっち方面もそれ以上は追えず.仕方無しに
% apt-get source graphviz % cd graphviz-2.12 % fakeroot make -f debian/rules binary
してみたが,
cmd/lefty/dot2l/Makefile.am:10: Libtool library used but `LIBTOOL' is undefined cmd/lefty/dot2l/Makefile.am:10: cmd/lefty/dot2l/Makefile.am:10: The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL' cmd/lefty/dot2l/Makefile.am:10: to `configure.ac' and run `aclocal' and `autoconf' again. (snip)
とかでなんだかこける...
ということで<URL:/map.html> の文字化けを放置.
という組合せの時の話.
vmware-config.pl が insmod をたたくのであるが, どうやら fullpath でたたかないと SEGV (Segmentation fault) で落ちるらしい.
とりあえず <URL:http://www.vmware.com/community/thread.jspa?messageID=650674򞶲> を参考に
\--- vmware-config.pl 2007/06/16 02:35:24 1.1
+++ vmware-config.pl 2007/06/16 02:47:24
@@ -933,9 +933,10 @@
sub check_answer_binpath {
my $answer = shift;
my $source = shift;
+ my $fullpath = internal_which($answer);
- if (not (internal_which($answer) eq '')) {
- return $answer;
+ if ($fullpath ne '') {
+ return $fullpath;
}
if ($source eq 'user') {
みたいな patch をあてて対応.
<URL:http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=425458> によると,すぐに Debian の方で対応されてしまいそう.
module-init-tools 3.3-pre11-2 で直った模様.
module-init-tools (3.3-pre11-2) unstable; urgency=high
* New patch insmod-segv: prevents insmod from segfaulting if called without
an explicit path, courtesy of Mikko Ylinen. (Closes: #425458)
既に 3.3-pre11-3 まで出てます.ちなみに 3.3-pre11-2 で modutils との compatibility が無くなった模様 (modutils と conflict を起す).
新しい職場 では imap 環境がないらしく, 自前で fetchmail を利用して imap 環境を構築することにした.
まず,qpopper.これは管理者により APOP な設定がされているので popauth で APOP の password をつくってもらう(APOP も この 影響で廃止されそうな雰囲気があるが).
とりあえずやるきなしなしで,
[~/.procmailrc] PATH=/bin:/sbin:/usr/bin:/usr/local/bin:. MAILDIR=$HOME/imap4 LOCKFILE=$MAILDIR/.lock PMDIR=$HOME/.procmail LOGFILE=$PMDIR/.log_procmail SENDMAIL=/usr/sbin/sendmail SHELL=/bin/sh
とか.
MAILDIR=$HOME/imap4
に関しては後述.$PMDIR はあとで
INCLUDERC=$PMDIR/rc.spam
とか(SPAM filtering および自動 refile の設定)で利用する予定の directory.
つぎに,qmail.これは fetchmail で qpopper をたたいて,その mail をそ のまま qmail に smtp するために入れる.ちなみに fetchmail から直接 procmail を
[.fetchmailrc] mda "/usr/bin/procmail"
とかでたたくこともできるが,この場合いわゆる MAIL FROM を付けてくれな いらしく,正しく Mailbox として解釈できない妙な spool ができてしまう (なんとかならないか調査してみたが挫折).
Debian 環境なので,まず qmail-src と ucspi-tcp-src を入れて,
# build-qmail # build-ucspi-tcp
とかで
をつくり dpkg -i する(たぶん他の MTA と conflict するので dselect とかで要調整).
% echo hoge | /usr/sbin/qmail-inject myn
とかで /var/mail/myn ができることを確認.
つぎに uw-imapd.courier-imap を使うことも考えられるが,個人的にずっと uw-imapd を使って来ているので,今回も uw-imapd で. Default では $HOME が imap の root folder になってしまうので(感じ悪い),
[/etc/c-client.cf ] I accept the risk for IMAP toolkit 4.1. set mail-subdirectory imap4
とか書いて,~/imap4/ 以下に spool していく方針とする(この directory 名も個人的な昔からの伝統).で,
% cd ~/imap4/ ; ln -s /var/mail/myn INBOX
しておく.ちなみに普通に Debian な package を入れると inetd.conf は以下のような感じ.
[/etc/inetd.conf] imap2 stream tcp nowait root /usr/sbin/tcpd /usr/sbin/imapd imaps stream tcp nowait root /usr/sbin/tcpd /usr/sbin/imapd
%inbox@localhost:993!
とかな folder で check (パスワードはログインパスワード). localhost がプライベートネットワークな計算機なので 普通の imap でもいいのだが,なんとなく imaps で.
[~/.fetchmailrc] set daemon 60 set postmaster root set nobouncemail set logfile fetchmail.log defaults protocol apop no rewrite no mimedecode keep smtphost localhost poll apopserver.example.org username "myn" password "XXXXXXXX"
とか書いて,fetchmail を起動.しばらくこれで test した後, 「keep」という行を削除して POP server に mail を残さないようにする.
ちなみに,たとえば何らかの問題により qmail が起動していない状態で,
まあ,冗長性は他で確保されているので,keep しないことにする.
なんだか,いつのまにか(ChangeLog と現象が発生した時期を考慮するとたぶん Tue Mar 6 19:03:42 2007 付近)
ruby -e 'require "digest/md5" ; p Digest::MD5.new("hoge")'
が NG になっていて(wrong number of arguments (1 for 0) (ArgumentError))
ruby -e 'require "digest/md5" ; p Digest::MD5.new.update("hoge")'
としなければならないらしい. マニュアル は更新されていないようだけど.
ちなみに今まで律儀に上記のように書いていたのであるが,
ruby -e 'require "md5" ; p MD5.md5("hoge")'
ruby -e 'require "md5" ; p MD5.new("hoge")'
ruby -e 'require "md5" ; p MD5.new.update("hoge")'
とかでもいいらしい(上記なら全て OK). md5.rb が require されるか digest/md5.so が require されるかの違い.
ちなみに,md5.rb には,
# just for compatibility; requiring "md5" is obsoleted
とか書いてあって,どれを使えばいいのか微妙...
[myn:2006042400] の続き.
undefined reference to `__ctype_b' undefined reference to `__ctype_tolower' undefined reference to `__ctype_toupper'
とかで怒られるというあれ.いわゆる上記の symbol 入り libc をつくる件.
% apt-get source glibc (これで glibc-2.3.6.ds1 という directory ができる) % cd glibc-2.3.6.ds1 % head -1 debian/changelog glibc (2.3.6.ds1-11) unstable; urgency=low % emacs debian/changelog C-c C-v (要 debian-changelog-mode) 2.3.6.ds1-12 となるところをなんとなく 2.3.6.ds1-11.1 とかに修正 C-c C-f, C-x C-s, C-x C-c % head -1 debian/changelog glibc (2.3.6.ds1-11.1) unstable; urgency=low % wget -O - 'http://cvs.debian.org/*checkout*/glibc-package/debian/patches/glibc23-ctype-compat.dpatch?root=glibc' > debian/patches/any/glibc23-ctype-compat.dpatch % echo any/glibc23-ctype-compat.dpatch >> debian/patches/series
ここまでが下準備.ここで,
% nice -19 fakeroot make -f debian/rules binary
とかしてもいいのだけれど,相当時間がかかるので, 今回は必要なものだけ作る方針をとる.必要なものとは,
% dpkg -l | grep 2.3.6.ds1
によると
とのこと.同じ build# の package に依存 (locales が libc6 に依存とか) するので,これらすべて(のみ)を作り直す.debian/rules に適当に,
hoge: @echo RUN_TESTSUITE: $(RUN_TESTSUITE) @echo DEB_INDEP_REGULAR_PACKAGES: $(DEB_INDEP_REGULAR_PACKAGES) @echo DEB_ARCH_REGULAR_PACKAGES: $(DEB_ARCH_REGULAR_PACKAGES) @echo DEB_UDEB_PACKAGES: $(DEB_UDEB_PACKAGES) @echo GLIBC_PASSES: $(GLIBC_PASSES)
とか書いて調べてみたところ,default では,
RUN_TESTSUITE: yes DEB_INDEP_REGULAR_PACKAGES: glibc-doc locales DEB_ARCH_REGULAR_PACKAGES: libc6 libc6-dev libc6-dbg libc6-prof libc6-pic locales-all libc6-i686 libc6-xen libc6-amd64 libc6-dev-amd64 nscd DEB_UDEB_PACKAGES: libc6-udeb libnss-dns-udeb libnss-files-udeb GLIBC_PASSES: libc nptl i686 xen amd64
となっている.これを,
RUN_TESTSUITE: no DEB_INDEP_REGULAR_PACKAGES: locales DEB_ARCH_REGULAR_PACKAGES: libc6 libc6-dev libc6-amd64 libc6-dev-amd64 DEB_UDEB_PACKAGES: GLIBC_PASSES: libc nptl amd64
とすべく,
% nice -19 fakeroot make -f debian/rules hoge \ > "RUN_TESTSUITE=no" \ > "DEB_INDEP_REGULAR_PACKAGES=locales" \ > "DEB_ARCH_REGULAR_PACKAGES=libc6 libc6-dev libc6-amd64 libc6-dev-amd64" \ > "DEB_UDEB_PACKAGES=" \ > "GLIBC_PASSES=libc nptl amd64" RUN_TESTSUITE: no DEB_INDEP_REGULAR_PACKAGES: locales DEB_ARCH_REGULAR_PACKAGES: libc6 libc6-dev libc6-amd64 libc6-dev-amd64 DEB_UDEB_PACKAGES: GLIBC_PASSES: libc nptl amd64
という感じでテスト.良さげ.ということで,
% nice -19 fakeroot make -f debian/rules binary \ "RUN_TESTSUITE=no" \ "DEB_INDEP_REGULAR_PACKAGES=locales" \ "DEB_ARCH_REGULAR_PACKAGES=libc6 libc6-dev libc6-amd64 libc6-dev-amd64" \ "DEB_UDEB_PACKAGES=" \ "GLIBC_PASSES=libc nptl amd64"
とかで必要な .deb が ../ に生成される.
RUN_TESTSUITE は test をするかどうかを指示するフラグみたいなもので, yes だと相当 build に時間がかかってしまう.*_PACKAGES は文字通り作る package のリスト.GLIBC_PASSES は良く別らない (see debian/sysdeps/i386.mk とか).
ちなみに Pentium M 1.20GHz で ccache が効きまくった状態でだいたい 1時間半ぐらいかかる.
普通の負荷で,
kernel: CPU0: Temperature above threshold kernel: CPU1: Temperature above threshold kernel: CPU1: Running in modulated clock mode kernel: CPU0: Running in modulated clock mode
とか計算機が悲鳴をあげるようになってきた(温度は70℃ぐらい)ので,掃除.
という感じなので,ほぼ半年に1度掃除すればいいっぽい.
% sensors
によると現在 35℃.
Emacs で機種依存文字(①とか)を表示するには, navi2ch に付属の izonmoji-mode.el を使うのが一般的な模様. ちなみに X で JISX0213 が表示できる必要がある.
ということで,
% sudo apt-get install xfonts-jisx0213 % sudo /etc/init.d/xfs reload % xfontset (確認; rgstry に jisx0213.2000 とか jisx0213.2004 があれば OK)
とかで,X の JISX0213 環境を整える.Debian sid の場合, Emasc で JISX0213 を表示するには,
export DEB_MULEUCS_JISX0213=on
とかする必要があって,これを .zshrc とかに書いておく (see /etc/emacs/site-start.d/40mule-ucs.el).
あとは izonmoji-mode.el を適当なところに置いて,
(autoload 'izonmoji-mode "izonmoji-mode" nil t) (autoload 'izonmoji-mode-on "izonmoji-mode" nil t) (add-hook 'w3m-mode-hook 'izonmoji-mode-on) (add-hook 'wl-message-redisplay-hook 'izonmoji-mode-on)
とか(これで機種依存文字が Wanderlust で読める). 面倒だったら本当に適当なところに置いて,はじめに,
(load "/home/myn/lisp/izonmoji-mode.el")
をしても.
\verb+hoge+
とかの font が微妙に横幅が大きくて感じ悪い. たぶん auctex の version とは無関係で昔からこうだったような気がする.
ということで,
(custom-set-faces '(fixed-pitch ((t (:inherit default)))))
っぽいことをする.
font-latex-verbatim-face が Inherit: fixed-pitch で, fixed-pitch が
Family: courier Inherit: default
なので,これを
Inherit: default
のみにした.
AVG Free Edition 7.1.409 -> AVG Free Edition 7.5.432
そろそろ 7.1 のサポートが終了するらしいので Update.
コンソールから startx する(display manager を使わない)派なのであるが, たまにコンソール「だけ」で使う時なんだか VGA というのも辛いので, VESA 程度が欲くなった.
で,Let's note CF-T4 には Intel 915GM が載っているのでこれ(intelfb)を使うことにする.Kernel Option は,
CONFIG_FB=y CONFIG_FB_INTEL=y
とか.
CONFIG_FB_VGA16 CONFIG_FB_VESA
をセットしていると vga16fb とかが使われてしまうので,これらを切る. あと,
CONFIG_VIDEO_SELECT=y CONFIG_FRAMEBUFFER_CONSOLE=y
ぐらいも必要かも.Linux の Boot Option には,
vga=792 video=intelfb:1024x768-24
ぐらいを使う.video= 以降は無くても OK.dmesg の intelfb 関連の部分は 以下のような感じ(vga=792 のみで起動した時).ちなみに,この時は
CONFIG_FB_INTEL_DEBUG=y
していたのでかなり verbose.
intelfb: intelfb_init intelfb: Framebuffer driver for Intel(R) 830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM chipsets intelfb: Version 0.9.4 intelfb: intelfb_setup intelfb: no options intelfb: intelfb_pci_register intelfb: fb aperture: 0xc0000000/0x10000000, MMIO region: 0xb0080000/0x80000 intelfb: 00:02.0: Intel(R) 915GM, aperture size 256MB, stolen memory 7932kB intelfb: fb: 0xc0000000(+ 0x0)/0x7bf000 (0xf8a00000) intelfb: MMIO: 0xb0080000/0x80000 (0xfc200000) intelfb: ring buffer: 0xc3001000/0x10000 (0xfba01000) intelfb: HW cursor: 0x0/0x0 (0x00000000) (offset 0x0) (phys 0x0) intelfb: options: vram = 4, accel = 1, hwcursor = 0, fixed = 0, noinit = 0 intelfb: options: mode = "" intelfb: Non-CRT device is enabled ( LVDS port ). Disabling mode switching. intelfb: get_initial_mode intelfb: Initial info: FB is 0xc0000000/0x7b0000 (7872 kByte) intelfb: Initial info: mode is 1024x768-32 (4096) intelfb: update_dinfo intelfb: intelfb_var_to_depth: bpp: 32, green.length is 8 intelfb: intelfb_set_fbinfo intelfb: intelfb_init_var intelfb: Initial video mode is 1024x768-32@60. intelfb: Initial video mode is from 5. intelfb: update_dinfo intelfb: intelfb_var_to_depth: bpp: 32, green.length is 8 intelfb: I2C bus CRTDDC_A registered. intelfb: I2C bus SDVOCTRL_E registered. intelfb: intelfbhw_print_hw_state hw state dump start VGA0_DIVISOR: 0x00031108 VGA1_DIVISOR: 0x00031406 VGAPD: 0x00800080 VGA0: (m1, m2, n, p1, p2) = (17, 8, 3, 8, 0) VGA0: clock is 25200 VGA1: (m1, m2, n, p1, p2) = (20, 6, 3, 8, 0) VGA1: clock is 28320 DPLL_A: 0x04800000 DPLL_B: 0x98046000 FPA0: 0x00031108 FPA1: 0x00031108 FPB0: 0x00021307 FPB1: 0x00031108 PLLA0: (m1, m2, n, p1, p2) = (17, 8, 3, 8, 0) PLLA0: clock is 25200 PLLA1: (m1, m2, n, p1, p2) = (17, 8, 3, 8, 0) PLLA1: clock is 25200 HTOTAL_A: 0x031f027f HBLANK_A: 0x03170287 HSYNC_A: 0x02ef028f VTOTAL_A: 0x020c01df VBLANK_A: 0x020401e7 VSYNC_A: 0x01eb01e9 SRC_SIZE_A: 0x027f01df BCLRPAT_A: 0x00000000 HTOTAL_B: 0x053f03ff HBLANK_B: 0x053f03ff HSYNC_B: 0x049f0417 VTOTAL_B: 0x032502ff VBLANK_B: 0x032502ff VSYNC_B: 0x03080302 SRC_SIZE_B: 0x03ff02ff BCLRPAT_B: 0x00000000 ADPA: 0x40008c18 DVOA: 0x00000000 DVOB: 0x00480000 DVOC: 0x00480000 DVOA_SRCDIM: 0x00000000 DVOB_SRCDIM: 0x00000000 DVOC_SRCDIM: 0x00000000 LVDS: 0xc0008300 PIPEACONF: 0x00000000 PIPEBCONF: 0x80000000 DISPARB: 0x00001d9c CURSOR_A_CONTROL: 0x00000000 CURSOR_B_CONTROL: 0x00000000 CURSOR_A_BASEADDR: 0x00000000 CURSOR_B_BASEADDR: 0x00000000 CURSOR_A_PALETTE: 0x00000000, 0x00000000, 0x00000000, 0x00000000 CURSOR_B_PALETTE: 0x00000000, 0x00000000, 0x00000000, 0x00000000 CURSOR_SIZE: 0x00000000 DSPACNTR: 0x00000000 DSPBCNTR: 0x99000000 DSPABASE: 0x00000000 DSPBBASE: 0x00000000 DSPASTRIDE: 0x00000000 DSPBSTRIDE: 0x00001000 VGACNTRL: 0xa1c4008e ADD_ID: 0x00000000 SWF00 0x00000000 SWF01 0x00000001 SWF02 0x00002008 SWF03 0x00000000 SWF04 0x00000000 SWF05 0x00000000 SWF06 0x00000000 SWF10 0x81000800 SWF11 0x00001c00 SWF12 0x00000000 SWF13 0x54540000 SWF14 0x00000000 SWF15 0x0000020b SWF16 0x00000000 SWF30 0x00000000 SWF31 0x00000000 SWF32 0x00000000 FENCE0 0x00000000 FENCE1 0x00000000 FENCE2 0x00000000 FENCE3 0x00000000 FENCE4 0x00000000 FENCE5 0x00000000 FENCE6 0x00000000 FENCE7 0x00000000 INSTPM 0x00000000 MEM_MODE 0x00000000 FW_BLC_0 0x01080108 FW_BLC_1 0x00000108 HWSTAM 0xffff IER 0x0000 IIR 0x0000 IMR 0xffff hw state dump end intelfb: Changing the video mode is not supported. Console: switching to colour frame buffer device 128x48
つかった Kernel の Version は 2.6.20-rc3 ぐらい.
あと,ついでに frame buffer で X を立ち上げるには,
Section "Device"
Identifier "frame buffer"
Driver "fbdev"
EndSection
Section "Screen"
Identifier "frame buffer screen"
Device "frame buffer"
Monitor "Generic Monitor"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1024x768"
EndSubSection
EndSection
で,あとは Section "ServerLayout" で
Screen "frame buffer screen"
を指定する.というか,普通に使うには,frame buffer は使わず,
Driver "i810"
とするわけですが(X-Video とかが使えるし).
% cat .qmail-hoge-default |exit 100
とかで.
.qmail-hoge-default が置いてない場合は .qmail-default が参照されるわけであるが, .qmail-default を編集したくなくって, .qmail-hoge-hoge とか一部の mail address (のみ)を残しておきたい時の話.
<URL:http://myn.meganecco.org/files/lsmod.rb>
lsmod の 「Used by」 を graphviz でグラフにする.やるきなしなし.
% ./lsmod.rb | neato -Tpng | display -
みたいな感じで使う.
neato の箇所は dot や twopi や circo や fdp でも可, -Tpng の箇所は -Tjpg でも可.

最近どうも Linux で飼っている Windows 上から Network Printing することが多くなって来ていて(Linux で ps もしくは pdf を作成して Windows で印刷),これではだめだと思いはじめたので, LPRng に別れを告げ CUPS (Common UNIX Printing System) を使うことにした.
% sudo apt-get install cupsys % sudo apt-get install cupsys-bsd cupsys-driver-gutenprint cupsys-driver-gimpprint foomatic-filters-ppds cups-pdf hplip
これで lprng が自動的に抜ける(cupsys-bsd と Conflict).
設定は http://localhost:631/ を叩いて,GUI で.
Windows にぶらさがっている printer や, <URL:http://www.ricoh.co.jp/imagio/> とかの LPR 対応ネットワークプリンタの場合, [管理]→[プリンタの追加] から
デバイス URI: lpd://hoge.example.org/CanonPIX
ここで,CanonPIX とかの Printer 名は
% smbclient -L hoge.example.org
とかで探す.
という手順でプリンタを追加. どこかの Page に Windows にぶらさがっている Printer に関しては
smb://hoge.example.org/CanonPIX
とするとか書いてあって若干嵌る.手元の環境では smb:// は N.G. で lpd:// としなければならなかった.
command line から CUPS を使うには,
% echo hoge | a2psj | lpr -P hoge
みたいな感じで lprng と同じ.
[myn:2006122702] の続き.
# apt-get install snmpd # vi /etc/snmp/snmpd.conf com2sec readonly default xxxx (←コミュニティー名)
外の計算機から,
% snmpwalk -c xxxx -v2c 10.0.0.5 laload
とかで check.MRTG も外で動かす.
% cfgmaker xxxx@10.0.0.5 xxxx@10.0.0.6 > /etc/mrtg.cfg
とかで mrtg.cfg の雛型をつくって編集(上記は2台の例になってる).
% indexmaker --columns=1 /etc/mrtg.cfg > index.html
とかで index.html の雛型をつくって編集.あとは cron を仕込む.
玄箱 KURO-BOX への Debian のセットアップメモ.
玄箱うぉううぉう♪の <URL:http://kuro.dsk.jp/data/dist/install_debian_standalone.txt> を参照しつつ.
以下のコマンドを叩く
# /sbin/mfdisk -e /dev/hda # sh /sbin/mkfilesystem.sh
外から ftp で debian_2006_06_10_dist.tgz を /mnt2/share/debian_2006_06_10_dist.tgz に送る
% ftp Name: root Password: kuroadmin ftp> cd /mnt2/share ftp> put debian_2006_06_10_dist.tgz
Debian のイメージを展開.玄箱で以下.
# cd /mnt # tar zxfv /mnt2/share/debian_2006_06_10_dist.tgz
/mnt が / だと思って以下みたいに file を修正.
[/etc/network/interfaces] auto lo iface lo inet loopback iface eth0 inet static address 10.0.0.6 network 10.0.0.0 netmask 255.255.255.0 broadcast 10.0.0.255 gateway 10.0.0.1
ちなみに,
auto eth0 iface eth0 inet dhcp
は,初期(のイメージの)状態では NG っぽい.
[/etc/hosts.allow] ALL : 10.0.0.0/255.255.255.0 ALL : 127.0.0.1 [/etc/resolv.conf] search meganecco.org nameserver 10.0.0.1 # /usr/bin/write_ok
再起動.玄箱で以下.
# /sbin/reboot
失敗した場合は,
裏ボタン長押し→表ボタン長押し→表ボタンを押して起動
して EM モードに.あとは,
# /bin/mount -t ext3 /dev/hda3 /mnt2 # /bin/mount -t ext3 /dev/hda1 /mnt
して設定をいじる.その後,以下で再起動.
# /usr/bin/write_ok # /sbin/reboot
tmp-kun が嫌なので,myn に変更
% su - (pw: root) # vipw myn:x:1000:100:myn the meganecco lover:/home/myn:/bin/bash # vi /etc/shadow tmp-kun を myn に置換 # mkdir /home/myn # chown myn.users /home/myn # passwd myn # passwd (ついでに root の password も変更)
ssh を入れる
# apt-get update # apt-get install ssh
作業用に rsync と less を入れる
# apt-get install rsync # apt-get install less
時間がとちくるっているので ntp を入れる
# apt-get install ntp ntpdate # vi /etc/default/ntp-servers NTPSERVERS="0.debian.pool.ntp.org" # vi /etc/ntp.conf (追記) server 0.debian.pool.ntp.org iburst server 1.debian.pool.ntp.org iburst server 2.debian.pool.ntp.org iburst server 3.debian.pool.ntp.org iburst # /etc/init.d/ntp stop # /etc/init.d/ntpdate start # /etc/init.d/ntp start
NFS の設定
# apt-get install nfs-user-server # apt-get install nfs-common (statd, lockd 用) # vi /etc/export (10.0.0.3 から mount したい場合) /mnt/share 10.0.0.3(rw,async) # /etc/init.d/nfs-user-server stop # /etc/init.d/nfs-user-server start
HDD の性能を見てみる
# apt-get install hdparm # hdparm -t /dev/hda3 /dev/hda3: Timing buffered disk reads: 64 MB in 1.18 seconds = 54.24 MB/sec
玄箱のコンソールで日本語表示ができるようにする
# apt-get install locales # vi /etc/locale.gen ja_JP.EUC-JP EUC-JP # locale-gen
ちなみに,現在 2台動いている状態.
最近 Emacs22 を使いはじめて,
% dpkg -l 'emacs-snapshot*' | grep ^ii ii emacs-snapshot 20061221-1 The GNU Emacs editor (development snapshot) ii emacs-snapshot-bin-common 20061221-1 The GNU Emacs editor's shared, architecture ii emacs-snapshot-common 20061221-1 The GNU Emacs editor's common infrastructure
で,
GNU Emacs 22.0.92.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2006-12-22 on pacem, modified by Debian
みたいな環境なのであるが,なんだか自前の関数の挙動が変だなぁと思ってい たら split-string の挙動が Emacs21 と異っているっぽい.
GNU Emacs 22.0.92.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2006-12-22 on pacem, modified by Debian
(split-string "0123456789" "")
=>("" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "")
(split-string "0123456789" "" t)
=>("0" "1" "2" "3" "4" "5" "6" "7" "8" "9")GNU Emacs 21.4.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2006-12-04 on raven, modified by Debian
(split-string "0123456789" "")
=>("0" "1" "2" "3" "4" "5" "6" "7" "8" "9")
(split-string "0123456789" "" t)
=>エラー上記の例だとわかりにくいが, たとえば以下だと Emacs22 の (subr.el の) 方が素直な気がする.
Emacs22
(split-string "0 1 2" " ") =>("0" "1" "2")
(split-string " 0 1 2" " ") =>("0" "1" "2")Emacs21
(split-string "0 1 2" " ") =>("0" "1" "2")
(split-string " 0 1 2" " ") =>("" "0" "1" "2")ちなみに関係ないが Ruby の String#split の場合は,
"0 1 2".split(/\s+/) =>["0", "1", "2"]
" 0 1 2".split(/\s+/) =>["", "0", "1", "2"]
"0 1 2".split(" ") =>["0", "1", "2"]
" 0 1 2".split(" ") =>["0", "1", "2"]
みたいな.
vmware-any-any-update105 + Linux 2.6.20-rc2 を試す.
Building for VMware Workstation 4.5.[23] or VMware GSX Server 3.1.0. Using 2.6.x kernel build system. make: ディレクトリ `/tmp/vmware-config0/vmmon-only' に入ります make -C /usr/src/linux/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules make[1]: ディレクトリ `/usr/src/linux' に入ります CC [M] /tmp/vmware-config0/vmmon-only/linux/driver.o In file included from /tmp/vmware-config0/vmmon-only/linux/driver.c:85: /tmp/vmware-config0/vmmon-only/./include/compat_kernel.h:21: error: expected declaration specifiers or '...' before 'compat_exit' /tmp/vmware-config0/vmmon-only/./include/compat_kernel.h:21: error: expected declaration specifiers or '...' before 'exit_code' /tmp/vmware-config0/vmmon-only/./include/compat_kernel.h:21: warning: type defaults to 'int' in declaration of '_syscall1' make[2]: *** [/tmp/vmware-config0/vmmon-only/linux/driver.o] エラー 1 make[1]: *** [_module_/tmp/vmware-config0/vmmon-only] エラー 2 make[1]: ディレクトリ `/usr/src/linux' から出ます make: *** [vmmon.ko] エラー 2 make: ディレクトリ `/tmp/vmware-config0/vmmon-only' から出ます Unable to build the vmmon module.
といった感じで /tmp/vmware-config0/vmmon-only/include/compat_kernel.h でこける.これは, <URL:http://www.vmware.com/community/thread.jspa?messageID=538342> にもあるとおり,compat_kernel.h を
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static inline _syscall1(int, compat_exit, int, exit_code); +#endif
といった感じの修正をすればいいっぽい.
あと,vmware-any-any-update105 + Linux 2.6.20-rc2 の場合, vmware-any-any-update104 + Linux 2.6.18-git16 の時に必要だった,
[include/linux/types.h] #ifndef __cplusplus typedef _Bool bool; #endif
とかいう include/linux/types.h の修正は不要っぽい.というかむしろ,上 記のようにしていると,
Building for VMware Workstation 4.5.[23] or VMware GSX Server 3.1.0. Using 2.6.x kernel build system. make: ディレクトリ `/tmp/vmware-config0/vmmon-only' に入ります make -C /usr/src/linux/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules make[1]: ディレクトリ `/usr/src/linux' に入ります CC [M] /tmp/vmware-config0/vmmon-only/linux/driver.o CC [M] /tmp/vmware-config0/vmmon-only/linux/hostif.o CC [M] /tmp/vmware-config0/vmmon-only/common/cpuid.o CC [M] /tmp/vmware-config0/vmmon-only/common/hash.o CC [M] /tmp/vmware-config0/vmmon-only/common/memtrack.o CC [M] /tmp/vmware-config0/vmmon-only/common/phystrack.o CC [M] /tmp/vmware-config0/vmmon-only/common/task.o cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus: warning: command line option "-Wno-pointer-sign" is valid for C/ObjC but not for C++ cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++ cc1plus: warning: command line option "-ffreestanding" is valid for C/ObjC but not for C++ include/linux/kernel.h:161: error: 'bool_type' does not name a type make[2]: *** [/tmp/vmware-config0/vmmon-only/common/task.o] エラー 1 make[1]: *** [_module_/tmp/vmware-config0/vmmon-only] エラー 2 make[1]: ディレクトリ `/usr/src/linux' から出ます make: *** [vmmon.ko] エラー 2 make: ディレクトリ `/tmp/vmware-config0/vmmon-only' から出ます Unable to build the vmmon module.
といった感じで include/linux/kernel.h でこける.
xdvi がなんというか,
% xdvi hoge.dvi FT2: Open Font Error. (min)
とか言って寒く落ちる状態になってしまった.
% xdvi -debug 4 hoge.dvi (snip) xdvi: Define font "cmss8" scale=524288 design=524288 number=80 xdvi: Define font "min10" scale=1162740 design=655360 number=78 FT2: Open Font Error. (min)
ということらしい.よくわからない. Google によると vfontmap 云々の問題ぽいので,
% strace -f xdvi -debug 4 thesis.dvi |& grep vfont
[pid 5303] open("vfontmap", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 5303] open("/var/lib/texmf/vfontmap", O_RDONLY) = 4
とかで探りを入れて,/var/lib/texmf/vfontmap を見てみる.
[/var/lib/texmf/vfontmap] ### This file is automatically generated by update-vfontmap # # Please do not edit this file directly. If you want to change # or add anything please take a look at the files in # /etc/texmf/vfontmap.d, and invoke update-vfontmap. # ### ### From file: /etc/texmf/vfontmap.d/20ptex-jisfonts.map ### For ptex-jisfonts jis /usr/share/fonts/truetype/kochi/kochi-mincho.ttf jisg /usr/share/fonts/truetype/kochi/kochi-gothic.ttf ### End of file: /etc/texmf/vfontmap.d/20ptex-jisfonts.map ### From file: /etc/texmf/vfontmap.d/20xdvik-ja.map @Mincho Roman|Mincho@ rml JIS-H % ASCII pTeX rmlv JIS-V % ASCII pTeX dm JIS-H % NTT jTeX @Gothic SansSerif|Gothic@ gbm JIS-H % ASCII pTeX gbmv JIS-V % ASCII pTeX dg JIS-H % NTT jTeX ### End of file: /etc/texmf/vfontmap.d/20xdvik-ja.map
/etc/texmf/vfontmap.d/* か.
% ls -l /etc/texmf/vfontmap.d/ 合計 4 -rw-r--r-- 1 root root 344 2005-04-07 13:27 20ascii-ptex.map.dpkg-bak -rw-r--r-- 1 root root 119 2005-04-07 13:27 20ntt-jtex.map.dpkg-bak -rw-r--r-- 1 root root 136 2005-05-11 23:58 20ptex-jisfonts.map -rw-r--r-- 1 root root 195 2006-10-13 08:12 20xdvik-ja.map
確かに,
[/etc/texmf/vfontmap.d/20ascii-ptex.map.dpkg-bak ] min /usr/share/fonts/truetype/kochi/kochi-mincho.ttf
とかになっているので,
% dpkg -S /etc/texmf/vfontmap.d/20ascii-ptex.map xdvik-ja: /etc/texmf/vfontmap.d/20ascii-ptex.map
ということで xdvik-ja 付近の問題ぽい.
% sudo rm /etc/texmf/vfontmap.d/*bak % sudo dpkg --purge xdvik-ja % sudo dpkg -i xdvik-ja_22.84.8-j1.22-1_i386.deb % ls -l /etc/texmf/vfontmap.d/ 合計 4 -rw-r--r-- 1 root root 344 2005-04-07 13:27 20ascii-ptex.map -rw-r--r-- 1 root root 119 2005-04-07 13:27 20ntt-jtex.map -rw-r--r-- 1 root root 136 2005-05-11 23:58 20ptex-jisfonts.map -rw-r--r-- 1 root root 195 2006-10-13 08:12 20xdvik-ja.map
と,いう感じで直った模様.
Linux 2.6.19-rc1 以降で shfs が使えない のであきらめて sshfs を使うことにした.
sshfs は FUSE (Filesystem in Userspace) を使って,ssh 越しに filesystem を mount するもの. shfs と違い FUSE は Linux に取り込まれている(fuse.ko)ので, Linux kernel の変化にも追従していっている.
ということで試す.
user 権限で remote.example.org に ssh で login できるとすると, あとは,
% sshfs remote.example.org:/work /home/myn/mnt
とするだけ.ただし,普通にいろいろ怒られたので,メモると,
sshfs から fusermount を叩くのだが,これを実行できなければならない. Debian (sid) の場合,
% ls -l /usr/bin/fusermount -rwsr-x--- 1 root fuse 18368 Sep 10 04:24 /usr/bin/fusermount
という感じなので,fuse group に入る必要がある.
ぐらい(当然 fuse.ko を modprobe しておく必要がある).
ちなみに umount は,
% fusermount -u /home/myn/mnt
という感じで.ちなみに,いろいろ気持ち悪いので,リストすると,
という感じ.
等々の patch のため(他にもあるかも) fs.h が結構変更されてて, 結局追いきれず.
なお [myn:2006090300] は shfs_0.35-6.1 で対応されているみたい.
xdvik-ja と ptex-jisfonts をいじっていたら dvipdfmx が動かなくなった. いつもの,
dvipdfmx hoge.dvi hoge.dvi -> hoge.pdf [1kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+359/600 --dpi 959 rml-jis mktexpk: don't know how to create bitmap font for rml-jis. kpathsea: Appending font creation commands to missfont.log. ** WARNING ** Could not locate a virtual/physical font for TFM "rml-jis". ** WARNING ** >> There are no valid font mapping entry for this font. ** WARNING ** >> Font file name "rml-jis" was assumed but failed to locate that font. ** ERROR ** Cannot proceed without .vf or "physical" font for PDF output...
とかいうやつで.
で,いつも対処法を忘れるのでメモ. <URL:http://oku.edu.mie-u.ac.jp/~okumura/texwiki/?Linux%2FDebian> にあるとおり, /etc/texmf/dvipdfm/dvipdfmx.cfg の最後に
f jis-cjk.map
を追記するだけ.
なんというか,たぶん先月ぐらいから, xdvik-ja と ptex-jisfonts と vfdata-morisawa5 がぶつかっててややこしい.
Package: xdvik-ja Version: 22.84.10-j1.33-1 Conflicts: ptex-jisfonts (<= 2-18), vfdata-morisawa5 (<= 0.0.20020122-11) Package: ptex-jisfonts Version: 2-18 Package: vfdata-morisawa5 Version: 0.0.20020122-12 Conflicts: xdvik-ja (<< 22.84.10)
という感じで.とりえず, xdvik-ja_22.84.8-j1.22-1 は
Package: xdvik-ja Version: 22.84.8-j1.22-1 Conflicts: ptex-jisfonts (<= 2-13), vfdata-morisawa5 (<= 0.0.20020122-7)
という感じなので,vfdata-morisawa5 は捨てて(というか使ってないと思う), ptex-jisfonts_2-18 + xdvik-ja_22.84.8-j1.22-1 で凌ごうかと思う.
2.6.18-git15 から 2.6.18-git16 へにかけての, [PATCH] Generic boolean という patch のために,vmmon.o の compile でこける.
gcc -m32 -Wp,-MD,/tmp/vmware-config0/vmmon-only/common/.task.o.d -nostdinc -isystem /usr/lib/gcc/i486-linux-gnu/4.1.2/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Os -pipe -msoft-float -mpreferred-stack-boundary=2 -march=i686 -ffreestanding -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI=1 -Iinclude/asm-i386/mach-default -fomit-frame-pointer -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -Wall -Wstrict-prototypes -DVME_DEFAULT=VME_V452 -DVMW_USING_KBUILD -DVMMON -DVMCORE -I/tmp/vmware-config0/vmmon-only/./include -I/tmp/vmware-config0/vmmon-only/./common -I/tmp/vmware-config0/vmmon-only/./linux -I/tmp/vmware-config0/vmmon-only/./vmcore -DVMW_NOPAGE_261 -DVMWARE__FIX_IO_APIC_BASE=FIX_IO_APIC_BASE_0 -DVMW_HAVE_EPOLL -DVMW_HAVE_COMPILE_H -DVMW_HAVE_SET_USER_NICE -x c++ -fno-exceptions -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(task)" -D"KBUILD_MODNAME=KBUILD_STR(vmmon)" -c -o /tmp/vmware-config0/vmmon-only/common/.tmp_task.o /tmp/vmware-config0/vmmon-only/common/task.c include/linux/stddef.h:16: error: expected identifier before 'false' include/linux/stddef.h:16: error: expected `}' before 'false' include/linux/stddef.h:16: error: expected unqualified-id before 'false' include/linux/types.h:36: error: expected initializer before 'bool' /tmp/vmware-config0/vmmon-only/common/task.c:43: error: expected declaration before '}' token make[2]: *** [/tmp/vmware-config0/vmmon-only/common/task.o] エラー 1
といった感じで.以下の箇所が問題らしい.
[include/linux/stddef.h]
enum {
false = 0,
true = 1
};
[include/linux/types.h]
typedef _Bool bool;
これ以上は追えず.
ちなみにこの patch は 2.6.19-rc1 にも含まれているので,同様.
悩んでみたが,どう対処したらいいのか良く判らなかった... あんまり宜しくない対応だが,上記 kernel header の箇所を comment out す ると vmmon.o (の task.c) の compile がとおるようになる模様.
上記 gcc の option は -x c++ になっていて, つまり c++ で compile しているわけであるが, false やら true やら bool があらかじめ c++ に用意されているためにこけているらしい.
とはいえどう対処したものか...といった感じではあるが, とりあえず上述の問題の kernel header の部分を
#ifndef __cplusplus typedef _Bool bool; #endif
とかするのが吉っぽい.
Linux 上で VMware (w/any-any-update104) を使っているのであるが, Linux 2.6.18-git1 以降だと vmnet.o の compile でこける.
include/linux/skbuff.h で [NET]: Replace CHECKSUM_HW by CHECKSUM_PARTIAL/CHECKSUM_COMPLETE という変更があったことに起因するらしい.
vmnet.tar 中の bridge.c と userif.c に関して CHECKSUM_HW となっている箇所を CHECKSUM_PARTIAL に置換すれば OK ぽい.
NFS 上で排他ロックできないー,とかもがいていたら, statd が動いていなかった.
こういう時,10.0.0.200 を NFS server とすると,
lockd: cannot monitor 10.0.0.200 lockd: failed to monitor 10.0.0.200
みたいなエラーが出る(dmesg). [myn:2004111600] も同様の原因だったのかも.
あと,排他ロックのテストは以下ぐらいで.
% ruby -e 'f=open(".lock","w"); f.flock(File::LOCK_EX)'
ロックに失敗したら例外を吐きます.
firefox で general.useragent.extra.firefox を default のものから Netscape/7.2 に 変更 していたのであるが, この状態だと,Gmail で クイック コンタクト (Quick Contact) が表示されないらしい.
ずっと,なんで クイック コンタクト が消えたのか悩んでいたのであるが, うーん,なんというか.