summaryrefslogtreecommitdiff
path: root/namedev.h
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-02-16 21:44:28 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:32:28 -0700
commit50e5de03d16be3e35e65cdf65f552807ad24e996 (patch)
tree46c83042e99cf64eb308ac6bd47fab4f75525733 /namedev.h
parentbb7386472466e55f75df024d18e8da37a222bb41 (diff)
[PATCH] udev - create all partitions of blockdevice
Here is the first try to create all partitons of a blockdevice, since removable media devices may need to acces the expected partition to revalidate the media. It uses the attribute syntax introduced with the last %s{file} patch. I'm using this with my multi-slot-flash-card-reader: SYSFS{model}="USB Storage-SMC ", NAME{all_partitions}="smartmedia" SYSFS{model}="USB Storage-CFC ", NAME{all_partitions}="compactflash" SYSFS{model}="USB Storage-MSC ", NAME{all_partitions}="memorystick" SYSFS{model}="USB Storage-MMC ", NAME{all_partitions}="multimedia" and I get: tree /udev/ /udev/ |-- memorystick |-- memorystick1 |-- memorystick10 |-- memorystick11 |-- memorystick12 |-- memorystick13 |-- memorystick14 |-- memorystick15 |-- memorystick2 |-- memorystick3 |-- memorystick4 |-- memorystick5 |-- memorystick6 |-- memorystick7 |-- memorystick8 |-- memorystick9 |-- multimedia |-- multimedia1 |-- multimedia10 |-- multimedia11 |-- multimedia12 |-- multimedia13 |-- multimedia14 |-- multimedia15 |-- multimedia2 |-- multimedia3 |-- multimedia4 |-- multimedia5 |-- multimedia6 |-- multimedia7 |-- multimedia8 |-- multimedia9 ... If needed, we can make the number of partions to create adjustable with the attribute?
Diffstat (limited to 'namedev.h')
-rw-r--r--namedev.h43
1 files changed, 24 insertions, 19 deletions
diff --git a/namedev.h b/namedev.h
index e38c4f5257..10a5dcaf0c 100644
--- a/namedev.h
+++ b/namedev.h
@@ -28,25 +28,29 @@
struct sysfs_class_device;
-#define BUS_SIZE 30
-#define FILE_SIZE 50
-#define VALUE_SIZE 100
-#define ID_SIZE 50
-#define PLACE_SIZE 50
-#define PROGRAM_SIZE 100
-
-#define FIELD_BUS "BUS"
-#define FIELD_SYSFS "SYSFS"
-#define FIELD_ID "ID"
-#define FIELD_PLACE "PLACE"
-#define FIELD_PROGRAM "PROGRAM"
-#define FIELD_RESULT "RESULT"
-#define FIELD_KERNEL "KERNEL"
-#define FIELD_NAME "NAME"
-#define FIELD_SYMLINK "SYMLINK"
-
-#define PROGRAM_MAXARG 10
-#define MAX_SYSFS_PAIRS 5
+#define BUS_SIZE 30
+#define FILE_SIZE 50
+#define VALUE_SIZE 100
+#define ID_SIZE 50
+#define PLACE_SIZE 50
+#define PROGRAM_SIZE 100
+
+#define FIELD_BUS "BUS"
+#define FIELD_SYSFS "SYSFS"
+#define FIELD_ID "ID"
+#define FIELD_PLACE "PLACE"
+#define FIELD_PROGRAM "PROGRAM"
+#define FIELD_RESULT "RESULT"
+#define FIELD_KERNEL "KERNEL"
+#define FIELD_NAME "NAME"
+#define FIELD_SYMLINK "SYMLINK"
+
+#define ATTR_PARTITIONS "all_partitions"
+#define PARTITIONS_COUNT 15
+
+
+#define PROGRAM_MAXARG 10
+#define MAX_SYSFS_PAIRS 5
struct sysfs_pair {
char file[FILE_SIZE];
@@ -65,6 +69,7 @@ struct config_device {
char name[NAME_SIZE];
char symlink[NAME_SIZE];
struct sysfs_pair sysfs_pair[MAX_SYSFS_PAIRS];
+ int partitions;
int config_line;
};