summaryrefslogtreecommitdiffstats
path: root/scripts/lib/bsp/kernel.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/bsp/kernel.py')
-rw-r--r--scripts/lib/bsp/kernel.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py
index 0308600a42..ac0b074b5d 100644
--- a/scripts/lib/bsp/kernel.py
+++ b/scripts/lib/bsp/kernel.py
@@ -758,6 +758,56 @@ def yocto_kernel_available_features_list(scripts_path, machine):
758 print_feature_descs(layer, "features") 758 print_feature_descs(layer, "features")
759 759
760 760
761def find_feature_desc_url(git_url, feature):
762 """
763 Find the url of the kernel feature in the kernel repo specified
764 from the BSP's kernel recipe SRC_URI.
765 """
766 feature_desc_url = ""
767 if git_url.startswith("git://"):
768 git_url = git_url[len("git://"):].strip()
769 s = git_url.split("/")
770 if s[1].endswith(".git"):
771 s[1] = s[1][:len(s[1]) - len(".git")]
772 feature_desc_url = "http://" + s[0] + "/cgit/cgit.cgi/" + s[1] + \
773 "/plain/meta/cfg/kernel-cache/" + feature + "?h=meta"
774
775 return feature_desc_url
776
777
778def get_feature_desc(git_url, feature):
779 """
780 Return a feature description of the form 'description [compatibility]
781 BSPs, as gathered from the set of feature sources.
782 """
783 feature_desc_url = find_feature_desc_url(git_url, feature)
784 feature_desc_cmd = "wget -q -O - " + feature_desc_url
785 tmp = subprocess.Popen(feature_desc_cmd, shell=True, stdout=subprocess.PIPE).stdout.read()
786
787 return find_feature_desc(tmp.split("\n"))
788
789
790def yocto_kernel_feature_describe(scripts_path, machine, feature):
791 """
792 Display the description of a specific kernel feature available for
793 use in a BSP.
794 """
795 layer = find_bsp_layer(scripts_path, machine)
796
797 kernel = find_current_kernel(layer, machine)
798 if not kernel:
799 print "Couldn't determine the kernel for this BSP, exiting."
800 sys.exit(1)
801
802 context = create_context(machine, "arch", scripts_path)
803 context["name"] = "name"
804 context["filename"] = kernel
805 giturl = find_giturl(context)
806
807 desc = get_feature_desc(giturl, feature)
808
809 print desc
810
761 811
762def base_branches(context): 812def base_branches(context):
763 """ 813 """