From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: [BUG, Patch] udev_volume_id -d option is broken
Date: Tue, 08 Feb 2005 19:46:48 +0000 [thread overview]
Message-ID: <1107892008.5536.8.camel@localhost.localdomain> (raw)
In-Reply-To: <200501281441.26113.cborntra@de.ibm.com>
On Mon, 2005-02-07 at 19:39 +0100, Christian Borntraeger wrote:
> Kay Sievers <kay.sievers@vrfy.org> wrote:
>
> [...]
> > If you have a chance to try the version in udev-051 on one of these
> > boxes, it would be nice to know if it is still working as expected. I
> > have moved the dasd label reading into a restructured version of the
> > volume_id library now.
> >
>
> Yes - sort of. Using -d alone works fine, but prints a lot of information:
>
> [root@tel22fe dev]# DEVPATH=/block/dasdb/dasdb1 /sbin/udev_volume_id -d
> F:disklabel
> T:dasd
> V:
> L:0XCE3E
> N:0XCE3E
> U:
>
> Usually, you are only interested in the volume lavel for your udev rule,
> so, you might combine -d with -l. Unfortunately that does not work. It
> also failed with udev 50....but it worked with udev 24 IIRC.
Hmm, bad, sorry. Thanks for testing it.
...
> Of course, vid->usage_id is != VOLUME_ID_FILESYSTEM if you read a volume
> label.
> Therefore, the "-l" option does not work on a dasd.
>
> I see 2 posibilities:
>
> 1: Make -d -l working, by changing this if statement
>
> 2: change the meaning of -d : only print the volume label
This should work to print only the label. I've applied this to my tree
and it will appear in the next release.
Thanks again,
Kay
diff -Nru a/extras/volume_id/udev_volume_id.c b/extras/volume_id/udev_volume_id.c
--- a/extras/volume_id/udev_volume_id.c 2005-02-08 20:41:16 +01:00
+++ b/extras/volume_id/udev_volume_id.c 2005-02-08 20:41:16 +01:00
@@ -89,7 +89,7 @@
struct sysfs_class_device *class_dev_parent = NULL;
struct volume_id *vid = NULL;
char *devpath;
- char probe_main_device = 0;
+ char probe_disk_label = 0;
char print = 'a';
static char name[VOLUME_ID_LABEL_SIZE];
int len, i, j;
@@ -116,7 +116,7 @@
print = 'u';
continue;
case 'd':
- probe_main_device = 1;
+ probe_disk_label = 1;
continue;
case 'h':
case '?':
@@ -146,8 +146,7 @@
goto exit;
}
- if (probe_main_device = 0) {
- /* open block device */
+ if (probe_disk_label = 0) {
vid = open_classdev(class_dev);
if (vid = NULL)
goto exit;
@@ -205,7 +204,8 @@
printf("%s\n", vid->type);
break;
case 'l':
- if (name[0] = '\0' || vid->usage_id != VOLUME_ID_FILESYSTEM) {
+ if (name[0] = '\0' ||
+ (vid->usage_id != VOLUME_ID_FILESYSTEM && vid->usage_id != VOLUME_ID_DISKLABEL)) {
rc = 2;
goto exit;
}
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id\x14396&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
prev parent reply other threads:[~2005-02-08 19:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-28 13:41 [BUG, Patch] udev_volume_id -d option is broken Christian Bornträger
2005-01-30 4:36 ` Kay Sievers
2005-02-04 13:59 ` Kay Sievers
2005-02-07 18:39 ` Christian Borntraeger
2005-02-08 19:46 ` Kay Sievers [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1107892008.5536.8.camel@localhost.localdomain \
--to=kay.sievers@vrfy.org \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).