2003-10-22 15:14:59 +07:00
|
|
|
#!/bin/bash
|
|
|
|
|
2003-12-03 23:13:53 +07:00
|
|
|
RULES=label_test.rules
|
|
|
|
CONFIG=label_test.conf
|
|
|
|
|
2003-10-22 15:14:59 +07:00
|
|
|
export UDEV_TEST=yes
|
2003-11-12 22:23:39 +07:00
|
|
|
export SYSFS_PATH=$PWD/sys/
|
2003-12-03 23:13:53 +07:00
|
|
|
export UDEV_CONFIG_FILE=$PWD/$CONFIG
|
|
|
|
|
|
|
|
cat > $RULES << EOF
|
2004-02-17 16:27:01 +07:00
|
|
|
BUS="scsi", SYSFS{vendor}="IBM-ESXS", SYSFS{model}="ST336605LW !#", NAME="boot_diskX%n"
|
|
|
|
BUS="scsi", SYSFS{vendor}="IBM-ESXS", SYSFS{model}="ST336605LW !#", NAME="boot_disk%n"
|
2003-12-03 23:13:53 +07:00
|
|
|
EOF
|
|
|
|
|
|
|
|
cat > $CONFIG << EOF
|
|
|
|
udev_root="$PWD/udev/"
|
|
|
|
udev_db="$PWD/udev/.udev.tdb"
|
|
|
|
udev_rules="$PWD/$RULES"
|
|
|
|
udev_permissions="$PWD/udev.permissions"
|
|
|
|
EOF
|
2003-10-22 15:14:59 +07:00
|
|
|
|
2003-12-18 13:41:04 +07:00
|
|
|
mkdir udev
|
|
|
|
|
2003-10-22 15:14:59 +07:00
|
|
|
export ACTION=add
|
2003-11-12 23:35:40 +07:00
|
|
|
export DEVPATH=block/sda
|
2003-10-22 15:14:59 +07:00
|
|
|
|
|
|
|
../udev block
|
2003-12-04 08:37:29 +07:00
|
|
|
ls -l udev
|
2003-11-12 23:35:40 +07:00
|
|
|
|
|
|
|
export DEVPATH=block/sda/sda3
|
|
|
|
|
|
|
|
../udev block
|
2003-12-04 08:37:29 +07:00
|
|
|
ls -l udev
|
2003-11-19 15:39:43 +07:00
|
|
|
|
|
|
|
export ACTION=remove
|
|
|
|
export DEVPATH=block/sda
|
|
|
|
|
|
|
|
../udev block
|
2003-12-04 08:37:29 +07:00
|
|
|
ls -l udev
|
2003-11-19 15:39:43 +07:00
|
|
|
|
|
|
|
export DEVPATH=block/sda/sda3
|
|
|
|
|
|
|
|
../udev block
|
2003-12-04 08:37:29 +07:00
|
|
|
ls -l udev
|
2003-11-12 23:35:40 +07:00
|
|
|
|
|
|
|
|
2003-12-03 23:13:53 +07:00
|
|
|
rm $RULES
|
|
|
|
rm $CONFIG
|
2003-12-18 13:41:04 +07:00
|
|
|
rm -rf udev
|