From 16378373cb9d96e5d424921806ff71f218e92694 Mon Sep 17 00:00:00 2001 From: "kay.sievers@vrfy.org" Date: Tue, 17 Feb 2004 01:27:01 -0800 Subject: [PATCH] [PATCH] udev - switch SYSFS_file to SYSFS{file} Here we switch the configs and man pages to the new attribute syntax. Also the 'partition trick' is mentioned in udev.8 I think it's more clear visible now, that inside the brackets are user supplied values used and not some magic keys handled: 'SYSFS_dev' is now 'SYSFS{dev}' The old syntax is still supported. --- etc/udev/udev.rules | 4 ++-- etc/udev/udev.rules.gentoo | 6 +++--- test/label_test | 4 ++-- test/udev-test.pl | 36 ++++++++++++++++++------------------ udev.8 | 15 +++++++++++---- udevinfo.8 | 2 +- udevinfo.c | 2 +- 7 files changed, 38 insertions(+), 31 deletions(-) diff --git a/etc/udev/udev.rules b/etc/udev/udev.rules index 344304dd9..e1c2cbe91 100644 --- a/etc/udev/udev.rules +++ b/etc/udev/udev.rules @@ -5,13 +5,13 @@ BUS="scsi", PROGRAM="/bin/echo -n test-%b", RESULT="test-42:0:0:1", NAME="%c" # A usb camera. -BUS="usb", SYSFS_vendor="FUJIFILM", SYSFS_model="M100", NAME="camera%n" +BUS="usb", SYSFS{vendor}="FUJIFILM", SYSFS{model}="M100", NAME="camera%n" # USB Epson printer to be called lp_epson BUS="usb", SYSFS_serial="HXOLL0012202323480", NAME="lp_epson" # USB HP printer to be called lp_hp -BUS="usb", SYSFS_serial="W09090207101241330", NAME="lp_hp" +BUS="usb", SYSFS{serial}="W09090207101241330", NAME="lp_hp" # sound card with PCI bus id 00:0b.0 to be the first sound card BUS="pci", ID="00:0b.0", NAME="dsp" diff --git a/etc/udev/udev.rules.gentoo b/etc/udev/udev.rules.gentoo index 0c53df535..b3ca04222 100644 --- a/etc/udev/udev.rules.gentoo +++ b/etc/udev/udev.rules.gentoo @@ -23,13 +23,13 @@ BUS="scsi", PROGRAM="/bin/echo -n test-%b", RESULT="test-42:0:0:1", NAME="%c" # A usb camera. -BUS="usb", SYSFS_vendor="FUJIFILM", SYSFS_model="M100", NAME="camera%n" +BUS="usb", SYSFS{vendor}="FUJIFILM", SYSFS{model}="M100", NAME="camera%n" # USB Epson printer to be called lp_epson -BUS="usb", SYSFS_serial="HXOLL0012202323480", NAME="lp_epson" +BUS="usb", SYSFS{serial}="HXOLL0012202323480", NAME="lp_epson" # USB HP printer to be called lp_hp -BUS="usb", SYSFS_serial="W09090207101241330", NAME="lp_hp" +BUS="usb", SYSFS{serial}="W09090207101241330", NAME="lp_hp" # sound card with PCI bus id 00:0b.0 to be the first sound card BUS="pci", ID="00:0b.0", NAME="dsp" diff --git a/test/label_test b/test/label_test index 93d02c18f..b99a4acd5 100644 --- a/test/label_test +++ b/test/label_test @@ -8,8 +8,8 @@ export SYSFS_PATH=$PWD/sys/ export UDEV_CONFIG_FILE=$PWD/$CONFIG cat > $RULES << EOF -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" +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" EOF cat > $CONFIG << EOF diff --git a/test/udev-test.pl b/test/udev-test.pl index 7459f8ff5..e238c909f 100644 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -38,7 +38,7 @@ my @tests = ( devpath => "block/sda", expected => "boot_disk" , conf => < "block/sda/sda1", expected => "boot_disk1" , conf => < "block/sda/sda1", expected => "boot_disk1" , conf => < "block/sda/sda1", expected => "boot_disk1" , conf => < "block/sda/sda1", expected => "boot_disk1" , conf => < "block/sda", expected => "disk-IBM-ESXS-sda" , conf => < "class/tty/console", expected => "TTY" , conf => < "class/tty/console", expected => "foo" , conf => < "block/sda/sda2", expected => "1/2/a/b/symlink" , conf => < "block/sda/sda2", expected => "1/2/symlink" , conf => < "block/sda/sda2", expected => "1/2/c/d/symlink" , conf => < "block/sda", expected => "boot_disk15" , conf => < "class/tty/ttyUSB0", expected => "visor" , conf => <name, value); + printf(" SYSFS{%s}=\"%s\"\n", attr->name, value); } } printf("\n"); -- 2.30.2