2013-05-05

Ubuntu13.04アップグレード後のWifiドライバ(RT5390)

アップグレード後からWifiが使えなくなってしまった。
ここのサイトによると、 LinuxKernel3.8から、ドライバー挙動の一部が変更になったようだ。
自力でパッチを作ってみた。

diff --git a/os/linux/pci_main_dev.c b/os/linux/pci_main_dev.c
index 8031615..8f5a2e1 100644
--- a/os/linux/pci_main_dev.c
+++ b/os/linux/pci_main_dev.c
@@ -39,8 +39,13 @@
 /*extern int rt28xx_close(IN struct net_device *net_dev); */
 /*extern int rt28xx_open(struct net_device *net_dev); */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
 static VOID __devexit rt2860_remove_one(struct pci_dev *pci_dev);
 static INT __devinit rt2860_probe(struct pci_dev *pci_dev, const struct pci_device_id  *ent);
+#else
+static VOID rt2860_remove_one(struct pci_dev *pci_dev);
+static INT rt2860_probe(struct pci_dev *pci_dev, const struct pci_device_id  *ent);
+#endif
 static void __exit rt2860_cleanup_module(void);
 static int __init rt2860_init_module(void);
 
@@ -59,7 +64,11 @@ static int rt2860_resume(struct pci_dev *pci_dev);
 /* */
 /* Ralink PCI device table, include all supported chipsets */
 /* */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
 static struct pci_device_id rt2860_pci_tbl[] __devinitdata =
+#else
+static struct pci_device_id rt2860_pci_tbl[] =
+#endif
 {
 #ifdef RT3090
  {PCI_DEVICE(NIC_PCI_VENDOR_ID, NIC3090_PCIe_DEVICE_ID)},
@@ -94,7 +103,9 @@ static struct pci_driver rt2860_driver =
     name:       RTMP_DRV_NAME,
     id_table:   rt2860_pci_tbl,
     probe:      rt2860_probe,
-#if LINUX_VERSION_CODE >= 0x20412
+#if LINUX_VERSION_CODE >=  KERNEL_VERSION(3,8,0)
+    remove:     rt2860_remove_one,
+#elif LINUX_VERSION_CODE >= 0x20412
     remove:     __devexit_p(rt2860_remove_one),
 #else
     remove:     __devexit(rt2860_remove_one),
@@ -299,7 +310,11 @@ module_exit(rt2860_cleanup_module);
 /* */
 /* PCI device probe & initialization function */
 /* */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
 static INT __devinit   rt2860_probe(
+#else
+static INT rt2860_probe(
+#endif
     IN  struct pci_dev              *pci_dev, 
     IN  const struct pci_device_id  *pci_id)
 {
@@ -470,7 +485,11 @@ err_out:
 }
 
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
 static VOID __devexit rt2860_remove_one(
+#else
+static VOID rt2860_remove_one(
+#endif
     IN  struct pci_dev  *pci_dev)
 {
  PNET_DEV net_dev = pci_get_drvdata(pci_dev);

2013-05-04

Ubuntu13.04アップグレード後の「New release '13.04' available.」表示

Ubuntuのアップグレードをしても、コンソールに次のようなメッセージができるようだ。


New release '13.04' available.
Run 'do-release-upgrade' to upgrade to it.
解決方法はこのリンク先。 Update available message after installing update

2013-02-24

fluentdを試用してみた

使った感想は以下のとおり。 完全にサーバーサイドのプログラム。
テストしたバージョンは、0.10.31
何かの参考になれば幸い。
  1.  xmlもどきの設定ファイルで操作する。
  2. <source>
    type dstat
    tag  dstat.origin
    option -cmdn
    delay   5
    </source>
    
  3.  重要な要素はsourceとmatch
  4.  タグの名前で振る舞いを切り分ける
  5.  ファイルへ書き込みコンソールへ出力など処理を増やしたいときはtype:copyを使用する
  6.  プラグインが豊富だが、source/match用どちらの用途かは一見しただけではわからない。
  7.  プラグインの作り方の説明はドキュメントだけではわかりづらい。組み込み/既存のソースを見ることも必要となる
  8.  正規表現で要素を切り分けるので、正規表現を使い慣れていない人は大変かも
  9. (?<host>[^ ]*)
    
    よく出てくるこれは、「host」という名前(正規表現の説明によれば名前付き捕獲式集合)をつけて、スペース以外の文字を0文字以上の意味。 ここでハット(^)マークはカッコの中なので先頭ではなく否定として使われる。 => 単語となる。
  10. メッセージが複雑なときはフィルター(exec_filter)でなんとかなる。でもout_formatがjsonだとバッファリングが発生して出力時間がもったいないことになる。出力タイプはmsgpackを使おう。
  11. exec_filterでmsgpackを使うときはprintで出力すること。putsは改行マークが付いておかしなことになる。
  12. exec_filterで起動させるスクリプトは、常時起動状態になる。ロギングをしている限り、終了することはない。
  13. 設定を読みこませるときは、「pkill -HUP -f fluentd」