diff options
-rw-r--r-- | fs_mgr/fs_mgr_fstab.c | 10 | ||||
-rw-r--r-- | fs_mgr/fs_mgr_verity.c | 246 | ||||
-rw-r--r-- | fs_mgr/include/fs_mgr.h | 3 | ||||
-rw-r--r-- | include/cutils/threads.h | 1 | ||||
-rw-r--r-- | init/init_parser.cpp | 1 | ||||
-rw-r--r-- | libbacktrace/Android.build.mk | 2 | ||||
-rw-r--r-- | libcutils/Android.mk | 14 | ||||
-rw-r--r-- | libcutils/threads.c | 9 | ||||
-rw-r--r-- | liblog/logd_write.c | 64 | ||||
-rw-r--r-- | logd/libaudit.c | 2 | ||||
-rw-r--r-- | toolbox/Android.mk | 9 | ||||
-rwxr-xr-x | toolbox/generate-input.h-labels.py | 93 | ||||
-rw-r--r-- | toolbox/getevent.c | 20 | ||||
-rw-r--r-- | toolbox/getevent.h | 727 | ||||
-rw-r--r-- | toolbox/runcon.c | 28 |
15 files changed, 366 insertions, 863 deletions
diff --git a/fs_mgr/fs_mgr_fstab.c b/fs_mgr/fs_mgr_fstab.c index ab8f128ce..2c3c90dff 100644 --- a/fs_mgr/fs_mgr_fstab.c +++ b/fs_mgr/fs_mgr_fstab.c | |||
@@ -24,6 +24,7 @@ | |||
24 | 24 | ||
25 | struct fs_mgr_flag_values { | 25 | struct fs_mgr_flag_values { |
26 | char *key_loc; | 26 | char *key_loc; |
27 | char *verity_loc; | ||
27 | long long part_length; | 28 | long long part_length; |
28 | char *label; | 29 | char *label; |
29 | int partnum; | 30 | int partnum; |
@@ -107,6 +108,14 @@ static int parse_flags(char *flags, struct flag_list *fl, | |||
107 | * location of the keys. Get it and return it. | 108 | * location of the keys. Get it and return it. |
108 | */ | 109 | */ |
109 | flag_vals->key_loc = strdup(strchr(p, '=') + 1); | 110 | flag_vals->key_loc = strdup(strchr(p, '=') + 1); |
111 | } else if ((fl[i].flag == MF_VERIFY) && flag_vals) { | ||
112 | /* If the verify flag is followed by an = and the | ||
113 | * location for the verity state, get it and return it. | ||
114 | */ | ||
115 | char *start = strchr(p, '='); | ||
116 | if (start) { | ||
117 | flag_vals->verity_loc = strdup(start + 1); | ||
118 | } | ||
110 | } else if ((fl[i].flag == MF_FORCECRYPT) && flag_vals) { | 119 | } else if ((fl[i].flag == MF_FORCECRYPT) && flag_vals) { |
111 | /* The forceencrypt flag is followed by an = and the | 120 | /* The forceencrypt flag is followed by an = and the |
112 | * location of the keys. Get it and return it. | 121 | * location of the keys. Get it and return it. |
@@ -291,6 +300,7 @@ struct fstab *fs_mgr_read_fstab(const char *fstab_path) | |||
291 | fstab->recs[cnt].fs_mgr_flags = parse_flags(p, fs_mgr_flags, | 300 | fstab->recs[cnt].fs_mgr_flags = parse_flags(p, fs_mgr_flags, |
292 | &flag_vals, NULL, 0); | 301 | &flag_vals, NULL, 0); |
293 | fstab->recs[cnt].key_loc = flag_vals.key_loc; | 302 | fstab->recs[cnt].key_loc = flag_vals.key_loc; |
303 | fstab->recs[cnt].verity_loc = flag_vals.verity_loc; | ||
294 | fstab->recs[cnt].length = flag_vals.part_length; | 304 | fstab->recs[cnt].length = flag_vals.part_length; |
295 | fstab->recs[cnt].label = flag_vals.label; | 305 | fstab->recs[cnt].label = flag_vals.label; |
296 | fstab->recs[cnt].partnum = flag_vals.partnum; | 306 | fstab->recs[cnt].partnum = flag_vals.partnum; |
diff --git a/fs_mgr/fs_mgr_verity.c b/fs_mgr/fs_mgr_verity.c index 5c673337b..acdc5a360 100644 --- a/fs_mgr/fs_mgr_verity.c +++ b/fs_mgr/fs_mgr_verity.c | |||
@@ -47,16 +47,23 @@ | |||
47 | #define VERITY_METADATA_SIZE 32768 | 47 | #define VERITY_METADATA_SIZE 32768 |
48 | #define VERITY_TABLE_RSA_KEY "/verity_key" | 48 | #define VERITY_TABLE_RSA_KEY "/verity_key" |
49 | 49 | ||
50 | #define METADATA_MAGIC 0x01564c54 | ||
51 | #define METADATA_TAG_MAX_LENGTH 63 | ||
52 | #define METADATA_EOD "eod" | ||
53 | |||
54 | #define VERITY_STATE_TAG "verity_state" | ||
50 | #define VERITY_STATE_HEADER 0x83c0ae9d | 55 | #define VERITY_STATE_HEADER 0x83c0ae9d |
51 | #define VERITY_STATE_VERSION 1 | 56 | #define VERITY_STATE_VERSION 1 |
52 | 57 | ||
53 | #define VERITY_KMSG_RESTART "dm-verity device corrupted" | 58 | #define VERITY_KMSG_RESTART "dm-verity device corrupted" |
54 | #define VERITY_KMSG_BUFSIZE 1024 | 59 | #define VERITY_KMSG_BUFSIZE 1024 |
55 | 60 | ||
61 | #define __STRINGIFY(x) #x | ||
62 | #define STRINGIFY(x) __STRINGIFY(x) | ||
63 | |||
56 | struct verity_state { | 64 | struct verity_state { |
57 | uint32_t header; | 65 | uint32_t header; |
58 | uint32_t version; | 66 | uint32_t version; |
59 | uint32_t size; | ||
60 | int32_t mode; | 67 | int32_t mode; |
61 | }; | 68 | }; |
62 | 69 | ||
@@ -453,83 +460,150 @@ static int was_verity_restart() | |||
453 | return 0; | 460 | return 0; |
454 | } | 461 | } |
455 | 462 | ||
456 | static int write_verity_state(const char *fname, off64_t offset, int32_t mode) | 463 | static int metadata_add(FILE *fp, long start, const char *tag, |
464 | unsigned int length, off64_t *offset) | ||
457 | { | 465 | { |
458 | int fd; | 466 | if (fseek(fp, start, SEEK_SET) < 0 || |
467 | fprintf(fp, "%s %u\n", tag, length) < 0) { | ||
468 | return -1; | ||
469 | } | ||
470 | |||
471 | *offset = ftell(fp); | ||
472 | |||
473 | if (fseek(fp, length, SEEK_CUR) < 0 || | ||
474 | fprintf(fp, METADATA_EOD " 0\n") < 0) { | ||
475 | return -1; | ||
476 | } | ||
477 | |||
478 | return 0; | ||
479 | } | ||
480 | |||
481 | static int metadata_find(const char *fname, const char *stag, | ||
482 | unsigned int slength, off64_t *offset) | ||
483 | { | ||
484 | FILE *fp = NULL; | ||
485 | char tag[METADATA_TAG_MAX_LENGTH + 1]; | ||
459 | int rc = -1; | 486 | int rc = -1; |
487 | int n; | ||
488 | long start = 0x4000; /* skip cryptfs metadata area */ | ||
489 | uint32_t magic; | ||
490 | unsigned int length = 0; | ||
460 | 491 | ||
461 | struct verity_state s = { | 492 | if (!fname) { |
462 | VERITY_STATE_HEADER, | 493 | return -1; |
463 | VERITY_STATE_VERSION, | 494 | } |
464 | sizeof(struct verity_state), | ||
465 | mode | ||
466 | }; | ||
467 | 495 | ||
468 | fd = TEMP_FAILURE_RETRY(open(fname, O_WRONLY | O_SYNC | O_CLOEXEC)); | 496 | fp = fopen(fname, "r+"); |
469 | 497 | ||
470 | if (fd == -1) { | 498 | if (!fp) { |
471 | ERROR("Failed to open %s (%s)\n", fname, strerror(errno)); | 499 | ERROR("Failed to open %s (%s)\n", fname, strerror(errno)); |
472 | goto out; | 500 | goto out; |
473 | } | 501 | } |
474 | 502 | ||
475 | if (TEMP_FAILURE_RETRY(lseek64(fd, offset, SEEK_SET)) < 0) { | 503 | /* check magic */ |
476 | ERROR("Failed to seek %s to %" PRIu64 " (%s)\n", fname, offset, strerror(errno)); | 504 | if (fseek(fp, start, SEEK_SET) < 0 || |
505 | fread(&magic, sizeof(magic), 1, fp) != 1) { | ||
506 | ERROR("Failed to read magic from %s (%s)\n", fname, strerror(errno)); | ||
477 | goto out; | 507 | goto out; |
478 | } | 508 | } |
479 | 509 | ||
480 | if (TEMP_FAILURE_RETRY(write(fd, &s, sizeof(s))) != sizeof(s)) { | 510 | if (magic != METADATA_MAGIC) { |
481 | ERROR("Failed to write %zu bytes to %s (%s)\n", sizeof(s), fname, strerror(errno)); | 511 | magic = METADATA_MAGIC; |
512 | |||
513 | if (fseek(fp, start, SEEK_SET) < 0 || | ||
514 | fwrite(&magic, sizeof(magic), 1, fp) != 1) { | ||
515 | ERROR("Failed to write magic to %s (%s)\n", fname, strerror(errno)); | ||
516 | goto out; | ||
517 | } | ||
518 | |||
519 | rc = metadata_add(fp, start + sizeof(magic), stag, slength, offset); | ||
520 | if (rc < 0) { | ||
521 | ERROR("Failed to add metadata to %s: %s\n", fname, strerror(errno)); | ||
522 | } | ||
523 | |||
482 | goto out; | 524 | goto out; |
483 | } | 525 | } |
484 | 526 | ||
485 | rc = 0; | 527 | start += sizeof(magic); |
528 | |||
529 | while (1) { | ||
530 | n = fscanf(fp, "%" STRINGIFY(METADATA_TAG_MAX_LENGTH) "s %u\n", | ||
531 | tag, &length); | ||
532 | |||
533 | if (n == 2 && strcmp(tag, METADATA_EOD)) { | ||
534 | /* found a tag */ | ||
535 | start = ftell(fp); | ||
536 | |||
537 | if (!strcmp(tag, stag) && length == slength) { | ||
538 | *offset = start; | ||
539 | rc = 0; | ||
540 | goto out; | ||
541 | } | ||
542 | |||
543 | start += length; | ||
544 | |||
545 | if (fseek(fp, length, SEEK_CUR) < 0) { | ||
546 | ERROR("Failed to seek %s (%s)\n", fname, strerror(errno)); | ||
547 | goto out; | ||
548 | } | ||
549 | } else { | ||
550 | rc = metadata_add(fp, start, stag, slength, offset); | ||
551 | if (rc < 0) { | ||
552 | ERROR("Failed to write metadata to %s: %s\n", fname, | ||
553 | strerror(errno)); | ||
554 | } | ||
555 | goto out; | ||
556 | } | ||
557 | } | ||
486 | 558 | ||
487 | out: | 559 | out: |
488 | if (fd != -1) { | 560 | if (fp) { |
489 | TEMP_FAILURE_RETRY(close(fd)); | 561 | fflush(fp); |
562 | fclose(fp); | ||
490 | } | 563 | } |
491 | 564 | ||
492 | return rc; | 565 | return rc; |
493 | } | 566 | } |
494 | 567 | ||
495 | static int get_verity_state_location(char *location, off64_t *offset) | 568 | static int write_verity_state(const char *fname, off64_t offset, int32_t mode) |
496 | { | 569 | { |
497 | char state_off[PROPERTY_VALUE_MAX]; | 570 | int fd; |
571 | int rc = -1; | ||
572 | struct verity_state s = { VERITY_STATE_HEADER, VERITY_STATE_VERSION, mode }; | ||
498 | 573 | ||
499 | if (property_get("ro.verity.state.location", location, NULL) <= 0) { | 574 | fd = TEMP_FAILURE_RETRY(open(fname, O_WRONLY | O_SYNC | O_CLOEXEC)); |
500 | return -1; | ||
501 | } | ||
502 | 575 | ||
503 | if (*location != '/' || access(location, R_OK | W_OK) == -1) { | 576 | if (fd == -1) { |
504 | ERROR("Failed to access verity state %s (%s)\n", location, strerror(errno)); | 577 | ERROR("Failed to open %s (%s)\n", fname, strerror(errno)); |
505 | return -1; | 578 | goto out; |
506 | } | 579 | } |
507 | 580 | ||
508 | *offset = 0; | 581 | if (TEMP_FAILURE_RETRY(pwrite64(fd, &s, sizeof(s), offset)) != sizeof(s)) { |
582 | ERROR("Failed to write %zu bytes to %s to offset %" PRIu64 " (%s)\n", | ||
583 | sizeof(s), fname, offset, strerror(errno)); | ||
584 | goto out; | ||
585 | } | ||
509 | 586 | ||
510 | if (property_get("ro.verity.state.offset", state_off, NULL) > 0) { | 587 | rc = 0; |
511 | *offset = strtoll(state_off, NULL, 0); | ||
512 | 588 | ||
513 | if (errno == ERANGE || errno == EINVAL) { | 589 | out: |
514 | ERROR("Invalid value in ro.verity.state.offset (%s)\n", state_off); | 590 | if (fd != -1) { |
515 | return -1; | 591 | TEMP_FAILURE_RETRY(close(fd)); |
516 | } | ||
517 | } | 592 | } |
518 | 593 | ||
519 | return 0; | 594 | return rc; |
520 | } | 595 | } |
521 | 596 | ||
522 | int fs_mgr_load_verity_state(int *mode) | 597 | static int load_verity_state(struct fstab_rec *fstab, int *mode) |
523 | { | 598 | { |
524 | char fname[PROPERTY_VALUE_MAX]; | ||
525 | int fd = -1; | 599 | int fd = -1; |
526 | int rc = -1; | 600 | int rc = -1; |
527 | off64_t offset = 0; | 601 | off64_t offset = 0; |
528 | struct verity_state s; | 602 | struct verity_state s; |
529 | 603 | ||
530 | if (get_verity_state_location(fname, &offset) < 0) { | 604 | if (metadata_find(fstab->verity_loc, VERITY_STATE_TAG, sizeof(s), |
531 | /* location for dm-verity state is not specified, fall back to | 605 | &offset) < 0) { |
532 | * default behavior: return -EIO for corrupted blocks */ | 606 | /* fall back to stateless behavior */ |
533 | *mode = VERITY_MODE_EIO; | 607 | *mode = VERITY_MODE_EIO; |
534 | rc = 0; | 608 | rc = 0; |
535 | goto out; | 609 | goto out; |
@@ -539,28 +613,27 @@ int fs_mgr_load_verity_state(int *mode) | |||
539 | /* device was restarted after dm-verity detected a corrupted | 613 | /* device was restarted after dm-verity detected a corrupted |
540 | * block, so switch to logging mode */ | 614 | * block, so switch to logging mode */ |
541 | *mode = VERITY_MODE_LOGGING; | 615 | *mode = VERITY_MODE_LOGGING; |
542 | rc = write_verity_state(fname, offset, *mode); | 616 | rc = write_verity_state(fstab->verity_loc, offset, *mode); |
543 | goto out; | 617 | goto out; |
544 | } | 618 | } |
545 | 619 | ||
546 | fd = TEMP_FAILURE_RETRY(open(fname, O_RDONLY | O_CLOEXEC)); | 620 | fd = TEMP_FAILURE_RETRY(open(fstab->verity_loc, O_RDONLY | O_CLOEXEC)); |
547 | 621 | ||
548 | if (fd == -1) { | 622 | if (fd == -1) { |
549 | ERROR("Failed to open %s (%s)\n", fname, strerror(errno)); | 623 | ERROR("Failed to open %s (%s)\n", fstab->verity_loc, strerror(errno)); |
550 | goto out; | ||
551 | } | ||
552 | |||
553 | if (TEMP_FAILURE_RETRY(lseek64(fd, offset, SEEK_SET)) < 0) { | ||
554 | ERROR("Failed to seek %s to %" PRIu64 " (%s)\n", fname, offset, strerror(errno)); | ||
555 | goto out; | 624 | goto out; |
556 | } | 625 | } |
557 | 626 | ||
558 | if (TEMP_FAILURE_RETRY(read(fd, &s, sizeof(s))) != sizeof(s)) { | 627 | if (TEMP_FAILURE_RETRY(pread64(fd, &s, sizeof(s), offset)) != sizeof(s)) { |
559 | ERROR("Failed to read %zu bytes from %s (%s)\n", sizeof(s), fname, strerror(errno)); | 628 | ERROR("Failed to read %zu bytes from %s offset %" PRIu64 " (%s)\n", |
629 | sizeof(s), fstab->verity_loc, offset, strerror(errno)); | ||
560 | goto out; | 630 | goto out; |
561 | } | 631 | } |
562 | 632 | ||
563 | if (s.header != VERITY_STATE_HEADER) { | 633 | if (s.header != VERITY_STATE_HEADER) { |
634 | /* space allocated, but no state written. write default state */ | ||
635 | *mode = VERITY_MODE_DEFAULT; | ||
636 | rc = write_verity_state(fstab->verity_loc, offset, *mode); | ||
564 | goto out; | 637 | goto out; |
565 | } | 638 | } |
566 | 639 | ||
@@ -569,11 +642,6 @@ int fs_mgr_load_verity_state(int *mode) | |||
569 | goto out; | 642 | goto out; |
570 | } | 643 | } |
571 | 644 | ||
572 | if (s.size != sizeof(s)) { | ||
573 | ERROR("Unexpected verity state size (%u)\n", s.size); | ||
574 | goto out; | ||
575 | } | ||
576 | |||
577 | if (s.mode < VERITY_MODE_EIO || | 645 | if (s.mode < VERITY_MODE_EIO || |
578 | s.mode > VERITY_MODE_LAST) { | 646 | s.mode > VERITY_MODE_LAST) { |
579 | ERROR("Unsupported verity mode (%u)\n", s.mode); | 647 | ERROR("Unsupported verity mode (%u)\n", s.mode); |
@@ -591,13 +659,61 @@ out: | |||
591 | return rc; | 659 | return rc; |
592 | } | 660 | } |
593 | 661 | ||
662 | int fs_mgr_load_verity_state(int *mode) | ||
663 | { | ||
664 | char fstab_filename[PROPERTY_VALUE_MAX + sizeof(FSTAB_PREFIX)]; | ||
665 | char propbuf[PROPERTY_VALUE_MAX]; | ||
666 | int rc = -1; | ||
667 | int i; | ||
668 | struct fstab *fstab = NULL; | ||
669 | |||
670 | *mode = VERITY_MODE_DEFAULT; | ||
671 | |||
672 | property_get("ro.hardware", propbuf, ""); | ||
673 | snprintf(fstab_filename, sizeof(fstab_filename), FSTAB_PREFIX"%s", propbuf); | ||
674 | |||
675 | fstab = fs_mgr_read_fstab(fstab_filename); | ||
676 | |||
677 | if (!fstab) { | ||
678 | ERROR("Failed to read %s\n", fstab_filename); | ||
679 | goto out; | ||
680 | } | ||
681 | |||
682 | for (i = 0; i < fstab->num_entries; i++) { | ||
683 | if (!fs_mgr_is_verified(&fstab->recs[i])) { | ||
684 | continue; | ||
685 | } | ||
686 | |||
687 | rc = load_verity_state(&fstab->recs[i], mode); | ||
688 | if (rc < 0) { | ||
689 | continue; | ||
690 | } | ||
691 | |||
692 | /* if any of the verified partitions are in logging mode, return */ | ||
693 | if (*mode == VERITY_MODE_LOGGING) { | ||
694 | rc = 0; | ||
695 | goto out; | ||
696 | } | ||
697 | } | ||
698 | |||
699 | /* if there were multiple partitions, all in non-logging mode, return the | ||
700 | * state of the last one */ | ||
701 | rc = 0; | ||
702 | |||
703 | out: | ||
704 | if (fstab) { | ||
705 | fs_mgr_free_fstab(fstab); | ||
706 | } | ||
707 | |||
708 | return rc; | ||
709 | } | ||
710 | |||
594 | int fs_mgr_update_verity_state(fs_mgr_verity_state_callback callback) | 711 | int fs_mgr_update_verity_state(fs_mgr_verity_state_callback callback) |
595 | { | 712 | { |
596 | _Alignas(struct dm_ioctl) char buffer[DM_BUF_SIZE]; | 713 | _Alignas(struct dm_ioctl) char buffer[DM_BUF_SIZE]; |
597 | char fstab_filename[PROPERTY_VALUE_MAX + sizeof(FSTAB_PREFIX)]; | 714 | char fstab_filename[PROPERTY_VALUE_MAX + sizeof(FSTAB_PREFIX)]; |
598 | char *mount_point; | 715 | char *mount_point; |
599 | char propbuf[PROPERTY_VALUE_MAX]; | 716 | char propbuf[PROPERTY_VALUE_MAX]; |
600 | char state_loc[PROPERTY_VALUE_MAX]; | ||
601 | char *status; | 717 | char *status; |
602 | int fd = -1; | 718 | int fd = -1; |
603 | int i; | 719 | int i; |
@@ -606,10 +722,6 @@ int fs_mgr_update_verity_state(fs_mgr_verity_state_callback callback) | |||
606 | struct dm_ioctl *io = (struct dm_ioctl *) buffer; | 722 | struct dm_ioctl *io = (struct dm_ioctl *) buffer; |
607 | struct fstab *fstab = NULL; | 723 | struct fstab *fstab = NULL; |
608 | 724 | ||
609 | if (get_verity_state_location(state_loc, &offset) < 0) { | ||
610 | goto out; | ||
611 | } | ||
612 | |||
613 | fd = TEMP_FAILURE_RETRY(open("/dev/device-mapper", O_RDWR | O_CLOEXEC)); | 725 | fd = TEMP_FAILURE_RETRY(open("/dev/device-mapper", O_RDWR | O_CLOEXEC)); |
614 | 726 | ||
615 | if (fd == -1) { | 727 | if (fd == -1) { |
@@ -632,6 +744,11 @@ int fs_mgr_update_verity_state(fs_mgr_verity_state_callback callback) | |||
632 | continue; | 744 | continue; |
633 | } | 745 | } |
634 | 746 | ||
747 | if (metadata_find(fstab->recs[i].verity_loc, VERITY_STATE_TAG, | ||
748 | sizeof(struct verity_state), &offset) < 0) { | ||
749 | continue; | ||
750 | } | ||
751 | |||
635 | mount_point = basename(fstab->recs[i].mount_point); | 752 | mount_point = basename(fstab->recs[i].mount_point); |
636 | verity_ioctl_init(io, mount_point, 0); | 753 | verity_ioctl_init(io, mount_point, 0); |
637 | 754 | ||
@@ -644,7 +761,8 @@ int fs_mgr_update_verity_state(fs_mgr_verity_state_callback callback) | |||
644 | status = &buffer[io->data_start + sizeof(struct dm_target_spec)]; | 761 | status = &buffer[io->data_start + sizeof(struct dm_target_spec)]; |
645 | 762 | ||
646 | if (*status == 'C') { | 763 | if (*status == 'C') { |
647 | rc = write_verity_state(state_loc, offset, VERITY_MODE_LOGGING); | 764 | rc = write_verity_state(fstab->recs[i].verity_loc, offset, |
765 | VERITY_MODE_LOGGING); | ||
648 | 766 | ||
649 | if (rc == -1) { | 767 | if (rc == -1) { |
650 | goto out; | 768 | goto out; |
@@ -732,8 +850,12 @@ int fs_mgr_setup_verity(struct fstab_rec *fstab) { | |||
732 | goto out; | 850 | goto out; |
733 | } | 851 | } |
734 | 852 | ||
735 | if (fs_mgr_load_verity_state(&mode) < 0) { | 853 | if (load_verity_state(fstab, &mode) < 0) { |
736 | mode = VERITY_MODE_RESTART; /* default dm-verity mode */ | 854 | /* if accessing or updating the state failed, switch to the default |
855 | * safe mode. This makes sure the device won't end up in an endless | ||
856 | * restart loop, and no corrupted data will be exposed to userspace | ||
857 | * without a warning. */ | ||
858 | mode = VERITY_MODE_EIO; | ||
737 | } | 859 | } |
738 | 860 | ||
739 | INFO("Enabling dm-verity for %s (mode %d)\n", mount_point, mode); | 861 | INFO("Enabling dm-verity for %s (mode %d)\n", mount_point, mode); |
diff --git a/fs_mgr/include/fs_mgr.h b/fs_mgr/include/fs_mgr.h index d2c8fffd0..ad8a8fc10 100644 --- a/fs_mgr/include/fs_mgr.h +++ b/fs_mgr/include/fs_mgr.h | |||
@@ -36,7 +36,8 @@ enum verity_mode { | |||
36 | VERITY_MODE_EIO = 0, | 36 | VERITY_MODE_EIO = 0, |
37 | VERITY_MODE_LOGGING = 1, | 37 | VERITY_MODE_LOGGING = 1, |
38 | VERITY_MODE_RESTART = 2, | 38 | VERITY_MODE_RESTART = 2, |
39 | VERITY_MODE_LAST = VERITY_MODE_RESTART | 39 | VERITY_MODE_LAST = VERITY_MODE_RESTART, |
40 | VERITY_MODE_DEFAULT = VERITY_MODE_RESTART | ||
40 | }; | 41 | }; |
41 | 42 | ||
42 | /* | 43 | /* |
diff --git a/include/cutils/threads.h b/include/cutils/threads.h index bb9fdb858..3133cdb04 100644 --- a/include/cutils/threads.h +++ b/include/cutils/threads.h | |||
@@ -32,6 +32,7 @@ extern "C" { | |||
32 | #if !defined(_WIN32) | 32 | #if !defined(_WIN32) |
33 | 33 | ||
34 | #include <pthread.h> | 34 | #include <pthread.h> |
35 | #include <sys/types.h> | ||
35 | 36 | ||
36 | typedef struct { | 37 | typedef struct { |
37 | pthread_mutex_t lock; | 38 | pthread_mutex_t lock; |
diff --git a/init/init_parser.cpp b/init/init_parser.cpp index 7db203f0f..57eb29957 100644 --- a/init/init_parser.cpp +++ b/init/init_parser.cpp | |||
@@ -118,6 +118,7 @@ static int lookup_keyword(const char *s) | |||
118 | switch (*s++) { | 118 | switch (*s++) { |
119 | case 'b': | 119 | case 'b': |
120 | if (!strcmp(s, "ootchart_init")) return K_bootchart_init; | 120 | if (!strcmp(s, "ootchart_init")) return K_bootchart_init; |
121 | break; | ||
121 | case 'c': | 122 | case 'c': |
122 | if (!strcmp(s, "opy")) return K_copy; | 123 | if (!strcmp(s, "opy")) return K_copy; |
123 | if (!strcmp(s, "apability")) return K_capability; | 124 | if (!strcmp(s, "apability")) return K_capability; |
diff --git a/libbacktrace/Android.build.mk b/libbacktrace/Android.build.mk index 7e1cd53e5..d71c8ec22 100644 --- a/libbacktrace/Android.build.mk +++ b/libbacktrace/Android.build.mk | |||
@@ -67,7 +67,7 @@ endif | |||
67 | ifeq ($(build_type),host) | 67 | ifeq ($(build_type),host) |
68 | # Only build if host builds are supported. | 68 | # Only build if host builds are supported. |
69 | ifeq ($(build_host),true) | 69 | ifeq ($(build_host),true) |
70 | LOCAL_CFLAGS += -Wno-extern-c-compat | 70 | LOCAL_CFLAGS += -Wno-extern-c-compat -fno-omit-frame-pointer |
71 | ifneq ($($(module)_libc++),) | 71 | ifneq ($($(module)_libc++),) |
72 | include external/libcxx/libcxx.mk | 72 | include external/libcxx/libcxx.mk |
73 | endif | 73 | endif |
diff --git a/libcutils/Android.mk b/libcutils/Android.mk index 876b89d32..d8903192a 100644 --- a/libcutils/Android.mk +++ b/libcutils/Android.mk | |||
@@ -64,11 +64,11 @@ ifneq ($(WINDOWS_HOST_ONLY),1) | |||
64 | endif | 64 | endif |
65 | 65 | ||
66 | 66 | ||
67 | # Static library for host | 67 | # Shared and static library for host |
68 | # ======================================================== | 68 | # ======================================================== |
69 | LOCAL_MODULE := libcutils | 69 | LOCAL_MODULE := libcutils |
70 | LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c | 70 | LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c |
71 | LOCAL_STATIC_LIBRARIES := liblog libbase | 71 | LOCAL_STATIC_LIBRARIES := liblog |
72 | ifneq ($(HOST_OS),windows) | 72 | ifneq ($(HOST_OS),windows) |
73 | LOCAL_CFLAGS += -Werror | 73 | LOCAL_CFLAGS += -Werror |
74 | endif | 74 | endif |
@@ -76,6 +76,16 @@ LOCAL_MULTILIB := both | |||
76 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk | 76 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
77 | include $(BUILD_HOST_STATIC_LIBRARY) | 77 | include $(BUILD_HOST_STATIC_LIBRARY) |
78 | 78 | ||
79 | include $(CLEAR_VARS) | ||
80 | LOCAL_MODULE := libcutils | ||
81 | LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c | ||
82 | LOCAL_SHARED_LIBRARIES := liblog | ||
83 | ifneq ($(HOST_OS),windows) | ||
84 | LOCAL_CFLAGS += -Werror | ||
85 | endif | ||
86 | LOCAL_MULTILIB := both | ||
87 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk | ||
88 | include $(BUILD_HOST_SHARED_LIBRARY) | ||
79 | 89 | ||
80 | # Tests for host | 90 | # Tests for host |
81 | # ======================================================== | 91 | # ======================================================== |
diff --git a/libcutils/threads.c b/libcutils/threads.c index cafeff73f..5f5577b42 100644 --- a/libcutils/threads.c +++ b/libcutils/threads.c | |||
@@ -21,9 +21,11 @@ | |||
21 | // For gettid. | 21 | // For gettid. |
22 | #if defined(__APPLE__) | 22 | #if defined(__APPLE__) |
23 | #include "AvailabilityMacros.h" // For MAC_OS_X_VERSION_MAX_ALLOWED | 23 | #include "AvailabilityMacros.h" // For MAC_OS_X_VERSION_MAX_ALLOWED |
24 | #include <stdint.h> | ||
25 | #include <stdlib.h> | ||
24 | #include <sys/syscall.h> | 26 | #include <sys/syscall.h> |
25 | #include <sys/time.h> | 27 | #include <sys/time.h> |
26 | #include "base/logging.h" | 28 | #include <unistd.h> |
27 | #elif defined(__linux__) && !defined(__ANDROID__) | 29 | #elif defined(__linux__) && !defined(__ANDROID__) |
28 | #include <syscall.h> | 30 | #include <syscall.h> |
29 | #include <unistd.h> | 31 | #include <unistd.h> |
@@ -61,7 +63,10 @@ extern void thread_store_set( thread_store_t* store, | |||
61 | pid_t gettid() { | 63 | pid_t gettid() { |
62 | #if defined(__APPLE__) | 64 | #if defined(__APPLE__) |
63 | uint64_t owner; | 65 | uint64_t owner; |
64 | CHECK_PTHREAD_CALL(pthread_threadid_np, (NULL, &owner), __FUNCTION__); | 66 | int rc = pthread_threadid_np(NULL, &owner); |
67 | if (rc != 0) { | ||
68 | abort(); | ||
69 | } | ||
65 | return owner; | 70 | return owner; |
66 | #elif defined(__linux__) | 71 | #elif defined(__linux__) |
67 | return syscall(__NR_gettid); | 72 | return syscall(__NR_gettid); |
diff --git a/liblog/logd_write.c b/liblog/logd_write.c index 8f8cc3fd5..dfe34d189 100644 --- a/liblog/logd_write.c +++ b/liblog/logd_write.c | |||
@@ -90,15 +90,6 @@ int __android_log_dev_available(void) | |||
90 | return (g_log_status == kLogAvailable); | 90 | return (g_log_status == kLogAvailable); |
91 | } | 91 | } |
92 | 92 | ||
93 | #if !FAKE_LOG_DEVICE | ||
94 | /* give up, resources too limited */ | ||
95 | static int __write_to_log_null(log_id_t log_fd __unused, struct iovec *vec __unused, | ||
96 | size_t nr __unused) | ||
97 | { | ||
98 | return -1; | ||
99 | } | ||
100 | #endif | ||
101 | |||
102 | /* log_init_lock assumed */ | 93 | /* log_init_lock assumed */ |
103 | static int __write_to_log_initialize() | 94 | static int __write_to_log_initialize() |
104 | { | 95 | { |
@@ -111,40 +102,32 @@ static int __write_to_log_initialize() | |||
111 | log_fds[i] = fakeLogOpen(buf, O_WRONLY); | 102 | log_fds[i] = fakeLogOpen(buf, O_WRONLY); |
112 | } | 103 | } |
113 | #else | 104 | #else |
114 | if (logd_fd >= 0) { | 105 | if (pstore_fd < 0) { |
115 | i = logd_fd; | 106 | pstore_fd = TEMP_FAILURE_RETRY(open("/dev/pmsg0", O_WRONLY)); |
116 | logd_fd = -1; | ||
117 | close(i); | ||
118 | } | 107 | } |
119 | if (pstore_fd >= 0) { | ||
120 | i = pstore_fd; | ||
121 | pstore_fd = -1; | ||
122 | close(i); | ||
123 | } | ||
124 | pstore_fd = open("/dev/pmsg0", O_WRONLY); | ||
125 | 108 | ||
126 | i = socket(PF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC, 0); | 109 | if (logd_fd < 0) { |
127 | if (i < 0) { | 110 | i = TEMP_FAILURE_RETRY(socket(PF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC, 0)); |
128 | ret = -errno; | 111 | if (i < 0) { |
129 | write_to_log = __write_to_log_null; | 112 | ret = -errno; |
130 | } else if (fcntl(i, F_SETFL, O_NONBLOCK) < 0) { | 113 | } else if (TEMP_FAILURE_RETRY(fcntl(i, F_SETFL, O_NONBLOCK)) < 0) { |
131 | ret = -errno; | ||
132 | close(i); | ||
133 | i = -1; | ||
134 | write_to_log = __write_to_log_null; | ||
135 | } else { | ||
136 | struct sockaddr_un un; | ||
137 | memset(&un, 0, sizeof(struct sockaddr_un)); | ||
138 | un.sun_family = AF_UNIX; | ||
139 | strcpy(un.sun_path, "/dev/socket/logdw"); | ||
140 | |||
141 | if (connect(i, (struct sockaddr *)&un, sizeof(struct sockaddr_un)) < 0) { | ||
142 | ret = -errno; | 114 | ret = -errno; |
143 | close(i); | 115 | close(i); |
144 | i = -1; | 116 | } else { |
117 | struct sockaddr_un un; | ||
118 | memset(&un, 0, sizeof(struct sockaddr_un)); | ||
119 | un.sun_family = AF_UNIX; | ||
120 | strcpy(un.sun_path, "/dev/socket/logdw"); | ||
121 | |||
122 | if (TEMP_FAILURE_RETRY(connect(i, (struct sockaddr *)&un, | ||
123 | sizeof(struct sockaddr_un))) < 0) { | ||
124 | ret = -errno; | ||
125 | close(i); | ||
126 | } else { | ||
127 | logd_fd = i; | ||
128 | } | ||
145 | } | 129 | } |
146 | } | 130 | } |
147 | logd_fd = i; | ||
148 | #endif | 131 | #endif |
149 | 132 | ||
150 | return ret; | 133 | return ret; |
@@ -293,6 +276,8 @@ static int __write_to_log_daemon(log_id_t log_id, struct iovec *vec, size_t nr) | |||
293 | #if !defined(_WIN32) | 276 | #if !defined(_WIN32) |
294 | pthread_mutex_lock(&log_init_lock); | 277 | pthread_mutex_lock(&log_init_lock); |
295 | #endif | 278 | #endif |
279 | close(logd_fd); | ||
280 | logd_fd = -1; | ||
296 | ret = __write_to_log_initialize(); | 281 | ret = __write_to_log_initialize(); |
297 | #if !defined(_WIN32) | 282 | #if !defined(_WIN32) |
298 | pthread_mutex_unlock(&log_init_lock); | 283 | pthread_mutex_unlock(&log_init_lock); |
@@ -351,6 +336,11 @@ static int __write_to_log_init(log_id_t log_id, struct iovec *vec, size_t nr) | |||
351 | #if !defined(_WIN32) | 336 | #if !defined(_WIN32) |
352 | pthread_mutex_unlock(&log_init_lock); | 337 | pthread_mutex_unlock(&log_init_lock); |
353 | #endif | 338 | #endif |
339 | #if (FAKE_LOG_DEVICE == 0) | ||
340 | if (pstore_fd >= 0) { | ||
341 | __write_to_log_daemon(log_id, vec, nr); | ||
342 | } | ||
343 | #endif | ||
354 | return ret; | 344 | return ret; |
355 | } | 345 | } |
356 | 346 | ||
diff --git a/logd/libaudit.c b/logd/libaudit.c index d00d57959..cf76305d7 100644 --- a/logd/libaudit.c +++ b/logd/libaudit.c | |||
@@ -177,7 +177,7 @@ int audit_setup(int fd, uint32_t pid) | |||
177 | */ | 177 | */ |
178 | status.pid = pid; | 178 | status.pid = pid; |
179 | status.mask = AUDIT_STATUS_PID | AUDIT_STATUS_RATE_LIMIT; | 179 | status.mask = AUDIT_STATUS_PID | AUDIT_STATUS_RATE_LIMIT; |
180 | status.rate_limit = 20; // audit entries per second | 180 | status.rate_limit = 5; // audit entries per second |
181 | 181 | ||
182 | /* Let the kernel know this pid will be registering for audit events */ | 182 | /* Let the kernel know this pid will be registering for audit events */ |
183 | rc = audit_send(fd, AUDIT_SET, &status, sizeof(status)); | 183 | rc = audit_send(fd, AUDIT_SET, &status, sizeof(status)); |
diff --git a/toolbox/Android.mk b/toolbox/Android.mk index 959dc22e0..a0a9909aa 100644 --- a/toolbox/Android.mk +++ b/toolbox/Android.mk | |||
@@ -59,7 +59,6 @@ OUR_TOOLS := \ | |||
59 | renice \ | 59 | renice \ |
60 | restorecon \ | 60 | restorecon \ |
61 | route \ | 61 | route \ |
62 | runcon \ | ||
63 | sendevent \ | 62 | sendevent \ |
64 | setprop \ | 63 | setprop \ |
65 | start \ | 64 | start \ |
@@ -103,6 +102,14 @@ $(TOOLS_H): $(LOCAL_PATH)/Android.mk | |||
103 | $(TOOLS_H): | 102 | $(TOOLS_H): |
104 | $(transform-generated-source) | 103 | $(transform-generated-source) |
105 | 104 | ||
105 | $(LOCAL_PATH)/getevent.c: $(intermediates)/input.h-labels.h | ||
106 | |||
107 | INPUT_H_LABELS_H := $(intermediates)/input.h-labels.h | ||
108 | $(INPUT_H_LABELS_H): PRIVATE_LOCAL_PATH := $(LOCAL_PATH) | ||
109 | $(INPUT_H_LABELS_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_LOCAL_PATH)/generate-input.h-labels.py > $@ | ||
110 | $(INPUT_H_LABELS_H): $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/generate-input.h-labels.py | ||
111 | $(INPUT_H_LABELS_H): | ||
112 | $(transform-generated-source) | ||
106 | 113 | ||
107 | # We only want 'r' on userdebug and eng builds. | 114 | # We only want 'r' on userdebug and eng builds. |
108 | include $(CLEAR_VARS) | 115 | include $(CLEAR_VARS) |
diff --git a/toolbox/generate-input.h-labels.py b/toolbox/generate-input.h-labels.py new file mode 100755 index 000000000..ebb95887a --- /dev/null +++ b/toolbox/generate-input.h-labels.py | |||
@@ -0,0 +1,93 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # | ||
3 | # Copyright (C) 2015 The Android Open Source Project | ||
4 | # | ||
5 | # Licensed under the Apache License, Version 2.0 (the 'License'); | ||
6 | # you may not use this file except in compliance with the License. | ||
7 | # You may obtain a copy of the License at | ||
8 | # | ||
9 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | # | ||
11 | # Unless required by applicable law or agreed to in writing, software | ||
12 | # distributed under the License is distributed on an 'AS IS' BASIS, | ||
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | # See the License for the specific language governing permissions and | ||
15 | # limitations under the License. | ||
16 | # | ||
17 | # pylint: disable=bad-indentation,bad-continuation | ||
18 | |||
19 | import os | ||
20 | import re | ||
21 | |||
22 | input_prop_list = [] | ||
23 | ev_list = [] | ||
24 | syn_list = [] | ||
25 | key_list = [] | ||
26 | rel_list = [] | ||
27 | abs_list = [] | ||
28 | sw_list = [] | ||
29 | msc_list = [] | ||
30 | led_list = [] | ||
31 | rep_list = [] | ||
32 | snd_list = [] | ||
33 | mt_tool_list = [] | ||
34 | ff_status_list = [] | ||
35 | ff_list = [] | ||
36 | |||
37 | r = re.compile(r'#define\s+(\S+)\s+((?:0x)?\d+)') | ||
38 | |||
39 | with open('bionic/libc/kernel/uapi/linux/input.h', 'r') as f: | ||
40 | for line in f: | ||
41 | m = r.match(line) | ||
42 | if m: | ||
43 | name = m.group(1) | ||
44 | if name.startswith("INPUT_PROP_"): | ||
45 | input_prop_list.append(name) | ||
46 | elif name.startswith("EV_"): | ||
47 | ev_list.append(name) | ||
48 | elif name.startswith("SYN_"): | ||
49 | syn_list.append(name) | ||
50 | elif name.startswith("KEY_") or name.startswith("BTN_"): | ||
51 | key_list.append(name) | ||
52 | elif name.startswith("REL_"): | ||
53 | rel_list.append(name) | ||
54 | elif name.startswith("ABS_"): | ||
55 | abs_list.append(name) | ||
56 | elif name.startswith("SW_"): | ||
57 | sw_list.append(name) | ||
58 | elif name.startswith("MSC_"): | ||
59 | msc_list.append(name) | ||
60 | elif name.startswith("LED_"): | ||
61 | led_list.append(name) | ||
62 | elif name.startswith("REP_"): | ||
63 | rep_list.append(name) | ||
64 | elif name.startswith("SND_"): | ||
65 | snd_list.append(name) | ||
66 | elif name.startswith("MT_TOOL_"): | ||
67 | mt_tool_list.append(name) | ||
68 | elif name.startswith("FF_STATUS_"): | ||
69 | ff_status_list.append(name) | ||
70 | elif name.startswith("FF_"): | ||
71 | ff_list.append(name) | ||
72 | |||
73 | def Dump(struct_name, values): | ||
74 | print 'static struct label %s[] = {' % (struct_name) | ||
75 | for value in values: | ||
76 | print ' LABEL(%s),' % (value) | ||
77 | print ' LABEL_END,' | ||
78 | print '};' | ||
79 | |||
80 | Dump("input_prop_labels", input_prop_list) | ||
81 | Dump("ev_labels", ev_list) | ||
82 | Dump("syn_labels", syn_list) | ||
83 | Dump("key_labels", key_list) | ||
84 | Dump("rel_labels", rel_list) | ||
85 | Dump("abs_labels", abs_list) | ||
86 | Dump("sw_labels", sw_list) | ||
87 | Dump("msc_labels", msc_list) | ||
88 | Dump("led_labels", led_list) | ||
89 | Dump("rep_labels", rep_list) | ||
90 | Dump("snd_labels", snd_list) | ||
91 | Dump("mt_tool_labels", mt_tool_list) | ||
92 | Dump("ff_status_labels", ff_status_list) | ||
93 | Dump("ff_labels", ff_list) | ||
diff --git a/toolbox/getevent.c b/toolbox/getevent.c index c58eb5d1c..30053af80 100644 --- a/toolbox/getevent.c +++ b/toolbox/getevent.c | |||
@@ -12,7 +12,25 @@ | |||
12 | #include <errno.h> | 12 | #include <errno.h> |
13 | #include <unistd.h> | 13 | #include <unistd.h> |
14 | 14 | ||
15 | #include "getevent.h" | 15 | struct label { |
16 | const char *name; | ||
17 | int value; | ||
18 | }; | ||
19 | |||
20 | #define LABEL(constant) { #constant, constant } | ||
21 | #define LABEL_END { NULL, -1 } | ||
22 | |||
23 | static struct label key_value_labels[] = { | ||
24 | { "UP", 0 }, | ||
25 | { "DOWN", 1 }, | ||
26 | { "REPEAT", 2 }, | ||
27 | LABEL_END, | ||
28 | }; | ||
29 | |||
30 | #include "input.h-labels.h" | ||
31 | |||
32 | #undef LABEL | ||
33 | #undef LABEL_END | ||
16 | 34 | ||
17 | static struct pollfd *ufds; | 35 | static struct pollfd *ufds; |
18 | static char **device_names; | 36 | static char **device_names; |
diff --git a/toolbox/getevent.h b/toolbox/getevent.h deleted file mode 100644 index 0482d04cf..000000000 --- a/toolbox/getevent.h +++ /dev/null | |||
@@ -1,727 +0,0 @@ | |||
1 | #include <linux/input.h> | ||
2 | |||
3 | struct label { | ||
4 | const char *name; | ||
5 | int value; | ||
6 | }; | ||
7 | |||
8 | #define LABEL(constant) { #constant, constant } | ||
9 | #define LABEL_END { NULL, -1 } | ||
10 | |||
11 | static struct label input_prop_labels[] = { | ||
12 | LABEL(INPUT_PROP_POINTER), | ||
13 | LABEL(INPUT_PROP_DIRECT), | ||
14 | LABEL(INPUT_PROP_BUTTONPAD), | ||
15 | LABEL(INPUT_PROP_SEMI_MT), | ||
16 | LABEL_END, | ||
17 | }; | ||
18 | |||
19 | static struct label ev_labels[] = { | ||
20 | LABEL(EV_SYN), | ||
21 | LABEL(EV_KEY), | ||
22 | LABEL(EV_REL), | ||
23 | LABEL(EV_ABS), | ||
24 | LABEL(EV_MSC), | ||
25 | LABEL(EV_SW), | ||
26 | LABEL(EV_LED), | ||
27 | LABEL(EV_SND), | ||
28 | LABEL(EV_REP), | ||
29 | LABEL(EV_FF), | ||
30 | LABEL(EV_PWR), | ||
31 | LABEL(EV_FF_STATUS), | ||
32 | LABEL_END, | ||
33 | }; | ||
34 | |||
35 | static struct label syn_labels[] = { | ||
36 | LABEL(SYN_REPORT), | ||
37 | LABEL(SYN_CONFIG), | ||
38 | LABEL(SYN_MT_REPORT), | ||
39 | LABEL(SYN_DROPPED), | ||
40 | LABEL_END, | ||
41 | }; | ||
42 | |||
43 | static struct label key_labels[] = { | ||
44 | LABEL(KEY_RESERVED), | ||
45 | LABEL(KEY_ESC), | ||
46 | LABEL(KEY_1), | ||
47 | LABEL(KEY_2), | ||
48 | LABEL(KEY_3), | ||
49 | LABEL(KEY_4), | ||
50 | LABEL(KEY_5), | ||
51 | LABEL(KEY_6), | ||
52 | LABEL(KEY_7), | ||
53 | LABEL(KEY_8), | ||
54 | LABEL(KEY_9), | ||
55 | LABEL(KEY_0), | ||
56 | LABEL(KEY_MINUS), | ||
57 | LABEL(KEY_EQUAL), | ||
58 | LABEL(KEY_BACKSPACE), | ||
59 | LABEL(KEY_TAB), | ||
60 | LABEL(KEY_Q), | ||
61 | LABEL(KEY_W), | ||
62 | LABEL(KEY_E), | ||
63 | LABEL(KEY_R), | ||
64 | LABEL(KEY_T), | ||
65 | LABEL(KEY_Y), | ||
66 | LABEL(KEY_U), | ||
67 | LABEL(KEY_I), | ||
68 | LABEL(KEY_O), | ||
69 | LABEL(KEY_P), | ||
70 | LABEL(KEY_LEFTBRACE), | ||
71 | LABEL(KEY_RIGHTBRACE), | ||
72 | LABEL(KEY_ENTER), | ||
73 | LABEL(KEY_LEFTCTRL), | ||
74 | LABEL(KEY_A), | ||
75 | LABEL(KEY_S), | ||
76 | LABEL(KEY_D), | ||
77 | LABEL(KEY_F), | ||
78 | LABEL(KEY_G), | ||
79 | LABEL(KEY_H), | ||
80 | LABEL(KEY_J), | ||
81 | LABEL(KEY_K), | ||
82 | LABEL(KEY_L), | ||
83 | LABEL(KEY_SEMICOLON), | ||
84 | LABEL(KEY_APOSTROPHE), | ||
85 | LABEL(KEY_GRAVE), | ||
86 | LABEL(KEY_LEFTSHIFT), | ||
87 | LABEL(KEY_BACKSLASH), | ||
88 | LABEL(KEY_Z), | ||
89 | LABEL(KEY_X), | ||
90 | LABEL(KEY_C), | ||
91 | LABEL(KEY_V), | ||
92 | LABEL(KEY_B), | ||
93 | LABEL(KEY_N), | ||
94 | LABEL(KEY_M), | ||
95 | LABEL(KEY_COMMA), | ||
96 | LABEL(KEY_DOT), | ||
97 | LABEL(KEY_SLASH), | ||
98 | LABEL(KEY_RIGHTSHIFT), | ||
99 | LABEL(KEY_KPASTERISK), | ||
100 | LABEL(KEY_LEFTALT), | ||
101 | LABEL(KEY_SPACE), | ||
102 | LABEL(KEY_CAPSLOCK), | ||
103 | LABEL(KEY_F1), | ||
104 | LABEL(KEY_F2), | ||
105 | LABEL(KEY_F3), | ||
106 | LABEL(KEY_F4), | ||
107 | LABEL(KEY_F5), | ||
108 | LABEL(KEY_F6), | ||
109 | LABEL(KEY_F7), | ||
110 | LABEL(KEY_F8), | ||
111 | LABEL(KEY_F9), | ||
112 | LABEL(KEY_F10), | ||
113 | LABEL(KEY_NUMLOCK), | ||
114 | LABEL(KEY_SCROLLLOCK), | ||
115 | LABEL(KEY_KP7), | ||
116 | LABEL(KEY_KP8), | ||
117 | LABEL(KEY_KP9), | ||
118 | LABEL(KEY_KPMINUS), | ||
119 | LABEL(KEY_KP4), | ||
120 | LABEL(KEY_KP5), | ||
121 | LABEL(KEY_KP6), | ||
122 | LABEL(KEY_KPPLUS), | ||
123 | LABEL(KEY_KP1), | ||
124 | LABEL(KEY_KP2), | ||
125 | LABEL(KEY_KP3), | ||
126 | LABEL(KEY_KP0), | ||
127 | LABEL(KEY_KPDOT), | ||
128 | LABEL(KEY_ZENKAKUHANKAKU), | ||
129 | LABEL(KEY_102ND), | ||
130 | LABEL(KEY_F11), | ||
131 | LABEL(KEY_F12), | ||
132 | LABEL(KEY_RO), | ||
133 | LABEL(KEY_KATAKANA), | ||
134 | LABEL(KEY_HIRAGANA), | ||
135 | LABEL(KEY_HENKAN), | ||
136 | LABEL(KEY_KATAKANAHIRAGANA), | ||
137 | LABEL(KEY_MUHENKAN), | ||
138 | LABEL(KEY_KPJPCOMMA), | ||
139 | LABEL(KEY_KPENTER), | ||
140 | LABEL(KEY_RIGHTCTRL), | ||
141 | LABEL(KEY_KPSLASH), | ||
142 | LABEL(KEY_SYSRQ), | ||
143 | LABEL(KEY_RIGHTALT), | ||
144 | LABEL(KEY_LINEFEED), | ||
145 | LABEL(KEY_HOME), | ||
146 | LABEL(KEY_UP), | ||
147 | LABEL(KEY_PAGEUP), | ||
148 | LABEL(KEY_LEFT), | ||
149 | LABEL(KEY_RIGHT), | ||
150 | LABEL(KEY_END), | ||
151 | LABEL(KEY_DOWN), | ||
152 | LABEL(KEY_PAGEDOWN), | ||
153 | LABEL(KEY_INSERT), | ||
154 | LABEL(KEY_DELETE), | ||
155 | LABEL(KEY_MACRO), | ||
156 | LABEL(KEY_MUTE), | ||
157 | LABEL(KEY_VOLUMEDOWN), | ||
158 | LABEL(KEY_VOLUMEUP), | ||
159 | LABEL(KEY_POWER), | ||
160 | LABEL(KEY_KPEQUAL), | ||
161 | LABEL(KEY_KPPLUSMINUS), | ||
162 | LABEL(KEY_PAUSE), | ||
163 | LABEL(KEY_SCALE), | ||
164 | LABEL(KEY_KPCOMMA), | ||
165 | LABEL(KEY_HANGEUL), | ||
166 | LABEL(KEY_HANGUEL), | ||
167 | LABEL(KEY_HANJA), | ||
168 | LABEL(KEY_YEN), | ||
169 | LABEL(KEY_LEFTMETA), | ||
170 | LABEL(KEY_RIGHTMETA), | ||
171 | LABEL(KEY_COMPOSE), | ||
172 | LABEL(KEY_STOP), | ||
173 | LABEL(KEY_AGAIN), | ||
174 | LABEL(KEY_PROPS), | ||
175 | LABEL(KEY_UNDO), | ||
176 | LABEL(KEY_FRONT), | ||
177 | LABEL(KEY_COPY), | ||
178 | LABEL(KEY_OPEN), | ||
179 | LABEL(KEY_PASTE), | ||
180 | LABEL(KEY_FIND), | ||
181 | LABEL(KEY_CUT), | ||
182 | LABEL(KEY_HELP), | ||
183 | LABEL(KEY_MENU), | ||
184 | LABEL(KEY_CALC), | ||
185 | LABEL(KEY_SETUP), | ||
186 | LABEL(KEY_SLEEP), | ||
187 | LABEL(KEY_WAKEUP), | ||
188 | LABEL(KEY_FILE), | ||
189 | LABEL(KEY_SENDFILE), | ||
190 | LABEL(KEY_DELETEFILE), | ||
191 | LABEL(KEY_XFER), | ||
192 | LABEL(KEY_PROG1), | ||
193 | LABEL(KEY_PROG2), | ||
194 | LABEL(KEY_WWW), | ||
195 | LABEL(KEY_MSDOS), | ||
196 | LABEL(KEY_COFFEE), | ||
197 | LABEL(KEY_SCREENLOCK), | ||
198 | LABEL(KEY_DIRECTION), | ||
199 | LABEL(KEY_CYCLEWINDOWS), | ||
200 | LABEL(KEY_MAIL), | ||
201 | LABEL(KEY_BOOKMARKS), | ||
202 | LABEL(KEY_COMPUTER), | ||
203 | LABEL(KEY_BACK), | ||
204 | LABEL(KEY_FORWARD), | ||
205 | LABEL(KEY_CLOSECD), | ||
206 | LABEL(KEY_EJECTCD), | ||
207 | LABEL(KEY_EJECTCLOSECD), | ||
208 | LABEL(KEY_NEXTSONG), | ||
209 | LABEL(KEY_PLAYPAUSE), | ||
210 | LABEL(KEY_PREVIOUSSONG), | ||
211 | LABEL(KEY_STOPCD), | ||
212 | LABEL(KEY_RECORD), | ||
213 | LABEL(KEY_REWIND), | ||
214 | LABEL(KEY_PHONE), | ||
215 | LABEL(KEY_ISO), | ||
216 | LABEL(KEY_CONFIG), | ||
217 | LABEL(KEY_HOMEPAGE), | ||
218 | LABEL(KEY_REFRESH), | ||
219 | LABEL(KEY_EXIT), | ||
220 | LABEL(KEY_MOVE), | ||
221 | LABEL(KEY_EDIT), | ||
222 | LABEL(KEY_SCROLLUP), | ||
223 | LABEL(KEY_SCROLLDOWN), | ||
224 | LABEL(KEY_KPLEFTPAREN), | ||
225 | LABEL(KEY_KPRIGHTPAREN), | ||
226 | LABEL(KEY_NEW), | ||
227 | LABEL(KEY_REDO), | ||
228 | LABEL(KEY_F13), | ||
229 | LABEL(KEY_F14), | ||
230 | LABEL(KEY_F15), | ||
231 | LABEL(KEY_F16), | ||
232 | LABEL(KEY_F17), | ||
233 | LABEL(KEY_F18), | ||
234 | LABEL(KEY_F19), | ||
235 | LABEL(KEY_F20), | ||
236 | LABEL(KEY_F21), | ||
237 | LABEL(KEY_F22), | ||
238 | LABEL(KEY_F23), | ||
239 | LABEL(KEY_F24), | ||
240 | LABEL(KEY_PLAYCD), | ||
241 | LABEL(KEY_PAUSECD), | ||
242 | LABEL(KEY_PROG3), | ||
243 | LABEL(KEY_PROG4), | ||
244 | LABEL(KEY_DASHBOARD), | ||
245 | LABEL(KEY_SUSPEND), | ||
246 | LABEL(KEY_CLOSE), | ||
247 | LABEL(KEY_PLAY), | ||
248 | LABEL(KEY_FASTFORWARD), | ||
249 | LABEL(KEY_BASSBOOST), | ||
250 | LABEL(KEY_PRINT), | ||
251 | LABEL(KEY_HP), | ||
252 | LABEL(KEY_CAMERA), | ||
253 | LABEL(KEY_SOUND), | ||
254 | LABEL(KEY_QUESTION), | ||
255 | LABEL(KEY_EMAIL), | ||
256 | LABEL(KEY_CHAT), | ||
257 | LABEL(KEY_SEARCH), | ||
258 | LABEL(KEY_CONNECT), | ||
259 | LABEL(KEY_FINANCE), | ||
260 | LABEL(KEY_SPORT), | ||
261 | LABEL(KEY_SHOP), | ||
262 | LABEL(KEY_ALTERASE), | ||
263 | LABEL(KEY_CANCEL), | ||
264 | LABEL(KEY_BRIGHTNESSDOWN), | ||
265 | LABEL(KEY_BRIGHTNESSUP), | ||
266 | LABEL(KEY_MEDIA), | ||
267 | LABEL(KEY_SWITCHVIDEOMODE), | ||
268 | LABEL(KEY_KBDILLUMTOGGLE), | ||
269 | LABEL(KEY_KBDILLUMDOWN), | ||
270 | LABEL(KEY_KBDILLUMUP), | ||
271 | LABEL(KEY_SEND), | ||
272 | LABEL(KEY_REPLY), | ||
273 | LABEL(KEY_FORWARDMAIL), | ||
274 | LABEL(KEY_SAVE), | ||
275 | LABEL(KEY_DOCUMENTS), | ||
276 | LABEL(KEY_BATTERY), | ||
277 | LABEL(KEY_BLUETOOTH), | ||
278 | LABEL(KEY_WLAN), | ||
279 | LABEL(KEY_UWB), | ||
280 | LABEL(KEY_UNKNOWN), | ||
281 | LABEL(KEY_VIDEO_NEXT), | ||
282 | LABEL(KEY_VIDEO_PREV), | ||
283 | LABEL(KEY_BRIGHTNESS_CYCLE), | ||
284 | LABEL(KEY_BRIGHTNESS_ZERO), | ||
285 | LABEL(KEY_DISPLAY_OFF), | ||
286 | LABEL(KEY_WIMAX), | ||
287 | LABEL(KEY_RFKILL), | ||
288 | LABEL(BTN_0), | ||
289 | LABEL(BTN_1), | ||
290 | LABEL(BTN_2), | ||
291 | LABEL(BTN_3), | ||
292 | LABEL(BTN_4), | ||
293 | LABEL(BTN_5), | ||
294 | LABEL(BTN_6), | ||
295 | LABEL(BTN_7), | ||
296 | LABEL(BTN_8), | ||
297 | LABEL(BTN_9), | ||
298 | LABEL(BTN_LEFT), | ||
299 | LABEL(BTN_RIGHT), | ||
300 | LABEL(BTN_MIDDLE), | ||
301 | LABEL(BTN_SIDE), | ||
302 | LABEL(BTN_EXTRA), | ||
303 | LABEL(BTN_FORWARD), | ||
304 | LABEL(BTN_BACK), | ||
305 | LABEL(BTN_TASK), | ||
306 | LABEL(BTN_JOYSTICK), | ||
307 | LABEL(BTN_TRIGGER), | ||
308 | LABEL(BTN_THUMB), | ||
309 | LABEL(BTN_THUMB2), | ||
310 | LABEL(BTN_TOP), | ||
311 | LABEL(BTN_TOP2), | ||
312 | LABEL(BTN_PINKIE), | ||
313 | LABEL(BTN_BASE), | ||
314 | LABEL(BTN_BASE2), | ||
315 | LABEL(BTN_BASE3), | ||
316 | LABEL(BTN_BASE4), | ||
317 | LABEL(BTN_BASE5), | ||
318 | LABEL(BTN_BASE6), | ||
319 | LABEL(BTN_DEAD), | ||
320 | LABEL(BTN_A), | ||
321 | LABEL(BTN_B), | ||
322 | LABEL(BTN_C), | ||
323 | LABEL(BTN_X), | ||
324 | LABEL(BTN_Y), | ||
325 | LABEL(BTN_Z), | ||
326 | LABEL(BTN_TL), | ||
327 | LABEL(BTN_TR), | ||
328 | LABEL(BTN_TL2), | ||
329 | LABEL(BTN_TR2), | ||
330 | LABEL(BTN_SELECT), | ||
331 | LABEL(BTN_START), | ||
332 | LABEL(BTN_MODE), | ||
333 | LABEL(BTN_THUMBL), | ||
334 | LABEL(BTN_THUMBR), | ||
335 | LABEL(BTN_TOOL_PEN), | ||
336 | LABEL(BTN_TOOL_RUBBER), | ||
337 | LABEL(BTN_TOOL_BRUSH), | ||
338 | LABEL(BTN_TOOL_PENCIL), | ||
339 | LABEL(BTN_TOOL_AIRBRUSH), | ||
340 | LABEL(BTN_TOOL_FINGER), | ||
341 | LABEL(BTN_TOOL_MOUSE), | ||
342 | LABEL(BTN_TOOL_LENS), | ||
343 | LABEL(BTN_TOUCH), | ||
344 | LABEL(BTN_STYLUS), | ||
345 | LABEL(BTN_STYLUS2), | ||
346 | LABEL(BTN_TOOL_DOUBLETAP), | ||
347 | LABEL(BTN_TOOL_TRIPLETAP), | ||
348 | LABEL(BTN_TOOL_QUADTAP), | ||
349 | LABEL(BTN_GEAR_DOWN), | ||
350 | LABEL(BTN_GEAR_UP), | ||
351 | LABEL(KEY_OK), | ||
352 | LABEL(KEY_SELECT), | ||
353 | LABEL(KEY_GOTO), | ||
354 | LABEL(KEY_CLEAR), | ||
355 | LABEL(KEY_POWER2), | ||
356 | LABEL(KEY_OPTION), | ||
357 | LABEL(KEY_INFO), | ||
358 | LABEL(KEY_TIME), | ||
359 | LABEL(KEY_VENDOR), | ||
360 | LABEL(KEY_ARCHIVE), | ||
361 | LABEL(KEY_PROGRAM), | ||
362 | LABEL(KEY_CHANNEL), | ||
363 | LABEL(KEY_FAVORITES), | ||
364 | LABEL(KEY_EPG), | ||
365 | LABEL(KEY_PVR), | ||
366 | LABEL(KEY_MHP), | ||
367 | LABEL(KEY_LANGUAGE), | ||
368 | LABEL(KEY_TITLE), | ||
369 | LABEL(KEY_SUBTITLE), | ||
370 | LABEL(KEY_ANGLE), | ||
371 | LABEL(KEY_ZOOM), | ||
372 | LABEL(KEY_MODE), | ||
373 | LABEL(KEY_KEYBOARD), | ||
374 | LABEL(KEY_SCREEN), | ||
375 | LABEL(KEY_PC), | ||
376 | LABEL(KEY_TV), | ||
377 | LABEL(KEY_TV2), | ||
378 | LABEL(KEY_VCR), | ||
379 | LABEL(KEY_VCR2), | ||
380 | LABEL(KEY_SAT), | ||
381 | LABEL(KEY_SAT2), | ||
382 | LABEL(KEY_CD), | ||
383 | LABEL(KEY_TAPE), | ||
384 | LABEL(KEY_RADIO), | ||
385 | LABEL(KEY_TUNER), | ||
386 | LABEL(KEY_PLAYER), | ||
387 | LABEL(KEY_TEXT), | ||
388 | LABEL(KEY_DVD), | ||
389 | LABEL(KEY_AUX), | ||
390 | LABEL(KEY_MP3), | ||
391 | LABEL(KEY_AUDIO), | ||
392 | LABEL(KEY_VIDEO), | ||
393 | LABEL(KEY_DIRECTORY), | ||
394 | LABEL(KEY_LIST), | ||
395 | LABEL(KEY_MEMO), | ||
396 | LABEL(KEY_CALENDAR), | ||
397 | LABEL(KEY_RED), | ||
398 | LABEL(KEY_GREEN), | ||
399 | LABEL(KEY_YELLOW), | ||
400 | LABEL(KEY_BLUE), | ||
401 | LABEL(KEY_CHANNELUP), | ||
402 | LABEL(KEY_CHANNELDOWN), | ||
403 | LABEL(KEY_FIRST), | ||
404 | LABEL(KEY_LAST), | ||
405 | LABEL(KEY_AB), | ||
406 | LABEL(KEY_NEXT), | ||
407 | LABEL(KEY_RESTART), | ||
408 | LABEL(KEY_SLOW), | ||
409 | LABEL(KEY_SHUFFLE), | ||
410 | LABEL(KEY_BREAK), | ||
411 | LABEL(KEY_PREVIOUS), | ||
412 | LABEL(KEY_DIGITS), | ||
413 | LABEL(KEY_TEEN), | ||
414 | LABEL(KEY_TWEN), | ||
415 | LABEL(KEY_VIDEOPHONE), | ||
416 | LABEL(KEY_GAMES), | ||
417 | LABEL(KEY_ZOOMIN), | ||
418 | LABEL(KEY_ZOOMOUT), | ||
419 | LABEL(KEY_ZOOMRESET), | ||
420 | LABEL(KEY_WORDPROCESSOR), | ||
421 | LABEL(KEY_EDITOR), | ||
422 | LABEL(KEY_SPREADSHEET), | ||
423 | LABEL(KEY_GRAPHICSEDITOR), | ||
424 | LABEL(KEY_PRESENTATION), | ||
425 | LABEL(KEY_DATABASE), | ||
426 | LABEL(KEY_NEWS), | ||
427 | LABEL(KEY_VOICEMAIL), | ||
428 | LABEL(KEY_ADDRESSBOOK), | ||
429 | LABEL(KEY_MESSENGER), | ||
430 | LABEL(KEY_DISPLAYTOGGLE), | ||
431 | LABEL(KEY_SPELLCHECK), | ||
432 | LABEL(KEY_LOGOFF), | ||
433 | LABEL(KEY_DOLLAR), | ||
434 | LABEL(KEY_EURO), | ||
435 | LABEL(KEY_FRAMEBACK), | ||
436 | LABEL(KEY_FRAMEFORWARD), | ||
437 | LABEL(KEY_CONTEXT_MENU), | ||
438 | LABEL(KEY_MEDIA_REPEAT), | ||
439 | LABEL(KEY_10CHANNELSUP), | ||
440 | LABEL(KEY_10CHANNELSDOWN), | ||
441 | LABEL(KEY_IMAGES), | ||
442 | LABEL(KEY_DEL_EOL), | ||
443 | LABEL(KEY_DEL_EOS), | ||
444 | LABEL(KEY_INS_LINE), | ||
445 | LABEL(KEY_DEL_LINE), | ||
446 | LABEL(KEY_FN), | ||
447 | LABEL(KEY_FN_ESC), | ||
448 | LABEL(KEY_FN_F1), | ||
449 | LABEL(KEY_FN_F2), | ||
450 | LABEL(KEY_FN_F3), | ||
451 | LABEL(KEY_FN_F4), | ||
452 | LABEL(KEY_FN_F5), | ||
453 | LABEL(KEY_FN_F6), | ||
454 | LABEL(KEY_FN_F7), | ||
455 | LABEL(KEY_FN_F8), | ||
456 | LABEL(KEY_FN_F9), | ||
457 | LABEL(KEY_FN_F10), | ||
458 | LABEL(KEY_FN_F11), | ||
459 | LABEL(KEY_FN_F12), | ||
460 | LABEL(KEY_FN_1), | ||
461 | LABEL(KEY_FN_2), | ||
462 | LABEL(KEY_FN_D), | ||
463 | LABEL(KEY_FN_E), | ||
464 | LABEL(KEY_FN_F), | ||
465 | LABEL(KEY_FN_S), | ||
466 | LABEL(KEY_FN_B), | ||
467 | LABEL(KEY_BRL_DOT1), | ||
468 | LABEL(KEY_BRL_DOT2), | ||
469 | LABEL(KEY_BRL_DOT3), | ||
470 | LABEL(KEY_BRL_DOT4), | ||
471 | LABEL(KEY_BRL_DOT5), | ||
472 | LABEL(KEY_BRL_DOT6), | ||
473 | LABEL(KEY_BRL_DOT7), | ||
474 | LABEL(KEY_BRL_DOT8), | ||
475 | LABEL(KEY_BRL_DOT9), | ||
476 | LABEL(KEY_BRL_DOT10), | ||
477 | LABEL(KEY_NUMERIC_0), | ||
478 | LABEL(KEY_NUMERIC_1), | ||
479 | LABEL(KEY_NUMERIC_2), | ||
480 | LABEL(KEY_NUMERIC_3), | ||
481 | LABEL(KEY_NUMERIC_4), | ||
482 | LABEL(KEY_NUMERIC_5), | ||
483 | LABEL(KEY_NUMERIC_6), | ||
484 | LABEL(KEY_NUMERIC_7), | ||
485 | LABEL(KEY_NUMERIC_8), | ||
486 | LABEL(KEY_NUMERIC_9), | ||
487 | LABEL(KEY_NUMERIC_STAR), | ||
488 | LABEL(KEY_NUMERIC_POUND), | ||
489 | LABEL(KEY_CAMERA_FOCUS), | ||
490 | LABEL(KEY_WPS_BUTTON), | ||
491 | LABEL(KEY_TOUCHPAD_TOGGLE), | ||
492 | LABEL(KEY_TOUCHPAD_ON), | ||
493 | LABEL(KEY_TOUCHPAD_OFF), | ||
494 | LABEL(KEY_CAMERA_ZOOMIN), | ||
495 | LABEL(KEY_CAMERA_ZOOMOUT), | ||
496 | LABEL(KEY_CAMERA_UP), | ||
497 | LABEL(KEY_CAMERA_DOWN), | ||
498 | LABEL(KEY_CAMERA_LEFT), | ||
499 | LABEL(KEY_CAMERA_RIGHT), | ||
500 | LABEL(BTN_TRIGGER_HAPPY1), | ||
501 | LABEL(BTN_TRIGGER_HAPPY2), | ||
502 | LABEL(BTN_TRIGGER_HAPPY3), | ||
503 | LABEL(BTN_TRIGGER_HAPPY4), | ||
504 | LABEL(BTN_TRIGGER_HAPPY5), | ||
505 | LABEL(BTN_TRIGGER_HAPPY6), | ||
506 | LABEL(BTN_TRIGGER_HAPPY7), | ||
507 | LABEL(BTN_TRIGGER_HAPPY8), | ||
508 | LABEL(BTN_TRIGGER_HAPPY9), | ||
509 | LABEL(BTN_TRIGGER_HAPPY10), | ||
510 | LABEL(BTN_TRIGGER_HAPPY11), | ||
511 | LABEL(BTN_TRIGGER_HAPPY12), | ||
512 | LABEL(BTN_TRIGGER_HAPPY13), | ||
513 | LABEL(BTN_TRIGGER_HAPPY14), | ||
514 | LABEL(BTN_TRIGGER_HAPPY15), | ||
515 | LABEL(BTN_TRIGGER_HAPPY16), | ||
516 | LABEL(BTN_TRIGGER_HAPPY17), | ||
517 | LABEL(BTN_TRIGGER_HAPPY18), | ||
518 | LABEL(BTN_TRIGGER_HAPPY19), | ||
519 | LABEL(BTN_TRIGGER_HAPPY20), | ||
520 | LABEL(BTN_TRIGGER_HAPPY21), | ||
521 | LABEL(BTN_TRIGGER_HAPPY22), | ||
522 | LABEL(BTN_TRIGGER_HAPPY23), | ||
523 | LABEL(BTN_TRIGGER_HAPPY24), | ||
524 | LABEL(BTN_TRIGGER_HAPPY25), | ||
525 | LABEL(BTN_TRIGGER_HAPPY26), | ||
526 | LABEL(BTN_TRIGGER_HAPPY27), | ||
527 | LABEL(BTN_TRIGGER_HAPPY28), | ||
528 | LABEL(BTN_TRIGGER_HAPPY29), | ||
529 | LABEL(BTN_TRIGGER_HAPPY30), | ||
530 | LABEL(BTN_TRIGGER_HAPPY31), | ||
531 | LABEL(BTN_TRIGGER_HAPPY32), | ||
532 | LABEL(BTN_TRIGGER_HAPPY33), | ||
533 | LABEL(BTN_TRIGGER_HAPPY34), | ||
534 | LABEL(BTN_TRIGGER_HAPPY35), | ||
535 | LABEL(BTN_TRIGGER_HAPPY36), | ||
536 | LABEL(BTN_TRIGGER_HAPPY37), | ||
537 | LABEL(BTN_TRIGGER_HAPPY38), | ||
538 | LABEL(BTN_TRIGGER_HAPPY39), | ||
539 | LABEL(BTN_TRIGGER_HAPPY40), | ||
540 | LABEL_END, | ||
541 | }; | ||
542 | |||
543 | static struct label rel_labels[] = { | ||
544 | LABEL(REL_X), | ||
545 | LABEL(REL_Y), | ||
546 | LABEL(REL_Z), | ||
547 | LABEL(REL_RX), | ||
548 | LABEL(REL_RY), | ||
549 | LABEL(REL_RZ), | ||
550 | LABEL(REL_HWHEEL), | ||
551 | LABEL(REL_DIAL), | ||
552 | LABEL(REL_WHEEL), | ||
553 | LABEL(REL_MISC), | ||
554 | LABEL_END, | ||
555 | }; | ||
556 | |||
557 | static struct label abs_labels[] = { | ||
558 | LABEL(ABS_X), | ||
559 | LABEL(ABS_Y), | ||
560 | LABEL(ABS_Z), | ||
561 | LABEL(ABS_RX), | ||
562 | LABEL(ABS_RY), | ||
563 | LABEL(ABS_RZ), | ||
564 | LABEL(ABS_THROTTLE), | ||
565 | LABEL(ABS_RUDDER), | ||
566 | LABEL(ABS_WHEEL), | ||
567 | LABEL(ABS_GAS), | ||
568 | LABEL(ABS_BRAKE), | ||
569 | LABEL(ABS_HAT0X), | ||
570 | LABEL(ABS_HAT0Y), | ||
571 | LABEL(ABS_HAT1X), | ||
572 | LABEL(ABS_HAT1Y), | ||
573 | LABEL(ABS_HAT2X), | ||
574 | LABEL(ABS_HAT2Y), | ||
575 | LABEL(ABS_HAT3X), | ||
576 | LABEL(ABS_HAT3Y), | ||
577 | LABEL(ABS_PRESSURE), | ||
578 | LABEL(ABS_DISTANCE), | ||
579 | LABEL(ABS_TILT_X), | ||
580 | LABEL(ABS_TILT_Y), | ||
581 | LABEL(ABS_TOOL_WIDTH), | ||
582 | LABEL(ABS_VOLUME), | ||
583 | LABEL(ABS_MISC), | ||
584 | LABEL(ABS_MT_SLOT), | ||
585 | LABEL(ABS_MT_TOUCH_MAJOR), | ||
586 | LABEL(ABS_MT_TOUCH_MINOR), | ||
587 | LABEL(ABS_MT_WIDTH_MAJOR), | ||
588 | LABEL(ABS_MT_WIDTH_MINOR), | ||
589 | LABEL(ABS_MT_ORIENTATION), | ||
590 | LABEL(ABS_MT_POSITION_X), | ||
591 | LABEL(ABS_MT_POSITION_Y), | ||
592 | LABEL(ABS_MT_TOOL_TYPE), | ||
593 | LABEL(ABS_MT_BLOB_ID), | ||
594 | LABEL(ABS_MT_TRACKING_ID), | ||
595 | LABEL(ABS_MT_PRESSURE), | ||
596 | LABEL(ABS_MT_DISTANCE), | ||
597 | LABEL_END, | ||
598 | }; | ||
599 | |||
600 | static struct label sw_labels[] = { | ||
601 | LABEL(SW_LID), | ||
602 | LABEL(SW_TABLET_MODE), | ||
603 | LABEL(SW_HEADPHONE_INSERT), | ||
604 | LABEL(SW_RFKILL_ALL), | ||
605 | LABEL(SW_RADIO), | ||
606 | LABEL(SW_MICROPHONE_INSERT), | ||
607 | LABEL(SW_DOCK), | ||
608 | LABEL(SW_LINEOUT_INSERT), | ||
609 | LABEL(SW_JACK_PHYSICAL_INSERT), | ||
610 | LABEL(SW_VIDEOOUT_INSERT), | ||
611 | LABEL(SW_CAMERA_LENS_COVER), | ||
612 | LABEL(SW_KEYPAD_SLIDE), | ||
613 | LABEL(SW_FRONT_PROXIMITY), | ||
614 | LABEL(SW_ROTATE_LOCK), | ||
615 | LABEL_END, | ||
616 | }; | ||
617 | |||
618 | static struct label msc_labels[] = { | ||
619 | LABEL(MSC_SERIAL), | ||
620 | LABEL(MSC_PULSELED), | ||
621 | LABEL(MSC_GESTURE), | ||
622 | LABEL(MSC_RAW), | ||
623 | LABEL(MSC_SCAN), | ||
624 | LABEL_END, | ||
625 | }; | ||
626 | |||
627 | static struct label led_labels[] = { | ||
628 | LABEL(LED_NUML), | ||
629 | LABEL(LED_CAPSL), | ||
630 | LABEL(LED_SCROLLL), | ||
631 | LABEL(LED_COMPOSE), | ||
632 | LABEL(LED_KANA), | ||
633 | LABEL(LED_SLEEP), | ||
634 | LABEL(LED_SUSPEND), | ||
635 | LABEL(LED_MUTE), | ||
636 | LABEL(LED_MISC), | ||
637 | LABEL(LED_MAIL), | ||
638 | LABEL(LED_CHARGING), | ||
639 | LABEL_END, | ||
640 | }; | ||
641 | |||
642 | static struct label rep_labels[] = { | ||
643 | LABEL(REP_DELAY), | ||
644 | LABEL(REP_PERIOD), | ||
645 | LABEL_END, | ||
646 | }; | ||
647 | |||
648 | static struct label snd_labels[] = { | ||
649 | LABEL(SND_CLICK), | ||
650 | LABEL(SND_BELL), | ||
651 | LABEL(SND_TONE), | ||
652 | LABEL_END, | ||
653 | }; | ||
654 | |||
655 | #if 0 | ||
656 | static struct label id_labels[] = { | ||
657 | LABEL(ID_BUS), | ||
658 | LABEL(ID_VENDOR), | ||
659 | LABEL(ID_PRODUCT), | ||
660 | LABEL(ID_VERSION), | ||
661 | LABEL_END, | ||
662 | }; | ||
663 | |||
664 | static struct label bus_labels[] = { | ||
665 | LABEL(BUS_PCI), | ||
666 | LABEL(BUS_ISAPNP), | ||
667 | LABEL(BUS_USB), | ||
668 | LABEL(BUS_HIL), | ||
669 | LABEL(BUS_BLUETOOTH), | ||
670 | LABEL(BUS_VIRTUAL), | ||
671 | LABEL(BUS_ISA), | ||
672 | LABEL(BUS_I8042), | ||
673 | LABEL(BUS_XTKBD), | ||
674 | LABEL(BUS_RS232), | ||
675 | LABEL(BUS_GAMEPORT), | ||
676 | LABEL(BUS_PARPORT), | ||
677 | LABEL(BUS_AMIGA), | ||
678 | LABEL(BUS_ADB), | ||
679 | LABEL(BUS_I2C), | ||
680 | LABEL(BUS_HOST), | ||
681 | LABEL(BUS_GSC), | ||
682 | LABEL(BUS_ATARI), | ||
683 | LABEL(BUS_SPI), | ||
684 | LABEL_END, | ||
685 | }; | ||
686 | #endif | ||
687 | |||
688 | static struct label mt_tool_labels[] = { | ||
689 | LABEL(MT_TOOL_FINGER), | ||
690 | LABEL(MT_TOOL_PEN), | ||
691 | LABEL(MT_TOOL_MAX), | ||
692 | LABEL_END, | ||
693 | }; | ||
694 | |||
695 | static struct label ff_status_labels[] = { | ||
696 | LABEL(FF_STATUS_STOPPED), | ||
697 | LABEL(FF_STATUS_PLAYING), | ||
698 | LABEL(FF_STATUS_MAX), | ||
699 | LABEL_END, | ||
700 | }; | ||
701 | |||
702 | static struct label ff_labels[] = { | ||
703 | LABEL(FF_RUMBLE), | ||
704 | LABEL(FF_PERIODIC), | ||
705 | LABEL(FF_CONSTANT), | ||
706 | LABEL(FF_SPRING), | ||
707 | LABEL(FF_FRICTION), | ||
708 | LABEL(FF_DAMPER), | ||
709 | LABEL(FF_INERTIA), | ||
710 | LABEL(FF_RAMP), | ||
711 | LABEL(FF_SQUARE), | ||
712 | LABEL(FF_TRIANGLE), | ||
713 | LABEL(FF_SINE), | ||
714 | LABEL(FF_SAW_UP), | ||
715 | LABEL(FF_SAW_DOWN), | ||
716 | LABEL(FF_CUSTOM), | ||
717 | LABEL(FF_GAIN), | ||
718 | LABEL(FF_AUTOCENTER), | ||
719 | LABEL_END, | ||
720 | }; | ||
721 | |||
722 | static struct label key_value_labels[] = { | ||
723 | { "UP", 0 }, | ||
724 | { "DOWN", 1 }, | ||
725 | { "REPEAT", 2 }, | ||
726 | LABEL_END, | ||
727 | }; | ||
diff --git a/toolbox/runcon.c b/toolbox/runcon.c deleted file mode 100644 index 4a57bf316..000000000 --- a/toolbox/runcon.c +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <stdlib.h> | ||
3 | #include <string.h> | ||
4 | #include <unistd.h> | ||
5 | #include <errno.h> | ||
6 | #include <selinux/selinux.h> | ||
7 | |||
8 | int runcon_main(int argc, char **argv) | ||
9 | { | ||
10 | int rc; | ||
11 | |||
12 | if (argc < 3) { | ||
13 | fprintf(stderr, "usage: %s context program args...\n", argv[0]); | ||
14 | exit(1); | ||
15 | } | ||
16 | |||
17 | rc = setexeccon(argv[1]); | ||
18 | if (rc < 0) { | ||
19 | fprintf(stderr, "Could not set context to %s: %s\n", argv[1], strerror(errno)); | ||
20 | exit(2); | ||
21 | } | ||
22 | |||
23 | argv += 2; | ||
24 | argc -= 2; | ||
25 | execvp(argv[0], argv); | ||
26 | fprintf(stderr, "Could not exec %s: %s\n", argv[0], strerror(errno)); | ||
27 | exit(3); | ||
28 | } | ||