2016年6月21日 星期二

Linux: How to find the device driver used for a device?

Linux: How to find the device driver used for a device?
http://unix.stackexchange.com/questions/41817/linux-how-to-find-the-device-driver-used-for-a-device

#!/bin/bash
for f in /sys/class/net/*; do
    dev=$(basename $f)
    driver=$(readlink $f/device/driver/module)
    if [ $driver ]; then
        driver=$(basename $driver)
    fi
    addr=$(cat $f/address)
    operstate=$(cat $f/operstate)
    printf "%10s [%s]: %10s (%s)\n" "$dev" "$addr" "$driver" "$operstate"
done


2016年6月12日 星期日

[git-svn] customized branch checkout

To clone the SVN repo that is not standard layout, only part of the branches are required.

Edit .git/config:

[svn-remote "svn"]
        url = http://blabla.com/svn/
        fetch = foo1/bar1:refs/remotes/svn/bar1
        branches = foo2/{bar2,bar3, bar4}:refs/remotes/svn/*
        branches = foo3/{bar5}:refs/remotes/svn/*

Checkout only certain branches with git-svn · GitHub
https://gist.github.com/trodrigues/1023167