2004-04-02 12:38:59 +07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
RULES=label_test.rules
|
|
|
|
CONFIG=label_test.conf
|
|
|
|
|
|
|
|
export UDEV_TEST=yes
|
|
|
|
export SYSFS_PATH=$PWD/sys/
|
|
|
|
export UDEV_CONFIG_FILE=$PWD/$CONFIG
|
|
|
|
|
|
|
|
cat > $RULES << EOF
|
2004-04-02 12:51:17 +07:00
|
|
|
SYSFS{address}="00:e0:00:8d:9f:25", NAME="wireless"
|
2004-04-02 12:38:59 +07:00
|
|
|
EOF
|
|
|
|
|
|
|
|
cat > $CONFIG << EOF
|
|
|
|
udev_root="$PWD/udev/"
|
2004-11-06 20:28:01 +07:00
|
|
|
udev_db="$PWD/udev/.udevdb"
|
2004-04-02 12:38:59 +07:00
|
|
|
udev_rules="$PWD/$RULES"
|
|
|
|
EOF
|
|
|
|
|
|
|
|
mkdir udev
|
|
|
|
|
|
|
|
export ACTION=add
|
2004-04-02 12:51:17 +07:00
|
|
|
export DEVPATH=class/net/eth1
|
2004-04-02 12:38:59 +07:00
|
|
|
|
2004-04-02 12:51:17 +07:00
|
|
|
../udevtest class/net/eth1 net
|
2004-04-02 12:38:59 +07:00
|
|
|
ls -l udev
|
|
|
|
|
|
|
|
export ACTION=remove
|
2004-04-02 12:51:17 +07:00
|
|
|
export DEVPATH=class/net/eth1
|
2004-04-02 12:38:59 +07:00
|
|
|
|
2004-04-02 14:36:58 +07:00
|
|
|
../udevtest class/net/eth1 net
|
2004-04-02 12:38:59 +07:00
|
|
|
ls -l udev
|
|
|
|
|
|
|
|
rm $RULES
|
|
|
|
rm $CONFIG
|
|
|
|
rm -rf udev
|