2008年4月7日 星期一

Trace32 在 Ubuntu 上抓不到USB device

by http://blog.richliu.com/2008/04/07/581/

上會抓不到 device, 在 Gentoo 上並沒有這樣的問題.
這是因為 device 預設不會建立相容目錄 /proc/bus/ .

這時候就要修改 /etc/init.d/mountdevsubfs.sh , 找到

#
# Magic to make /proc/bus/ work
#
mkdir -p /dev/bus//.usbfs
domount usbfs "" /dev/bus//.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus//devices
mount --rbind /dev/bus/ /proc/bus/

將最後四行的 "#" unmark 掉.

然後建立 system group 給 的使用者
sudo addgroup --system usbusers
# Output GID 128

# 加入 USER 到 usbusers 群組.
sudo adduser $USER usbusers

# 修改 /etc/fstab:
sudo vim /etc/fstab

# 加上這一行.
# 128 是"usbusers" 的 GID
none /proc/bus/ usbfs devgid=128,devmode=664 0 0

重開機之後, 執行 t32usbchecker , 大功告成

# ./t32usbchecker

simple Checker

Checking /proc/bus//001/001 ... not useable
Checking /proc/bus//001/004 ... not useable
Checking /proc/bus//001/005 ... not useable
Checking /proc/bus//001/006 ... not useable
Checking /proc/bus//001/007 ... not useable
Checking /proc/bus//002/001 ... not useable
Checking /proc/bus//003/001 ... not useable
Checking /proc/bus//004/001 ... not useable
Checking /proc/bus//004/003 ... useable

Checking communication with /proc/bus//004/003 ...
Resetting ...

communication OK.

其他如果有需要用到 /proc/bus/ 的程式也可以用這種解法, 例如 VirtualBox

Ref.
Bug #156085 in kvm (Ubuntu Gutsy) Could not open /proc/bus/usb/devices

沒有留言: