2011/04/19

Using mii-tool/ethtools to sniff status of network interface

When I am trying using mii-tool on my new develop environment, Some error occur, and the log message like below:
# mii-tool -V mii-tool.c 1.9 2000/04/28 00:56:08 (David Hinds) SIOCGMIIPHY on 'eth0' failed: Operation not supported no MII interfaces found
Then I google this problem find out, mii-tool has lot of bug, and some net drivers didn't support it. So, I am trying using ethtool which have more compatibility. And it work great!!
# ethtool eth0 Settings for eth0: Supported ports: [ TP MII ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Advertised auto-negotiation: Yes Speed: 100Mb/s Duplex: Full Port: MII PHYAD: 1 Transceiver: internal Auto-negotiation: on Link detected: yes
So, If just want to know about network status, Maybe ethtool is better than mii-tool, But, unfortunately, I still need to resolving mii-tool's problem for our environment. So, If you meet the trouble about "no MII interfaces found", make sure the mii-tool is follow up the newest one release. It would possible make the trouble disappear...or not...OTZ

2011/04/13

Mac OS disable/enable .DS_Store

Mac OS will create .DS_Store on Network Disk. And it would confused the other operation system user. This is the way to disable auto create .DS_Store. defaults write com.apple.desktopservices DSDontWriteNetworkStores true

vbindiff : Good tools for compare binary files.

vbindiff is a graphical windows tools for compare binary file. It can easy find out what bytes different in ASCII or EBCDIC mode. more information in manual page :) SYNOPSIS vbindiff file1 [ file2 ] DESCRIPTION Movement Keys ------------- Up Move one line (16 bytes) towards the beginning of the file Down Move one line (16 bytes) towards the end of the file Left Move one byte towards the beginning of the file Right Move one byte towards the end of the file PageUp Move one page towards the beginning of the file PageDn Move one page towards the end of the file Home Move to the beginning of the file End Move to the end of the (shorter) file F Search for a string or byte sequence G Move to a specified file position Other Keys ---------- Enter Move to the next difference between the files Space (same as Enter) C Toggle between ASCII and EBCDIC display E Edit currently displayed section of file Esc Exit VBinDiff Q Exit VBinDiff

2011/04/12

SD card automount for Embedded Linux

If we want to using SD card auto mount.

Please reference manual page of command "mdev".

#  mdev --helpBusyBox v1.18.4 (2011-04-01 22:32:35 CST) multi-call binary.
Usage: mdev [-s]
-s      Scan /sys and populate /dev during system boot
It can be run by kernel as a hotplug helper. To activate it: echo /sbin/mdev > /proc/sys/kernel/hotplug

It uses /etc/mdev.conf with lines[-]DEVNAME UID:GID PERM [>|=PATH] [@|$|*PROG]

 

Follow above information.

step 1. make sure build the feature "hotplug" to kernel

step 2. edit /etc/mdev.conf like below :

sd.*    0:0     660     */sbin/automount.sh     $MDEV

mmc.*   0:0     660     */sbin/automount.sh     $MDEV

step 3. add /sbin/automount.sh like below:

 

automount

 

step 4.  Add command at /etc/rc.d/rc.sysinit

# echo /sbin/mdev > /proc/sys/kernel/hotplug

2011/04/11

Bash Introduction (4/12)

4/12 Present in Alphanetworks.