Skip to contentSkip to conversation

Fixes for makedevs

PATCH New Peter Kjellerstedt 1 participant 2 messages May 31, 2013

lore
Share & tools
lore
#0 lore raw

v4 cover Fixes for makedevs

When I wanted to create devices from a package I stumbled upon a couple of problems with the makedevs program. Most notable was that it failed to set the correct uid/gid for devices created as part of a block (i.e., with a count > 0).

PATCH v2: And now with Signed-off-by lines, as requested.

PATCH v3: Also made count for blocks of devices behave as a count rather than the end (noticed after looking a makedevs.c from BusyBox).

PATCH v4: Added a Signed-off-by to the fifth patch. Will only resend it as the other patches have already been accepted.
The following changes since commit efb8a460d2a977dbd481a0650fba8eb637c65bec:

package.bbclass: Fix sources contents (2013-05-14 08:52:47 +0300)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib pkj/makedevs
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=pkj/makedevs

Peter Kjellerstedt (5):
makedevs: Create blocks of devices with the correct uid/gid
makedevs: Correct the device number calculation for blocks of devices
makedevs: Make the mode number readable in debug messages
makedevs: Avoid unnecessary timestamp calculation
makedevs: Make count actually behave as a count for device blocks

 meta/files/device_table-minimal.txt                   |  2 +-
 .../makedevs/makedevs-1.0.0/makedevs.c                | 19 +++++++++----------
 2 files changed, 10 insertions(+), 11 deletions(-)
Signature · 1 line
1.8.2.1
#1 lore raw

PATCH v4 5/5 makedevs: Make count actually behave as a count for device blocks

Previously count actually behaved as end, and did not take start into account.

---
 meta/files/device_table-minimal.txt                      | 2 +-
 meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
meta/files/device_table-minimal.txt +1 -1
index c6e5463..02ed534 100644
@@ -13,7 +13,7 @@
 /dev/apm_bios	c	660	0	46	10	134	-	-	-
 /dev/fb0	c	600	0	0	29	0	-	-	-
 /dev/hda	b	660	0	6	3	0	-	-	-
-/dev/hda	b	660	0	6	3	1	1	1	20
+/dev/hda	b	660	0	6	3	1	1	1	19
 /dev/kmem	c	640	0	15	1	2	-	-	-
 /dev/kmsg	c	600	0	0	1	11	-	-	-
 /dev/mem	c	640	0	15	1	1	-	-	-
meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c +1 -1
index 4bb316b..6c1f2fb 100644
@@ -219,7 +219,7 @@ static int interpret_table_entry(char *line)
 			dev_t rdev;
 			char buf[80];
 
-			for (i = start; i < count; i++) {
+			for (i = start; i < start + count; i++) {
 				sprintf(buf, "%s%d", name, i);
 				sprintf(path, "%s/%s%d", rootdir, name, i);
 				/* FIXME:  MKDEV uses illicit insider knowledge of kernel 
Signature · 1 line
1.8.2.1