diff options
Diffstat (limited to 'scripts/lib/bsp/help.py')
-rw-r--r-- | scripts/lib/bsp/help.py | 228 |
1 files changed, 228 insertions, 0 deletions
diff --git a/scripts/lib/bsp/help.py b/scripts/lib/bsp/help.py index 3a1f52c9fb..eac172af19 100644 --- a/scripts/lib/bsp/help.py +++ b/scripts/lib/bsp/help.py | |||
@@ -595,6 +595,234 @@ DESCRIPTION | |||
595 | """ | 595 | """ |
596 | 596 | ||
597 | ## | 597 | ## |
598 | # yocto-layer help and usage strings | ||
599 | ## | ||
600 | |||
601 | yocto_layer_usage = """ | ||
602 | |||
603 | Create a generic Yocto layer. | ||
604 | |||
605 | usage: yocto-layer [--version] [--help] COMMAND [ARGS] | ||
606 | |||
607 | Current 'yocto-layer' commands are: | ||
608 | create Create a new generic Yocto layer | ||
609 | list List available values for input options and properties | ||
610 | |||
611 | See 'yocto-layer help COMMAND' for more information on a specific command. | ||
612 | """ | ||
613 | |||
614 | yocto_layer_help_usage = """ | ||
615 | |||
616 | usage: yocto-layer help <subcommand> | ||
617 | |||
618 | This command displays detailed help for the specified subcommand. | ||
619 | """ | ||
620 | |||
621 | yocto_layer_create_usage = """ | ||
622 | |||
623 | Create a new generic Yocto layer | ||
624 | |||
625 | usage: yocto-layer create <layer-name> [-o <DIRNAME> | --outdir <DIRNAME>] | ||
626 | [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>] | ||
627 | |||
628 | This command creates a generic Yocto layer based on the specified | ||
629 | parameters. The new layer will be a new Yocto layer contained by | ||
630 | default within the top-level directory specified as | ||
631 | 'meta-layer-name'. The -o option can be used to place the layer in a | ||
632 | directory with a different name and location. | ||
633 | |||
634 | NOTE: Once created, you should add your new layer to your | ||
635 | bblayers.conf file in order for it to be subsequently seen and | ||
636 | modified by the yocto-kernel tool. Instructions for doing this can | ||
637 | be found in the README file generated in the layer's top-level | ||
638 | directory. | ||
639 | |||
640 | See 'yocto layer help create' for more detailed instructions. | ||
641 | """ | ||
642 | |||
643 | yocto_layer_create_help = """ | ||
644 | |||
645 | NAME | ||
646 | yocto-layer create - Create a new generic Yocto layer | ||
647 | |||
648 | SYNOPSIS | ||
649 | yocto-layer create <layer-name> [-o <DIRNAME> | --outdir <DIRNAME>] | ||
650 | [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>] | ||
651 | |||
652 | DESCRIPTION | ||
653 | This command creates a generic Yocto layer based on the specified | ||
654 | parameters. The new layer will be a new Yocto layer contained by | ||
655 | default within the top-level directory specified as | ||
656 | 'meta-layer-name'. The -o option can be used to place the layer | ||
657 | in a directory with a different name and location. | ||
658 | |||
659 | The layer-specific properties that define the values that will be | ||
660 | used to generate the layer can be specified on the command-line | ||
661 | using the -i option and supplying a JSON object consisting of the | ||
662 | set of name:value pairs needed by the layer. | ||
663 | |||
664 | If the -i option is not used, the user will be interactively | ||
665 | prompted for each of the required property values, which will then | ||
666 | be used as values for layer generation. | ||
667 | |||
668 | The set of properties available can be listed using the | ||
669 | 'yocto-layer list' command. | ||
670 | |||
671 | Specifying -c causes the Python code generated and executed to | ||
672 | create the layer to be dumped to the 'bspgen.out' file in the | ||
673 | current directory, and is useful for debugging. | ||
674 | |||
675 | NOTE: Once created, you should add your new layer to your | ||
676 | bblayers.conf file in order for it to be subsequently seen and | ||
677 | modified by the yocto-kernel tool. Instructions for doing this | ||
678 | can be found in the README file generated in the layer's top-level | ||
679 | directory. | ||
680 | |||
681 | For example, assuming your poky repo is at /path/to/poky, your new | ||
682 | layer is at /path/to/poky/meta-mylayer, and your build directory | ||
683 | is /path/to/build: | ||
684 | |||
685 | $ gedit /path/to/build/conf/bblayers.conf | ||
686 | |||
687 | BBLAYERS ?= " \\ | ||
688 | /path/to/poky/meta \\ | ||
689 | /path/to/poky/meta-yocto \\ | ||
690 | /path/to/poky/meta-mylayer \\ | ||
691 | " | ||
692 | """ | ||
693 | |||
694 | yocto_layer_list_usage = """ | ||
695 | |||
696 | usage: yocto-layer list properties | ||
697 | [-o <JSON PROPERTY FILE> | --outfile <JSON PROPERTY_FILE>] | ||
698 | yocto-layer list property <xxx> | ||
699 | [-o <JSON PROPERTY FILE> | --outfile <JSON PROPERTY_FILE>] | ||
700 | |||
701 | This command enumerates the complete set of possible values for a | ||
702 | specified option or property needed by the layer creation process. | ||
703 | |||
704 | The first form enumerates all the possible properties that exist and | ||
705 | must have values specified for them in the 'yocto-layer create' | ||
706 | command. | ||
707 | |||
708 | The second form enumerates all the possible values that exist and can | ||
709 | be specified for any of the enumerable properties in the 'yocto-layer | ||
710 | create' command. | ||
711 | |||
712 | See 'yocto-layer help list' for more details. | ||
713 | """ | ||
714 | |||
715 | yocto_layer_list_help = """ | ||
716 | |||
717 | NAME | ||
718 | yocto-layer list - List available values for layer input options and properties | ||
719 | |||
720 | SYNOPSIS | ||
721 | yocto-layer list properties | ||
722 | [--o <JSON PROPERTY FILE> | -outfile <JSON PROPERTY_FILE>] | ||
723 | yocto-layer list property <xxx> | ||
724 | [--o <JSON PROPERTY FILE> | -outfile <JSON PROPERTY_FILE>] | ||
725 | |||
726 | DESCRIPTION | ||
727 | This command enumerates the complete set of possible values for a | ||
728 | specified option or property needed by the layer creation process. | ||
729 | |||
730 | The first form enumerates all the possible properties that exist | ||
731 | and must have values specified for them in the 'yocto-layer | ||
732 | create' command. This command is mainly meant to aid the | ||
733 | development of user interface alternatives to the default | ||
734 | text-based prompting interface. If the -o option is specified, | ||
735 | the list of properties, in addition to being displayed, will be | ||
736 | written to the specified file as a JSON object. In this case, the | ||
737 | object will consist of the set of name:value pairs corresponding | ||
738 | to the (possibly nested) dictionary of properties defined by the | ||
739 | input statements used by the BSP. Some example output for the | ||
740 | 'list properties' command: | ||
741 | |||
742 | $ yocto-layer list properties | ||
743 | "example_bbappend_name" : { | ||
744 | "default" : example | ||
745 | "msg" : Please enter the name you'd like to use for your bbappend file: | ||
746 | "type" : edit | ||
747 | "prio" : 20 | ||
748 | "filename" : /home/trz/yocto/yocto-layer-dev/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall | ||
749 | } | ||
750 | "create_example_recipe" : { | ||
751 | "default" : n | ||
752 | "msg" : Would you like to have an example recipe created? (y/n) | ||
753 | "type" : boolean | ||
754 | "prio" : 20 | ||
755 | "filename" : /home/trz/yocto/yocto-layer-dev/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall | ||
756 | } | ||
757 | "example_recipe_name" : { | ||
758 | "default" : example | ||
759 | "msg" : Please enter the name you'd like to use for your example recipe: | ||
760 | "type" : edit | ||
761 | "prio" : 20 | ||
762 | "filename" : /home/trz/yocto/yocto-layer-dev/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall | ||
763 | } | ||
764 | "layer_priority" : { | ||
765 | "default" : 6 | ||
766 | "msg" : Please enter the layer priority you'd like to use for the layer: | ||
767 | "type" : edit | ||
768 | "prio" : 20 | ||
769 | "filename" : /home/trz/yocto/yocto-layer-dev/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall | ||
770 | } | ||
771 | "create_example_bbappend" : { | ||
772 | "default" : n | ||
773 | "msg" : Would you like to have an example bbappend file created? (y/n) | ||
774 | "type" : boolean | ||
775 | "prio" : 20 | ||
776 | "filename" : /home/trz/yocto/yocto-layer-dev/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall | ||
777 | } | ||
778 | "example_bbappend_version" : { | ||
779 | "default" : 0.1 | ||
780 | "msg" : Please enter the version number you'd like to use for your bbappend file (this should match the recipe you're appending to): | ||
781 | "type" : edit | ||
782 | "prio" : 20 | ||
783 | "filename" : /home/trz/yocto/yocto-layer-dev/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall | ||
784 | } | ||
785 | |||
786 | Each entry in the output consists of the name of the input element | ||
787 | e.g. "layer_priority", followed by the properties defined for that | ||
788 | element enclosed in braces. This information should provide | ||
789 | sufficient information to create a complete user interface. Two | ||
790 | features of the scheme provide for conditional input. First, if a | ||
791 | Python "if" statement appears in place of an input element name, | ||
792 | the set of enclosed input elements apply and should be presented | ||
793 | to the user only if the 'if' statement evaluates to true. The | ||
794 | test in the if statement will always reference another input | ||
795 | element in the list, which means that the element being tested | ||
796 | should be presented to the user before the elements enclosed by | ||
797 | the if block. Secondly, in a similar way, some elements contain | ||
798 | "depends-on" and depends-on-val" tags, which mean that the | ||
799 | affected input element should only be presented to the user if the | ||
800 | element it depends on has already been presented to the user and | ||
801 | the user has selected the specified value for that element. | ||
802 | |||
803 | The second form enumerates all the possible values that exist and | ||
804 | can be specified for any of the enumerable properties in the | ||
805 | 'yocto-layer create' command. If the -o option is specified, the | ||
806 | list of values for the given property, in addition to being | ||
807 | displayed, will be written to the specified file as a JSON object. | ||
808 | In this case, the object will consist of the set of name:value | ||
809 | pairs corresponding to the array of property values associated | ||
810 | with the property. | ||
811 | |||
812 | $ yocto-layer list property layer_priority | ||
813 | [no output - layer_priority is a text field that has no enumerable values] | ||
814 | |||
815 | The second form as well is meant mainly for developers of | ||
816 | alternative interfaces - it allows the developer to fetch the | ||
817 | possible values for a given input element on-demand. This | ||
818 | on-demand capability is especially valuable for elements that | ||
819 | require relatively expensive remote operations to fulfill, such as | ||
820 | the example that returns the set of branches available in a remote | ||
821 | git tree above. | ||
822 | |||
823 | """ | ||
824 | |||
825 | ## | ||
598 | # test code | 826 | # test code |
599 | ## | 827 | ## |
600 | 828 | ||