udev: new dasd_id tool
PATCH 1/1 udev: new dasd_id tool
The currently used uid (volume label) for s390 DASD devices is not really unique. For that reason a unique uid sysfs-attribute for DASD devices has been introduced. This new dasd_id tool replaces the current one and evaluates this new sysfs attribute. In case it is not available, dasd_id returns the old volume label instead.
---
etc/udev/debian/persistent.rules | 2 etc/udev/redhat/50-udev.rules | 2 etc/udev/rules.d/60-persistent-storage.rules | 4 etc/udev/slackware/udev.rules | 2 etc/udev/suse/60-persistent-storage.rules | 2 extras/dasd_id/dasd_id.8 | 68 +- extras/dasd_id/dasd_id.c | 731 +++++++++++++++++++++------ 7 files changed, 636 insertions(+), 175 deletions(-)
etc/udev/debian/persistent.rules +1 -1
@@ -30,7 +30,7 @@ KERNEL="sd*[!0-9]|sr*|st*", ENV{ID_SER IMPORT{program}="scsi_id -g -x -a -s $devpath -d $tempnode" KERNEL="dasd*[!0-9]", \ - IMPORT{program}="dasd_id --export $tempnode" + IMPORT{program}="dasd_id -u -e -d $tempnode" KERNEL="*[!0-9]", \ IMPORT{program}="edd_id --export $tempnode"
etc/udev/redhat/50-udev.rules +1 -1
@@ -277,7 +277,7 @@ KERNEL="sd*[!0-9]|sr*", SYSFS{ieee1394_ KERNEL="sd*[!0-9]|sr*", ENV{ID_SERIAL}="", IMPORT{program}="/lib/udev/usb_id -x" KERNEL="sd*[!0-9]|sr*", ENV{ID_SERIAL}="", IMPORT{program}="/lib/udev/scsi_id -g -x -s %p -d $tempnode" KERNEL="sd*[!0-9]|sr*", ENV{ID_SERIAL}="", IMPORT{program}="/lib/udev/scsi_id -g -x -a -s %p -d $tempnode" -KERNEL="dasd*[!0-9]", IMPORT{program}="/lib/udev/dasd_id --export $tempnode" +KERNEL="dasd*[!0-9]", IMPORT{program}="/lib/udev/dasd_id -u -e -d $tempnode" KERNEL="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}" # for partitions import parent information
etc/udev/rules.d/60-persistent-storage.rules +3 -1
@@ -23,7 +23,9 @@ KERNEL="sd*[!0-9]|sr*|st*", ATTRS{ieee1 KERNEL="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}="", IMPORT{program}="usb_id -x" KERNEL="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode" KERNEL="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode" -KERNEL="dasd*[!0-9]", IMPORT{program}="dasd_id --export $tempnode" +KERNEL="dasd*[!0-9]", IMPORT{program}="dasd_id -u -e -d $tempnode" +KERNEL="dasd*[!0-9]", ENV{ID_SERIAL}="?*", SYMLINK+="dasd/$env{ID_SERIAL}/device" +KERNEL="dasd*[0-9]", ENV{ID_SERIAL}="?*", SYMLINK+="dasd/$env{ID_SERIAL}/part%n" KERNEL="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}" KERNEL="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n" KERNEL="st*", ENV{ID_SERIAL}="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
etc/udev/slackware/udev.rules +1 -1
@@ -60,7 +60,7 @@ KERNEL="sd*[!0-9]|sr*", SYSFS{ieee1394_ KERNEL="sd*[!0-9]|sr*", ENV{ID_SERIAL}="", IMPORT{program}="/lib/udev/usb_id -x" KERNEL="sd*[!0-9]|sr*", ENV{ID_SERIAL}="", IMPORT{program}="/lib/udev/scsi_id -g -x -s %p -d $tempnode" KERNEL="sd*[!0-9]|sr*", ENV{ID_SERIAL}="", IMPORT{program}="/lib/udev/scsi_id -g -x -a -s %p -d $tempnode" -KERNEL="dasd*[!0-9]", IMPORT{program}="/lib/udev/dasd_id --export $tempnode" +KERNEL="dasd*[!0-9]", IMPORT{program}="/lib/udev/dasd_id -u -e -d $tempnode" KERNEL="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}" # for partitions import parent information
etc/udev/suse/60-persistent-storage.rules +1 -1
@@ -23,7 +23,7 @@ KERNEL="sd*[!0-9]|sr*|st*", ATTRS{ieee1 KERNEL="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}="", IMPORT{program}="usb_id -x" KERNEL="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode" KERNEL="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode" -KERNEL="dasd*[!0-9]", IMPORT{program}="dasd_id --export $tempnode" +KERNEL="dasd*[!0-9]", IMPORT{program}="dasd_id -u -e -d $tempnode" KERNEL="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}" KERNEL="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n" KERNEL="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}="?*", ENV{ID_VENDOR}="ATA", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL_SHORT}"
extras/dasd_id/dasd_id.8 +51 -17
79 lines not on this page · raw message
extras/dasd_id/dasd_id.c +577 -153
831 lines not on this page · raw message
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 11 lines · Volker Sameske
The currently used uid (volume label) for s390 DASD devices is not really unique. For that reason a unique uid sysfs-attribute for DASD devices has been introduced. This new
dasd_idtool replaces the current one and evaluates this new sysfs attribute. In case it is not available,dasd_idreturns the old volume label instead.etc/udev/debian/persistent.rules | 2 etc/udev/redhat/50-udev.rules | 2 etc/udev/slackware/udev.rules | 2 etc/udev/suse/60-persistent-storage.rules | 2
You can't patch any of these rules, they are usually copies _from_ the distro as examples, not _to_ the distro.
Quoted 3 lines
- * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License.
Why do you want to remove the license?
extras/dasd_id/dasd_id.c line 42
Quoted 5 lines
extras/dasd_id/dasd_id.c +0
-5- value =getenv ("UDEV_LOG" ); -if (value) - udev_log =log_priority (value); -else - udev_log =LOG_ERR ;
Why don't we want that anymore?
extras/dasd_id/dasd_id.c static unsigned char EBCtoASC[256] 0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, · line 331
Quoted 5 lines
extras/dasd_id/dasd_id.c +5
-0+static int dinfo_create_devnode (dev_t dev,char ** devno) +{ +char * result; +char * pathname[] = {"/dev" ,getenv ("TMPDIR" ),"/tmp" , +getenv ("HOME" ),"." ,"/" };
What's are you trying to fight here? That's absolutely not needed, just let udev provide you a temporary node, or use /dev, which is obviously always writable in a udev setup.
extras/dasd_id/dasd_id.c static unsigned char EBCtoASC[256] 0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, · line 449
Quoted 2 lines
extras/dasd_id/dasd_id.c +2
-0+sprintf (tmp,"/sys/bus/ccw/devices/%s/" , busid); + directory =opendir (tmp);
You can't reference /sys/bus/ directly, look at udev_sysfs.c, how to do it.
extras/dasd_id/dasd_id.c static unsigned char EBCtoASC[256] 0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, · line 452
Quoted 2 lines
extras/dasd_id/dasd_id.c +2
-0+while ((dir_entry =readdir (directory)) !=NULL ) { +if (strncmp (dir_entry->d_name,"block:" ,6 ) =0 ) {
You can't use these links, they will go away some day.
extras/dasd_id/dasd_id.c static unsigned char EBCtoASC[256] 0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, · line 590
Quoted 3 lines
extras/dasd_id/dasd_id.c +3
-0+sscanf (uname_buf.release,"%d.%d" , &version,&release); +if (strcmp (uname_buf.sysname,"Linux" ) || + version <2 || release <6 ) {
No need for that, there is no udev for kernels < 2.6.
Instead of all that, can't you just read the values from sysfs with udev using $attr{} in a rule, and possibly fall back to the old tool only if you don't find the values there?
Thanks,
Kay
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 7 lines
Quoted 4 lines
etc/udev/debian/persistent.rules | 2 etc/udev/redhat/50-udev.rules | 2 etc/udev/slackware/udev.rules | 2 etc/udev/suse/60-persistent-storage.rules | 2You can't patch any of these rules, they are usually copies _from_ the distro as examples, not _to_ the distro.
Good point, I'll remove these 4 chunks.
Quoted 7 lines
Quoted 1 line
- * This program is free software; you can redistribute it
and/or modify it
Quoted 1 line
- * under the terms of the GNU General Public License as
published by the
Quoted 1 line
- * Free Software Foundation version 2 of the License.
Why do you want to remove the license?
Right, but I did not really remove it. I wrote a new tool with a new header. And I have to follow IBM directives, how such a header has to look like. But it is still GPL.
Quoted 7 lines
extras/dasd_id/dasd_id.c line 42
Quoted 5 lines
extras/dasd_id/dasd_id.c +0
-5- value =getenv ("UDEV_LOG" ); -if (value) - udev_log =log_priority (value); -else - udev_log =LOG_ERR ;Why don't we want that anymore?
Well, initially I wrote a new tool for the multipath-tools package. It was called dasdinfo. To a later point in time the idea came to replace the existing udev dasd_id with it. So even if the patch looks like I've changed dasd_id, I wrote a new tool.
But good point. I'll think about adding these lines.
Quoted 9 lines
extras/dasd_id/dasd_id.c static unsigned char EBCtoASC[256] 0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, · line 331
Quoted 5 lines
extras/dasd_id/dasd_id.c +5
-0+static int dinfo_create_devnode (dev_t dev,char ** devno) +{ +char * result; +char * pathname[] = {"/dev" ,getenv ("TMPDIR" ),"/tmp" , +getenv ("HOME" ),"." ,"/" };What's are you trying to fight here? That's absolutely not needed, just let udev provide you a temporary node, or use /dev, which is obviously always writable in a udev setup.
Agree, if this would be only a udev-tool. But this tool will be also used within multipath-tools and there I have to create my own temporary device nodes. So I can't remove that.
Quoted 4 lines
extras/dasd_id/dasd_id.c static unsigned char EBCtoASC[256] 0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, · line 449
Quoted 2 lines
extras/dasd_id/dasd_id.c +2
-0+sprintf (tmp,"/sys/bus/ccw/devices/%s/" , busid); + directory =opendir (tmp);You can't reference
/sys/bus/directly, look atudev_sysfs.c, how to do
it.
Initially I had a sysfs-mountpoint detection. But it has been removed during a long discussion about that topic and after some review cycles. There are many many other tools with hard-coded sysfs mount points.
And this sysfs-mount-point-detection takes some time since it will be done for every device. And there could be several hundred DASD devices on a single IBM System z.
Quoted 10 lines
extras/dasd_id/dasd_id.c static unsigned char EBCtoASC[256] 0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, · line 452
Quoted 2 lines
extras/dasd_id/dasd_id.c +2
-0+while ((dir_entry =readdir (directory)) !=NULL ) { +if (strncmp (dir_entry->d_name,"block:" ,6 ) =0 ) {You can't use these links, they will go away some day.
extras/dasd_id/dasd_id.c static unsigned char EBCtoASC[256] 0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, · line 590
Quoted 3 lines
extras/dasd_id/dasd_id.c +3
-0+sscanf (uname_buf.release,"%d.%d" , &version,&release); +if (strcmp (uname_buf.sysname,"Linux" ) || + version <2 || release <6 ) {No need for that, there is no udev for kernels < 2.6.
Yes, but since this tools is not only used for udev I'll keep this check.
Quoted 3 lines
Instead of all that, can't you just read the values from sysfs with udev using $attr{} in a rule, and possibly fall back to the old tool only if you don't find the values there?
Yes, if udev would be the only exploiter of this tool. Udev is one of the main exploiter, but not the single one.
I'll wait some more time in case there are some more comments. Then I'll post the changed patch.
thank you and regards,
Volker
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 57 lines · Volker Sameske
Quoted 7 lines
Quoted 4 lines
etc/udev/debian/persistent.rules | 2 etc/udev/redhat/50-udev.rules | 2 etc/udev/slackware/udev.rules | 2 etc/udev/suse/60-persistent-storage.rules | 2You can't patch any of these rules, they are usually copies _from_ the distro as examples, not _to_ the distro.
Good point, I'll remove these 4 chunks.
Quoted 7 lines
Quoted 1 line
- * This program is free software; you can redistribute it
and/or modify it
Quoted 1 line
- * under the terms of the GNU General Public License as
published by the
Quoted 1 line
- * Free Software Foundation version 2 of the License.
Why do you want to remove the license?
Right, but I did not really remove it. I wrote a new tool with a new header. And I have to follow IBM directives, how such a header has to look like. But it is still GPL.
Quoted 7 lines
extras/dasd_id/dasd_id.c line 42
Quoted 5 lines
extras/dasd_id/dasd_id.c +0
-5- value =getenv ("UDEV_LOG" ); -if (value) - udev_log =log_priority (value); -else - udev_log =LOG_ERR ;Why don't we want that anymore?
Well, initially I wrote a new tool for the multipath-tools package. It was called dasdinfo. To a later point in time the idea came to replace the existing udev
dasd_idwith it. So even if the patch looks like I've changeddasd_id, I wrote a new tool.
But good point. I'll think about adding these lines.Quoted 9 lines
extras/dasd_id/dasd_id.c static unsigned char EBCtoASC[256] 0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, · line 331
Quoted 5 lines
extras/dasd_id/dasd_id.c +5
-0+static int dinfo_create_devnode (dev_t dev,char ** devno) +{ +char * result; +char * pathname[] = {"/dev" ,getenv ("TMPDIR" ),"/tmp" , +getenv ("HOME" ),"." ,"/" };What's are you trying to fight here? That's absolutely not needed, just let udev provide you a temporary node, or use /dev, which is obviously always writable in a udev setup.
Agree, if this would be only a udev-tool. But this tool will be also used within multipath-tools and there I have to create my own temporary device nodes. So I can't remove that.
Quoted 4 lines
extras/dasd_id/dasd_id.c static unsigned char EBCtoASC[256] 0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, · line 449
Quoted 2 lines
extras/dasd_id/dasd_id.c +2
-0+sprintf (tmp,"/sys/bus/ccw/devices/%s/" , busid); + directory =opendir (tmp);You can't reference
/sys/bus/directly, look atudev_sysfs.c, how to doit.
Quoted 7 lines
Initially I had a sysfs-mountpoint detection. But it has been removed during a long discussion about that topic and after some review cycles. There are many many other tools with hard-coded sysfs mount points.
And this sysfs-mount-point-detection takes some time since it will be done for every device. And there could be several hundred DASD devices on a single IBM System z.
No that's not what I mean, /sys is even hard-coded in udev, only overwritable for the test-suite. But /sys/block may live
in /sys/subsystem/block and all that stuff that is queued at the moment for sysfs changes. There will be backwards compat-links in sysfs for existing apps to work, but in the udev tree, nothing new is accepted, that relies on the compat-links.
Quoted 11 lines
Quoted 10 lines
extras/dasd_id/dasd_id.c static unsigned char EBCtoASC[256] 0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, · line 452
Quoted 2 lines
extras/dasd_id/dasd_id.c +2
-0+while ((dir_entry =readdir (directory)) !=NULL ) { +if (strncmp (dir_entry->d_name,"block:" ,6 ) =0 ) {You can't use these links, they will go away some day.
extras/dasd_id/dasd_id.c static unsigned char EBCtoASC[256] 0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, · line 590
Quoted 3 lines
extras/dasd_id/dasd_id.c +3
-0+sscanf (uname_buf.release,"%d.%d" , &version,&release); +if (strcmp (uname_buf.sysname,"Linux" ) || + version <2 || release <6 ) {No need for that, there is no udev for kernels < 2.6.
Quoted 8 lines
Yes, but since this tools is not only used for udev I'll keep this check.
Quoted 3 lines
Instead of all that, can't you just read the values from sysfs with udev using $attr{} in a rule, and possibly fall back to the old tool only if you don't find the values there?
Yes, if udev would be the only exploiter of this tool. Udev is one of the main exploiter, but not the single one.
Oh, then your tool probably doesn't want to hide in /lib/udev/ too, right? The udev tarball does not want to carry around generic or generally useful tools, only things which are private to udev and can be changed to our needs without really caring about possible other users.
It may make sense, to remove the current tool from the udev tree, so this udev version can just rely on the sysfs-value to be present.
Your new tool would go into its own package, from a distribution point of view. Packagers can still use and integrate the new tool into udev-rules, if they really feel the need for that kind of compatibility, which I don't expect for udev's need.
Does that make sense?
Thanks,
Kay
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 5 lines · Kay Sievers
Quoted 2 lines · Volker Sameske
Yes, if udev would be the only exploiter of this tool. Udev is one of the main exploiter, but not the single one.
Quoted 7 lines
Oh, then your tool probably doesn't want to hide in
/lib/udev/too, right? The udev tarball does not want to carry around generic or generally useful tools, only things which are private to udev and can be changed to our needs without really caring about possible other users.It may make sense, to remove the current tool from the udev tree, so this udev version can just rely on the sysfs-value to be present.
Kay -
The same is true for scsi_id, it's used by both udev and multipath.
-- Patrick Mansfield
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 11 lines · Patrick Mansfield
Quoted 10 lines · Kay Sievers
Quoted 2 lines · Volker Sameske
Yes, if udev would be the only exploiter of this tool. Udev is one of the main exploiter, but not the single one.
Oh, then your tool probably doesn't want to hide in
/lib/udev/too, right? The udev tarball does not want to carry around generic or generally useful tools, only things which are private to udev and can be changed to our needs without really caring about possible other users.
Quoted 4 lines
Quoted 2 lines
It may make sense, to remove the current tool from the udev tree, so this udev version can just rely on the sysfs-value to be present.
The same is true for
scsi_id, it's used by both udev and multipath.
It's true, but not the same. Scsi_id is there for ages, and we install a symlink in /sbin for that reason. That will not happen for new tools, especially not when the information is available in sysfs today.
Thanks,
Kay
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 6 lines
No that's not what I mean, /sys is even hard-coded in udev, only overwritable for the test-suite. But
/sys/blockmay live
in/sys/subsystem/blockand all that stuff that is queued at the moment for sysfs changes. There will be backwards compat-links in sysfs for existing apps to work, but in the udev tree, nothing new is accepted, that relies on the compat-links.
Okay, now I see your point. I can change that.
Quoted 2 lines
Oh, then your tool probably doesn't want to hide in
/lib/udev/too, right?
Right
Quoted 6 lines
The udev tarball does not want to carry around generic or generally useful tools, only things which are private to udev and can be changed to our needs without really caring about possible other users.
It may make sense, to remove the current tool from the udev tree, so this udev version can just rely on the sysfs-value to be present.
No, since the uid sysfs attribute is new and not part of older distributions. Without that uid attribute we have to open the device to read the not really unique volume label. So dasd_id still needs to be part of udev.
Quoted 4 lines
Your new tool would go into its own package, from a distribution point of view. Packagers can still use and integrate the new tool into udev-rules, if they really feel the need for that kind of compatibility, which I don't expect for udev's need.
Would be one approach. But if this tool goes into the multipath package we had an udev dependency on the mp-tools package. Since every Linux user uses udev and only a subset uses the multipath package we would force some users to install mp-tool, even if they don't need it. The other way around would be better.
Quoted 1 line
Does that make sense?
I understand your point. But what you suggest is to have two different tools for udev and mp-tools wich implement the same functionality. That's something I would like to avoid.
regards,
Volker
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 8 lines · Volker Sameske
Quoted 6 lines
No that's not what I mean, /sys is even hard-coded in udev, only overwritable for the test-suite. But
/sys/blockmay live
in/sys/subsystem/blockand all that stuff that is queued at the moment for sysfs changes. There will be backwards compat-links in sysfs for existing apps to work, but in the udev tree, nothing new is accepted, that relies on the compat-links.Okay, now I see your point. I can change that.
Fine.
Quoted 4 lines
Quoted 2 lines
Oh, then your tool probably doesn't want to hide in
/lib/udev/too, right?Right
The current multipath already uses the current dasd_id in /lib/udev?
Quoted 11 lines
Quoted 6 lines
The udev tarball does not want to carry around generic or generally useful tools, only things which are private to udev and can be changed to our needs without really caring about possible other users.
It may make sense, to remove the current tool from the udev tree, so this udev version can just rely on the sysfs-value to be present.
No, since the uid sysfs attribute is new and not part of older distributions. Without that uid attribute we have to open the device to read the not really unique volume label. So
dasd_idstill needs to be part of udev.
Well, we usually don't care about backwards compat in that direction. A udev version can simply require a minimal kernel version, and this should be fine.
But how do we handle people already using the current persistent links? Your new tool creates different names for the same devices on recent kernels, right?
Quoted 11 lines
Quoted 4 lines
Your new tool would go into its own package, from a distribution point of view. Packagers can still use and integrate the new tool into udev-rules, if they really feel the need for that kind of compatibility, which I don't expect for udev's need.
Would be one approach. But if this tool goes into the multipath package we had an udev dependency on the mp-tools package. Since every Linux user uses udev and only a subset uses the multipath package we would force some users to install mp-tool, even if they don't need it. The other way around would be better.
Quoted 5 lines
Quoted 1 line
Does that make sense?
I understand your point. But what you suggest is to have two different tools for udev and mp-tools wich implement the same functionality. That's something I would like to avoid.
Right, that's always good to avoid.
Thanks,
Kay
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 1 line
The current multipath already uses the current
dasd_idin/lib/udev?
Yes, the current mp-tools package calls the symlink /sbin/dasd_id
Quoted 7 lines
Well, we usually don't care about backwards compat in that direction. A udev version can simply require a minimal kernel version, and this should be fine.
But how do we handle people already using the current persistent links? Your new tool creates different names for the same devices on recent kernels, right?
Yes. If the new uid is available in a distribution dasd_id returns:
ID_BUSÌw
ID_TYPE=disk
ID_SERIAL=IBM.75000000092461.4d00.34
if not, you'll get:
ID_BUSÌw
ID_TYPE=disk
ID_SERIAL=0X4D34
Quoted 1 line
Right, that's always good to avoid.
So you can see my problem :)
regards,
Volker
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 18 lines · Volker Sameske
Quoted 1 line
The current multipath already uses the current
dasd_idin/lib/udev?Yes, the current mp-tools package calls the symlink
/sbin/dasd_idQuoted 7 lines
Well, we usually don't care about backwards compat in that direction. A udev version can simply require a minimal kernel version, and this should be fine.
But how do we handle people already using the current persistent links? Your new tool creates different names for the same devices on recent kernels, right?
Yes. If the new uid is available in a distribution
dasd_idreturns:ID_BUSÌw
ID_TYPE=disk
ID_SERIAL=IBM.75000000092461.4d00.34
Quoted 5 lines
if not, you'll get:
ID_BUSÌw
ID_TYPE=disk
ID_SERIAL=0X4D34
So, how do we handle possible users who use the old name? Always create both links? Warn on update?
Quoted 2 lines
Quoted 1 line
Right, that's always good to avoid.
So you can see my problem :)
Yes and no, it would be fine in its own package too, I think. But let's solve the real problems first ...
Thanks,
Kay
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 1 line
Quoted 1 line
Quoted 1 line
Well, we usually don't care about backwards compat in that
direction. A
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
udev version can simply require a minimal kernel version, and this should be fine.
But how do we handle people already using the current persistent
links?
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines
Your new tool creates different names for the same devices on recent kernels, right?
Yes. If the new uid is available in a distribution
dasd_idreturns:ID_BUSÌw
ID_TYPE=disk
ID_SERIAL=IBM.75000000092461.4d00.34
Quoted 8 lines
Quoted 5 lines
if not, you'll get:
ID_BUSÌw
ID_TYPE=disk
ID_SERIAL=0X4D34So, how do we handle possible users who use the old name? Always create both links? Warn on update?
I see your point, but from my experiences changes like new sysfs attributes only come with new versions of a distribution or with bigger updates, e.g. SUSE service packs or RedHat Updates.
I do not see a problem with new versions of distributions, e.g. SLES9 -> SLES10. New distribution, new device nodes, new game.
If the change comes with a service pack within the lifetime of a distribution it is a distributors decision what to do. They could just change the device nodes and affected system tools (e.g. yast) and document that possibly some user tools needs to be adapted too.
Or the distributor decides do create both device nodes using two different udev rules. I could add a --old option to dasd_id which always returns the old version. The current implementation decides itself which version to return.
But I would prefer the first approach. The old uid is not unique. So using these device nodes could lead in worst case to data loss.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 42 lines · Volker Sameske
Quoted 1 line
Quoted 1 line
Quoted 1 line
Well, we usually don't care about backwards compat in that
direction. A
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
udev version can simply require a minimal kernel version, and this should be fine.
But how do we handle people already using the current persistent
links?
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines
Your new tool creates different names for the same devices on recent kernels, right?
Yes. If the new uid is available in a distribution
dasd_idreturns:ID_BUSÌw
ID_TYPE=disk
ID_SERIAL=IBM.75000000092461.4d00.34Quoted 8 lines
Quoted 5 lines
if not, you'll get:
ID_BUSÌw
ID_TYPE=disk
ID_SERIAL=0X4D34So, how do we handle possible users who use the old name? Always create both links? Warn on update?
I see your point, but from my experiences changes like new sysfs attributes only come with new versions of a distribution or with bigger updates, e.g. SUSE service packs or RedHat Updates.
I do not see a problem with new versions of distributions, e.g. SLES9 -> SLES10. New distribution, new device nodes, new game.
If the change comes with a service pack within the lifetime of a distribution it is a distributors decision what to do. They could just change the device nodes and affected system tools (e.g. yast) and document that possibly some user tools needs to be adapted too.
Or the distributor decides do create both device nodes using two different udev rules. I could add a --old option todasd_idwhich always returns the old version. The current implementation decides itself which version to return.
Quoted 2 lines
But I would prefer the first approach. The old uid is not unique. So using these device nodes could lead in worst case to data loss.
Well, for a distributor, which doesn't support the old names, there is no need for that tool at all then, because he can just rely on the sysfs attribute with the same result. :)
You should probably add the old name to the --export switch, so udev can create both links if needed. Can the old version be computed from the sysfs value, or do we need to read it from the device?
Kay
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 3 lines
Well, for a distributor, which doesn't support the old names, there is no need for that tool at all then, because he can just rely on the sysfs attribute with the same result. :)
Well, SLES9 and RHEL4 support the old names and I am not sure if the new uid attribute is already part of them.
Quoted 2 lines
You should probably add the old name to the --export switch, so udev can create both links if needed.
Yes, I can do that. --export could return:
ID_BUSÌw
ID_TYPE=disk
ID_SERIAL=IBM.75000000092461.4d00.34
ID_SERIAL_OLD=0X4D34
Quoted 2 lines
Can the old version be computed from the sysfs value, or do we need to read it from the device?
It has to be read from the device, usually from the third block. The root user can change it to nearly any 6-char string. That's the reason it is not unique.
So, let me summarize the options I see:
(1) Replace the old dasd_id with the new dasd_id which implements the new uid and some additional stuff (e.g. temp. device nodes) which is required to use the uid also for the multipath tools.
(2) Enhance the existing dasd_id to be able to handle the new uids and include my new tool with a different name into the mp-tools package. We had two tools wich implement the same functionality twice and using different ways.
(3) Leave the old dasd_id as it is (only supporting volume labels) and implement the new uid additionally only with udev instruments, without calling an external tool. Not sure if this is possible. So we had two different device nodes (volume label und uid). I would try to get my new tool into the mp-tools package using a different name.
(4) Move dasd_id from udev to mp-tools which would create a dependency on mp-tools.
Did I miss one? In my opinion (2) and (4) are options we definitely do not want.
regards,
Volker
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel