summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThe Android Open Source Project2008-12-17 20:08:08 -0600
committerThe Android Open Source Project2008-12-17 20:08:08 -0600
commit35237d135807af84bf9b0e5b8d7f8633e58db6f5 (patch)
treed8bcf3ada2182d248604728285dd80abb466f22a /init/devices.c
parent4f6e8d7a00cbeda1e70cc15be9c4af1018bdad53 (diff)
downloadplatform-system-core-35237d135807af84bf9b0e5b8d7f8633e58db6f5.tar.gz
platform-system-core-35237d135807af84bf9b0e5b8d7f8633e58db6f5.tar.xz
platform-system-core-35237d135807af84bf9b0e5b8d7f8633e58db6f5.zip
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'init/devices.c')
-rw-r--r--init/devices.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/init/devices.c b/init/devices.c
index 7aea24623..f86eab991 100644
--- a/init/devices.c
+++ b/init/devices.c
@@ -98,9 +98,12 @@ static struct perms_ devperms[] = {
98 /* these should not be world writable */ 98 /* these should not be world writable */
99 { "/dev/android_adb", 0660, AID_ADB, AID_ADB, 0 }, 99 { "/dev/android_adb", 0660, AID_ADB, AID_ADB, 0 },
100 { "/dev/android_adb_enable", 0660, AID_ADB, AID_ADB, 0 }, 100 { "/dev/android_adb_enable", 0660, AID_ADB, AID_ADB, 0 },
101 { "/dev/ttyMSM0", 0660, AID_BLUETOOTH, AID_BLUETOOTH, 0 }, 101 /* TODO: remove legacy ttyMSM0 */
102 { "/dev/ttyMSM0", 0600, AID_BLUETOOTH, AID_BLUETOOTH, 0 },
103 { "/dev/ttyHS0", 0600, AID_BLUETOOTH, AID_BLUETOOTH, 0 },
104 { "/dev/uinput", 0600, AID_BLUETOOTH, AID_BLUETOOTH, 0 },
102 { "/dev/alarm", 0664, AID_SYSTEM, AID_RADIO, 0 }, 105 { "/dev/alarm", 0664, AID_SYSTEM, AID_RADIO, 0 },
103 { "/dev/tty0", 0666, AID_ROOT, AID_SYSTEM, 0 }, 106 { "/dev/tty0", 0660, AID_ROOT, AID_SYSTEM, 0 },
104 { "/dev/graphics/", 0660, AID_ROOT, AID_GRAPHICS, 1 }, 107 { "/dev/graphics/", 0660, AID_ROOT, AID_GRAPHICS, 1 },
105 { "/dev/hw3d", 0660, AID_SYSTEM, AID_GRAPHICS, 0 }, 108 { "/dev/hw3d", 0660, AID_SYSTEM, AID_GRAPHICS, 0 },
106 { "/dev/input/", 0660, AID_ROOT, AID_INPUT, 1 }, 109 { "/dev/input/", 0660, AID_ROOT, AID_INPUT, 1 },
@@ -360,29 +363,29 @@ static void handle_device_event(struct uevent *uevent)
360 return; 363 return;
361 364
362 /* are we block or char? where should we live? */ 365 /* are we block or char? where should we live? */
363 if(!strncmp(uevent->path, "/block", 6)) { 366 if(!strncmp(uevent->subsystem, "block", 5)) {
364 block = 1; 367 block = 1;
365 base = "/dev/block/"; 368 base = "/dev/block/";
366 mkdir(base, 0755); 369 mkdir(base, 0755);
367 } else { 370 } else {
368 block = 0; 371 block = 0;
369 /* this should probably be configurable somehow */ 372 /* this should probably be configurable somehow */
370 if(!strncmp(uevent->path, "/class/graphics/", 16)) { 373 if(!strncmp(uevent->subsystem, "graphics", 8)) {
371 base = "/dev/graphics/"; 374 base = "/dev/graphics/";
372 mkdir(base, 0755); 375 mkdir(base, 0755);
373 } else if (!strncmp(uevent->path, "/class/oncrpc/", 14)) { 376 } else if (!strncmp(uevent->subsystem, "oncrpc", 6)) {
374 base = "/dev/oncrpc/"; 377 base = "/dev/oncrpc/";
375 mkdir(base, 0755); 378 mkdir(base, 0755);
376 } else if (!strncmp(uevent->path, "/class/adsp/", 12)) { 379 } else if (!strncmp(uevent->subsystem, "adsp", 4)) {
377 base = "/dev/adsp/"; 380 base = "/dev/adsp/";
378 mkdir(base, 0755); 381 mkdir(base, 0755);
379 } else if(!strncmp(uevent->path, "/class/input/", 13)) { 382 } else if(!strncmp(uevent->subsystem, "input", 5)) {
380 base = "/dev/input/"; 383 base = "/dev/input/";
381 mkdir(base, 0755); 384 mkdir(base, 0755);
382 } else if(!strncmp(uevent->path, "/class/mtd/", 11)) { 385 } else if(!strncmp(uevent->subsystem, "mtd", 3)) {
383 base = "/dev/mtd/"; 386 base = "/dev/mtd/";
384 mkdir(base, 0755); 387 mkdir(base, 0755);
385 } else if(!strncmp(uevent->path, "/class/misc/", 12) && 388 } else if(!strncmp(uevent->subsystem, "misc", 4) &&
386 !strncmp(name, "log_", 4)) { 389 !strncmp(name, "log_", 4)) {
387 base = "/dev/log/"; 390 base = "/dev/log/";
388 mkdir(base, 0755); 391 mkdir(base, 0755);