Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 561102 - sys-kernel/genkernel: mdev creates a device node with incorrect name
Summary: sys-kernel/genkernel: mdev creates a device node with incorrect name
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2015-09-22 08:07 UTC by Göktürk Yüksek
Modified: 2016-12-09 21:13 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Proposed fix (0001-Add-a-mdev-rule-to-rename-hw_random-to-hwrng.patch,1.45 KB, patch)
2015-09-22 08:09 UTC, Göktürk Yüksek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Göktürk Yüksek archtester gentoo-dev 2015-09-22 08:07:19 UTC
When mdev is invoked to populate /dev (mdev -s), it creates the node for the hardware random number generator (major 10, minor 183) with the incorrect name. This is because the linux kernel uses 'hw_random' for the /sys entry and 'hwrng' for the /dev entry. As a result, when mdev scans /sys/class, it finds the entry '/sys/class/misc/hw_random/dev' and creates /dev/hw_random.

When combined with the kernel option 'CONFIG_DEVTMPFS', this results in having two nodes under /dev (namely 'hw_random' and 'hwrng) that point to the same device. This currently breaks sys-apps/rng-tools (bug 481254).

The use of 'hw_random' has been obselete for 6 years [1]. Kernel exposes no mechanism for mdev to figure out the node name automatically. I propose a patch that utilizes 'mdev.conf' to manually rename 'hw_random' to 'hwrng'.

[1] http://marc.info/?l=linux-crypto-vger&m=144249767024990&w=2


Reproducible: Always
Comment 1 Göktürk Yüksek archtester gentoo-dev 2015-09-22 08:09:02 UTC
Created attachment 412510 [details, diff]
Proposed fix

Applied on top of 59bdd8e568cd9d084da4c8fc9590913d7e84f16e.
Comment 2 Göktürk Yüksek archtester gentoo-dev 2015-09-22 08:45:15 UTC
Corresponding pull request: https://github.com/gentoo/genkernel/pull/1
Comment 3 Richard Yao (RETIRED) gentoo-dev 2015-09-22 08:57:20 UTC
Nice fix. This is in git:

https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=4bcbeed54876ceff3d0ca315352152997c61c4b5
Comment 4 Göktürk Yüksek archtester gentoo-dev 2016-01-24 22:11:05 UTC
I think this is included in v3.4.52.4 (e41248f3b0dd6be529abf2c08aec4971e2d751bc) which is in the tree now. Any reason to keep this open?
Comment 5 SpanKY gentoo-dev 2016-12-09 21:13:28 UTC
i pushed a fix in upstream mdev.conf too

https://git.busybox.net/busybox/commit/?id=2098c3511cfa0e79c5d6e19e41a74ef19bcf91af