Chinaunix首页 | 论坛 | 博客
  • 博客访问: 241877
  • 博文数量: 137
  • 博客积分: 5005
  • 博客等级: 上校
  • 技术积分: 1360
  • 用 户 组: 普通用户
  • 注册时间: 2005-03-25 09:21
个人简介

每天进步一点点

文章分类

全部博文(137)

文章存档

2016年(1)

2013年(2)

2012年(30)

2011年(42)

2006年(27)

2005年(35)

分类: LINUX

2005-04-13 13:37:32

本文试图用最简单的语言告诉你怎样在2.6写自己的udev规则 从而可以自己为设备命名

Udev allows you to customise the naming of device nodes. There are two reasons why you might want to do this: convenience, and persistent naming.

Default udev rules are stored in /etc/udev/rules.d/50-udev.rules.
You can creat your own rules in a file at /etc/udev/rules.d/10-local.rules
Example:

If I insert my U disk in fedora3 the system will creat a node automatically as /dev/sdb1

then  #udevinfo -q path -n /dev/lp0
        #/block/sdb/sdb1
then  #udevinfo -a -p /sys/class/usb/lp0 

You can find a detailed information about this U disk

vi your 10-local.rules  addbo

BUS="usb", SYSFS{serial}="0000:00:07.2", NAME="U-disk"

 You can find that your U disk will be detected as "U-disk" 

阅读(1389) | 评论(0) | 转发(0) |
0

上一篇:什么叫做x86

下一篇:常用文件重定向命令

给主人留下些什么吧!~~