Hide Forgot
Description of problem: When running udevadm info --query=env, I get a list of values back that are not quoted. For most, this isn't a problem, but something like DEVLINKS, which is a space separated list, it doesn't get set correctly. Version-Release number of selected component (if applicable): udev-147-2.29.el6.x86_64 How reproducible: Steps to Reproduce: 1. udevadm info --query=env --name=sda 2. Results in DEVLINKS=<space separated list with no quotes) 3. Actual results: # eval $(udevadm info --query=env --name=sda) bash: /dev/disk/by-id/ata-QEMU_HARDDISK_QM00001: Permission denied Note: DEVLINKS=/dev/block/8:0 /dev/disk/by-id/ata-QEMU_HARDDISK_QM00001 /dev/disk/by-id/scsi-SATA_QEMU_HARDDISK_QM00001 /dev/disk/by-path/pci-0000:00:01.1-scsi-0:0:0:0 Expected results: No Error Additional info: This is being used in RHEV-H in an eval call like above. We are working around it by manually inserting quotes with a sed script
This was also reproduced upstream in udev-153-4.fc13.x86_64
I added a new query type "shproperty" alias "shenv": $ udevadm info --query=shproperty --name=/dev/sda UDEV_LOG='3' DEVPATH='/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda' ... UDISKS_ATA_SMART_IS_AVAILABLE='1' DEVLINKS='/dev/block/8:0 /dev/disk/by-id/ata-APPLE_SSD_TS128B_60CS105MT4RZ /dev/disk/by-id/scsi-SATA_APPLE_SSD_TS128_60CS105MT4RZ /dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0' $ eval $(udevadm info --query=shenv --name=/dev/sda) $ echo $DEVLINKS /dev/block/8:0 /dev/disk/by-id/ata-APPLE_SSD_TS128B_60CS105MT4RZ /dev/disk/by-id/scsi-SATA_APPLE_SSD_TS128_60CS105MT4RZ /dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0
(In reply to comment #5) > I added a new query type "shproperty" alias "shenv": > > $ udevadm info --query=shproperty --name=/dev/sda > UDEV_LOG='3' > DEVPATH='/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda' > ... > UDISKS_ATA_SMART_IS_AVAILABLE='1' > DEVLINKS='/dev/block/8:0 /dev/disk/by-id/ata-APPLE_SSD_TS128B_60CS105MT4RZ > /dev/disk/by-id/scsi-SATA_APPLE_SSD_TS128_60CS105MT4RZ > /dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0' > > $ eval $(udevadm info --query=shenv --name=/dev/sda) > $ echo $DEVLINKS > /dev/block/8:0 /dev/disk/by-id/ata-APPLE_SSD_TS128B_60CS105MT4RZ > /dev/disk/by-id/scsi-SATA_APPLE_SSD_TS128_60CS105MT4RZ > /dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 Changed the parameter to be in sync with upstream. It is now: --query=property --export $ udevadm info --query=property --export --name=/dev/sda ...
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Previously, the output of the command "udevadm info --query=property" could not be used as input to shell interpreters. This update adds "--query=property --export", which changes the output to be shell parseable.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-0525.html