Bug#934589: udev: net.ifnames is wrongly imported as a property for any/all devices

Michael Biebl biebl at debian.org
Tue Aug 13 16:44:29 BST 2019


Am 12.08.19 um 12:56 schrieb quidame:
> Package: udev
> Version: 241-7
> Severity: normal
> 
> Dear Maintainer,
> 
> When running a command such as:
> 
>     udevadm info --query property --export --name /dev/dm-2
> 
> I expect to get a list of properties of the device (/dev/dm-2) in a
> shell-parsable format - that is the purpose of the --export option.
> 
> So I could do, in a shell script:
> 
>     eval $(udevadm info --query property --export --name /dev/dm-2)
> 
> 
> This works fine, except when net.ifnames is set as a kernel commandline
> parameter. In that case, net.ifnames is added as a property for the
> devicei, and the same udevadm command gives...
> 
>     DEVPATH='/devices/virtual/block/dm-2'
>     DEVNAME='/dev/dm-2'
>     DEVTYPE='disk'
>     MAJOR='253'
>     MINOR='2'
>     SUBSYSTEM='block'
>     USEC_INITIALIZED='2145169'
>     DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG='1'
>     DM_UDEV_PRIMARY_SOURCE_FLAG='1'
>     DM_UDEV_RULES='1'
>     DM_UDEV_RULES_VSN='2'
>     DM_NAME='test1_vg-var'
>     DM_UUID='LVM-JDjOejCnj59z49qRaUFXieNPfyeJvWmzfVc31bebpEfCIHd3H3aJmgJbt9od0QGf'
>     DM_SUSPENDED='0'
>     DM_VG_NAME='test1_vg'
>     DM_LV_NAME='var'
>     ID_FS_UUID='1acc2657-541f-4226-97aa-58183b5e38dc'
>     ID_FS_UUID_ENC='1acc2657-541f-4226-97aa-58183b5e38dc'
>     ID_FS_VERSION='1.0'
>     ID_FS_TYPE='ext4'
>     ID_FS_USAGE='filesystem'
> =>  net.ifnames='1'
>     DEVLINKS='/dev/test1_vg/var /dev/disk/by-uuid/1acc2657-541f-4226-97aa-58183b5e38dc /dev/disk/by-id/dm-name-test1_vg-var /dev/mapper/test1_vg-var /dev/disk/by-id/dm-uuid-LVM-JDjOejCnj59z49qRaUFXieNPfyeJvWmzfVc31bebpEfCIHd3H3aJmgJbt9od0QGf'
>     TAGS=':systemd:'
> 
> ...making the output unparsable, due to the invalid format of the
> variable: in shell, a dot (.) is not a valid character for a variable
> name !


--export says

      -x, --export
           Print output as key/value pairs. Values are enclosed in
single quotes. This takes effects only when --query=property or
--device-id-of-file=FILE is
           specified.

It doesn't claim that this is a shell parseable format which can be run
through eval, so I don't think you can rely on that.

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20190813/b9a9e852/attachment.sig>


More information about the Pkg-systemd-maintainers mailing list