diff options
Diffstat (limited to 'scripts/lib/bsp')
155 files changed, 7291 insertions, 0 deletions
diff --git a/scripts/lib/bsp/__init__.py b/scripts/lib/bsp/__init__.py new file mode 100644 index 0000000000..8bbb6e1530 --- /dev/null +++ b/scripts/lib/bsp/__init__.py | |||
@@ -0,0 +1,22 @@ | |||
1 | # | ||
2 | # Yocto BSP tools library | ||
3 | # | ||
4 | # Copyright (c) 2012, Intel Corporation. | ||
5 | # All rights reserved. | ||
6 | # | ||
7 | # This program is free software; you can redistribute it and/or modify | ||
8 | # it under the terms of the GNU General Public License version 2 as | ||
9 | # published by the Free Software Foundation. | ||
10 | # | ||
11 | # This program is distributed in the hope that it will be useful, | ||
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | # GNU General Public License for more details. | ||
15 | # | ||
16 | # You should have received a copy of the GNU General Public License along | ||
17 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | # | ||
20 | # AUTHORS | ||
21 | # Tom Zanussi <tom.zanussi (at] intel.com> | ||
22 | # | ||
diff --git a/scripts/lib/bsp/engine.py b/scripts/lib/bsp/engine.py new file mode 100644 index 0000000000..7d6be239da --- /dev/null +++ b/scripts/lib/bsp/engine.py | |||
@@ -0,0 +1,1947 @@ | |||
1 | # ex:ts=4:sw=4:sts=4:et | ||
2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | ||
3 | # | ||
4 | # Copyright (c) 2012, Intel Corporation. | ||
5 | # All rights reserved. | ||
6 | # | ||
7 | # This program is free software; you can redistribute it and/or modify | ||
8 | # it under the terms of the GNU General Public License version 2 as | ||
9 | # published by the Free Software Foundation. | ||
10 | # | ||
11 | # This program is distributed in the hope that it will be useful, | ||
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | # GNU General Public License for more details. | ||
15 | # | ||
16 | # You should have received a copy of the GNU General Public License along | ||
17 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | # | ||
20 | # DESCRIPTION | ||
21 | # This module implements the templating engine used by 'yocto-bsp' to | ||
22 | # create BSPs. The BSP templates are simply the set of files expected | ||
23 | # to appear in a generated BSP, marked up with a small set of tags | ||
24 | # used to customize the output. The engine parses through the | ||
25 | # templates and generates a Python program containing all the logic | ||
26 | # and input elements needed to display and retrieve BSP-specific | ||
27 | # information from the user. The resulting program uses those results | ||
28 | # to generate the final BSP files. | ||
29 | # | ||
30 | # AUTHORS | ||
31 | # Tom Zanussi <tom.zanussi (at] intel.com> | ||
32 | # | ||
33 | |||
34 | import os | ||
35 | import sys | ||
36 | from abc import ABCMeta, abstractmethod | ||
37 | from tags import * | ||
38 | import shlex | ||
39 | import json | ||
40 | import subprocess | ||
41 | import shutil | ||
42 | |||
43 | class Line(): | ||
44 | """ | ||
45 | Generic (abstract) container representing a line that will appear | ||
46 | in the BSP-generating program. | ||
47 | """ | ||
48 | __metaclass__ = ABCMeta | ||
49 | |||
50 | def __init__(self, line): | ||
51 | self.line = line | ||
52 | self.generated_line = "" | ||
53 | self.prio = sys.maxint | ||
54 | self.discard = False | ||
55 | |||
56 | @abstractmethod | ||
57 | def gen(self, context = None): | ||
58 | """ | ||
59 | Generate the final executable line that will appear in the | ||
60 | BSP-generation program. | ||
61 | """ | ||
62 | pass | ||
63 | |||
64 | def escape(self, line): | ||
65 | """ | ||
66 | Escape single and double quotes and backslashes until I find | ||
67 | something better (re.escape() escapes way too much). | ||
68 | """ | ||
69 | return line.replace("\\", "\\\\").replace("\"", "\\\"").replace("'", "\\'") | ||
70 | |||
71 | def parse_error(self, msg, lineno, line): | ||
72 | raise SyntaxError("%s: %s" % (msg, line)) | ||
73 | |||
74 | |||
75 | class NormalLine(Line): | ||
76 | """ | ||
77 | Container for normal (non-tag) lines. | ||
78 | """ | ||
79 | def __init__(self, line): | ||
80 | Line.__init__(self, line) | ||
81 | self.is_filename = False | ||
82 | self.is_dirname = False | ||
83 | self.out_filebase = None | ||
84 | |||
85 | def gen(self, context = None): | ||
86 | if self.is_filename: | ||
87 | line = "current_file = \"" + os.path.join(self.out_filebase, self.escape(self.line)) + "\"; of = open(current_file, \"w\")" | ||
88 | elif self.is_dirname: | ||
89 | dirname = os.path.join(self.out_filebase, self.escape(self.line)) | ||
90 | line = "if not os.path.exists(\"" + dirname + "\"): os.mkdir(\"" + dirname + "\")" | ||
91 | else: | ||
92 | line = "of.write(\"" + self.escape(self.line) + "\\n\")" | ||
93 | return line | ||
94 | |||
95 | |||
96 | class CodeLine(Line): | ||
97 | """ | ||
98 | Container for Python code tag lines. | ||
99 | """ | ||
100 | def __init__(self, line): | ||
101 | Line.__init__(self, line) | ||
102 | |||
103 | def gen(self, context = None): | ||
104 | return self.line | ||
105 | |||
106 | |||
107 | class Assignment: | ||
108 | """ | ||
109 | Representation of everything we know about {{=name }} tags. | ||
110 | Instances of these are used by Assignment lines. | ||
111 | """ | ||
112 | def __init__(self, start, end, name): | ||
113 | self.start = start | ||
114 | self.end = end | ||
115 | self.name = name | ||
116 | |||
117 | |||
118 | class AssignmentLine(NormalLine): | ||
119 | """ | ||
120 | Container for normal lines containing assignment tags. Assignment | ||
121 | tags must be in ascending order of 'start' value. | ||
122 | """ | ||
123 | def __init__(self, line): | ||
124 | NormalLine.__init__(self, line) | ||
125 | self.assignments = [] | ||
126 | |||
127 | def add_assignment(self, start, end, name): | ||
128 | self.assignments.append(Assignment(start, end, name)) | ||
129 | |||
130 | def gen(self, context = None): | ||
131 | line = self.escape(self.line) | ||
132 | |||
133 | for assignment in self.assignments: | ||
134 | replacement = "\" + " + assignment.name + " + \"" | ||
135 | idx = line.find(ASSIGN_TAG) | ||
136 | line = line[:idx] + replacement + line[idx + assignment.end - assignment.start:] | ||
137 | if self.is_filename: | ||
138 | return "current_file = \"" + os.path.join(self.out_filebase, line) + "\"; of = open(current_file, \"w\")" | ||
139 | elif self.is_dirname: | ||
140 | dirname = os.path.join(self.out_filebase, line) | ||
141 | return "if not os.path.exists(\"" + dirname + "\"): os.mkdir(\"" + dirname + "\")" | ||
142 | else: | ||
143 | return "of.write(\"" + line + "\\n\")" | ||
144 | |||
145 | |||
146 | class InputLine(Line): | ||
147 | """ | ||
148 | Base class for Input lines. | ||
149 | """ | ||
150 | def __init__(self, props, tag, lineno): | ||
151 | Line.__init__(self, tag) | ||
152 | self.props = props | ||
153 | self.lineno = lineno | ||
154 | |||
155 | try: | ||
156 | self.prio = int(props["prio"]) | ||
157 | except KeyError: | ||
158 | self.prio = sys.maxint | ||
159 | |||
160 | def gen(self, context = None): | ||
161 | try: | ||
162 | depends_on = self.props["depends-on"] | ||
163 | try: | ||
164 | depends_on_val = self.props["depends-on-val"] | ||
165 | except KeyError: | ||
166 | self.parse_error("No 'depends-on-val' for 'depends-on' property", | ||
167 | self.lineno, self.line) | ||
168 | except KeyError: | ||
169 | pass | ||
170 | |||
171 | |||
172 | class EditBoxInputLine(InputLine): | ||
173 | """ | ||
174 | Base class for 'editbox' Input lines. | ||
175 | |||
176 | props: | ||
177 | name: example - "Load address" | ||
178 | msg: example - "Please enter the load address" | ||
179 | result: | ||
180 | Sets the value of the variable specified by 'name' to | ||
181 | whatever the user typed. | ||
182 | """ | ||
183 | def __init__(self, props, tag, lineno): | ||
184 | InputLine.__init__(self, props, tag, lineno) | ||
185 | |||
186 | def gen(self, context = None): | ||
187 | InputLine.gen(self, context) | ||
188 | name = self.props["name"] | ||
189 | if not name: | ||
190 | self.parse_error("No input 'name' property found", | ||
191 | self.lineno, self.line) | ||
192 | msg = self.props["msg"] | ||
193 | if not msg: | ||
194 | self.parse_error("No input 'msg' property found", | ||
195 | self.lineno, self.line) | ||
196 | |||
197 | try: | ||
198 | default_choice = self.props["default"] | ||
199 | except KeyError: | ||
200 | default_choice = "" | ||
201 | |||
202 | msg += " [default: " + default_choice + "]" | ||
203 | |||
204 | line = name + " = default(raw_input(\"" + msg + " \"), " + name + ")" | ||
205 | |||
206 | return line | ||
207 | |||
208 | |||
209 | class GitRepoEditBoxInputLine(EditBoxInputLine): | ||
210 | """ | ||
211 | Base class for 'editbox' Input lines for user input of remote git | ||
212 | repos. This class verifies the existence and connectivity of the | ||
213 | specified git repo. | ||
214 | |||
215 | props: | ||
216 | name: example - "Load address" | ||
217 | msg: example - "Please enter the load address" | ||
218 | result: | ||
219 | Sets the value of the variable specified by 'name' to | ||
220 | whatever the user typed. | ||
221 | """ | ||
222 | def __init__(self, props, tag, lineno): | ||
223 | EditBoxInputLine.__init__(self, props, tag, lineno) | ||
224 | |||
225 | def gen(self, context = None): | ||
226 | EditBoxInputLine.gen(self, context) | ||
227 | name = self.props["name"] | ||
228 | if not name: | ||
229 | self.parse_error("No input 'name' property found", | ||
230 | self.lineno, self.line) | ||
231 | msg = self.props["msg"] | ||
232 | if not msg: | ||
233 | self.parse_error("No input 'msg' property found", | ||
234 | self.lineno, self.line) | ||
235 | |||
236 | try: | ||
237 | default_choice = self.props["default"] | ||
238 | except KeyError: | ||
239 | default_choice = "" | ||
240 | |||
241 | msg += " [default: " + default_choice + "]" | ||
242 | |||
243 | line = name + " = get_verified_git_repo(\"" + msg + "\"," + name + ")" | ||
244 | |||
245 | return line | ||
246 | |||
247 | |||
248 | class FileEditBoxInputLine(EditBoxInputLine): | ||
249 | """ | ||
250 | Base class for 'editbox' Input lines for user input of existing | ||
251 | files. This class verifies the existence of the specified file. | ||
252 | |||
253 | props: | ||
254 | name: example - "Load address" | ||
255 | msg: example - "Please enter the load address" | ||
256 | result: | ||
257 | Sets the value of the variable specified by 'name' to | ||
258 | whatever the user typed. | ||
259 | """ | ||
260 | def __init__(self, props, tag, lineno): | ||
261 | EditBoxInputLine.__init__(self, props, tag, lineno) | ||
262 | |||
263 | def gen(self, context = None): | ||
264 | EditBoxInputLine.gen(self, context) | ||
265 | name = self.props["name"] | ||
266 | if not name: | ||
267 | self.parse_error("No input 'name' property found", | ||
268 | self.lineno, self.line) | ||
269 | msg = self.props["msg"] | ||
270 | if not msg: | ||
271 | self.parse_error("No input 'msg' property found", | ||
272 | self.lineno, self.line) | ||
273 | |||
274 | try: | ||
275 | default_choice = self.props["default"] | ||
276 | except KeyError: | ||
277 | default_choice = "" | ||
278 | |||
279 | msg += " [default: " + default_choice + "]" | ||
280 | |||
281 | line = name + " = get_verified_file(\"" + msg + "\"," + name + ", True)" | ||
282 | |||
283 | return line | ||
284 | |||
285 | |||
286 | class BooleanInputLine(InputLine): | ||
287 | """ | ||
288 | Base class for boolean Input lines. | ||
289 | props: | ||
290 | name: example - "keyboard" | ||
291 | msg: example - "Got keyboard?" | ||
292 | result: | ||
293 | Sets the value of the variable specified by 'name' to "yes" or "no" | ||
294 | example - keyboard = "yes" | ||
295 | """ | ||
296 | def __init__(self, props, tag, lineno): | ||
297 | InputLine.__init__(self, props, tag, lineno) | ||
298 | |||
299 | def gen(self, context = None): | ||
300 | InputLine.gen(self, context) | ||
301 | name = self.props["name"] | ||
302 | if not name: | ||
303 | self.parse_error("No input 'name' property found", | ||
304 | self.lineno, self.line) | ||
305 | msg = self.props["msg"] | ||
306 | if not msg: | ||
307 | self.parse_error("No input 'msg' property found", | ||
308 | self.lineno, self.line) | ||
309 | |||
310 | try: | ||
311 | default_choice = self.props["default"] | ||
312 | except KeyError: | ||
313 | default_choice = "" | ||
314 | |||
315 | msg += " [default: " + default_choice + "]" | ||
316 | |||
317 | line = name + " = boolean(raw_input(\"" + msg + " \"), " + name + ")" | ||
318 | |||
319 | return line | ||
320 | |||
321 | |||
322 | class ListInputLine(InputLine): | ||
323 | """ | ||
324 | Base class for List-based Input lines. e.g. Choicelist, Checklist. | ||
325 | """ | ||
326 | __metaclass__ = ABCMeta | ||
327 | |||
328 | def __init__(self, props, tag, lineno): | ||
329 | InputLine.__init__(self, props, tag, lineno) | ||
330 | self.choices = [] | ||
331 | |||
332 | def gen_choicepair_list(self): | ||
333 | """Generate a list of 2-item val:desc lists from self.choices.""" | ||
334 | if not self.choices: | ||
335 | return None | ||
336 | |||
337 | choicepair_list = list() | ||
338 | |||
339 | for choice in self.choices: | ||
340 | choicepair = [] | ||
341 | choicepair.append(choice.val) | ||
342 | choicepair.append(choice.desc) | ||
343 | choicepair_list.append(choicepair) | ||
344 | |||
345 | return choicepair_list | ||
346 | |||
347 | def gen_degenerate_choicepair_list(self, choices): | ||
348 | """Generate a list of 2-item val:desc with val=desc from passed-in choices.""" | ||
349 | choicepair_list = list() | ||
350 | |||
351 | for choice in choices: | ||
352 | choicepair = [] | ||
353 | choicepair.append(choice) | ||
354 | choicepair.append(choice) | ||
355 | choicepair_list.append(choicepair) | ||
356 | |||
357 | return choicepair_list | ||
358 | |||
359 | def exec_listgen_fn(self, context = None): | ||
360 | """ | ||
361 | Execute the list-generating function contained as a string in | ||
362 | the "gen" property. | ||
363 | """ | ||
364 | retval = None | ||
365 | try: | ||
366 | fname = self.props["gen"] | ||
367 | modsplit = fname.split('.') | ||
368 | mod_fn = modsplit.pop() | ||
369 | mod = '.'.join(modsplit) | ||
370 | |||
371 | __import__(mod) | ||
372 | # python 2.7 has a better way to do this using importlib.import_module | ||
373 | m = sys.modules[mod] | ||
374 | |||
375 | fn = getattr(m, mod_fn) | ||
376 | if not fn: | ||
377 | self.parse_error("couldn't load function specified for 'gen' property ", | ||
378 | self.lineno, self.line) | ||
379 | retval = fn(context) | ||
380 | if not retval: | ||
381 | self.parse_error("function specified for 'gen' property returned nothing ", | ||
382 | self.lineno, self.line) | ||
383 | except KeyError: | ||
384 | pass | ||
385 | |||
386 | return retval | ||
387 | |||
388 | def gen_choices_str(self, choicepairs): | ||
389 | """ | ||
390 | Generate a numbered list of choices from a list of choicepairs | ||
391 | for display to the user. | ||
392 | """ | ||
393 | choices_str = "" | ||
394 | |||
395 | for i, choicepair in enumerate(choicepairs): | ||
396 | choices_str += "\t" + str(i + 1) + ") " + choicepair[1] + "\n" | ||
397 | |||
398 | return choices_str | ||
399 | |||
400 | def gen_choices_val_str(self, choicepairs): | ||
401 | """ | ||
402 | Generate an array of choice values corresponding to the | ||
403 | numbered list generated by gen_choices_str(). | ||
404 | """ | ||
405 | choices_val_list = "[" | ||
406 | |||
407 | for i, choicepair in enumerate(choicepairs): | ||
408 | choices_val_list += "\"" + choicepair[0] + "\"," | ||
409 | choices_val_list += "]" | ||
410 | |||
411 | return choices_val_list | ||
412 | |||
413 | def gen_choices_val_list(self, choicepairs): | ||
414 | """ | ||
415 | Generate an array of choice values corresponding to the | ||
416 | numbered list generated by gen_choices_str(). | ||
417 | """ | ||
418 | choices_val_list = [] | ||
419 | |||
420 | for i, choicepair in enumerate(choicepairs): | ||
421 | choices_val_list.append(choicepair[0]) | ||
422 | |||
423 | return choices_val_list | ||
424 | |||
425 | def gen_choices_list(self, context = None, checklist = False): | ||
426 | """ | ||
427 | Generate an array of choice values corresponding to the | ||
428 | numbered list generated by gen_choices_str(). | ||
429 | """ | ||
430 | choices = self.exec_listgen_fn(context) | ||
431 | if choices: | ||
432 | if len(choices) == 0: | ||
433 | self.parse_error("No entries available for input list", | ||
434 | self.lineno, self.line) | ||
435 | choicepairs = self.gen_degenerate_choicepair_list(choices) | ||
436 | else: | ||
437 | if len(self.choices) == 0: | ||
438 | self.parse_error("No entries available for input list", | ||
439 | self.lineno, self.line) | ||
440 | choicepairs = self.gen_choicepair_list() | ||
441 | |||
442 | return choicepairs | ||
443 | |||
444 | def gen_choices(self, context = None, checklist = False): | ||
445 | """ | ||
446 | Generate an array of choice values corresponding to the | ||
447 | numbered list generated by gen_choices_str(), display it to | ||
448 | the user, and process the result. | ||
449 | """ | ||
450 | msg = self.props["msg"] | ||
451 | if not msg: | ||
452 | self.parse_error("No input 'msg' property found", | ||
453 | self.lineno, self.line) | ||
454 | |||
455 | try: | ||
456 | default_choice = self.props["default"] | ||
457 | except KeyError: | ||
458 | default_choice = "" | ||
459 | |||
460 | msg += " [default: " + default_choice + "]" | ||
461 | |||
462 | choicepairs = self.gen_choices_list(context, checklist) | ||
463 | |||
464 | choices_str = self.gen_choices_str(choicepairs) | ||
465 | choices_val_list = self.gen_choices_val_list(choicepairs) | ||
466 | if checklist: | ||
467 | choiceval = default(find_choicevals(raw_input(msg + "\n" + choices_str), choices_val_list), default_choice) | ||
468 | else: | ||
469 | choiceval = default(find_choiceval(raw_input(msg + "\n" + choices_str), choices_val_list), default_choice) | ||
470 | |||
471 | return choiceval | ||
472 | |||
473 | |||
474 | def find_choiceval(choice_str, choice_list): | ||
475 | """ | ||
476 | Take number as string and return val string from choice_list, | ||
477 | empty string if oob. choice_list is a simple python list. | ||
478 | """ | ||
479 | choice_val = "" | ||
480 | |||
481 | try: | ||
482 | choice_idx = int(choice_str) | ||
483 | if choice_idx <= len(choice_list): | ||
484 | choice_idx -= 1 | ||
485 | choice_val = choice_list[choice_idx] | ||
486 | except ValueError: | ||
487 | pass | ||
488 | |||
489 | return choice_val | ||
490 | |||
491 | |||
492 | def find_choicevals(choice_str, choice_list): | ||
493 | """ | ||
494 | Take numbers as space-separated string and return vals list from | ||
495 | choice_list, empty list if oob. choice_list is a simple python | ||
496 | list. | ||
497 | """ | ||
498 | choice_vals = [] | ||
499 | |||
500 | choices = choice_str.split() | ||
501 | for choice in choices: | ||
502 | choice_vals.append(find_choiceval(choice, choice_list)) | ||
503 | |||
504 | return choice_vals | ||
505 | |||
506 | |||
507 | def default(input_str, name): | ||
508 | """ | ||
509 | Return default if no input_str, otherwise stripped input_str. | ||
510 | """ | ||
511 | if not input_str: | ||
512 | return name | ||
513 | |||
514 | return input_str.strip() | ||
515 | |||
516 | |||
517 | def verify_git_repo(giturl): | ||
518 | """ | ||
519 | Verify that the giturl passed in can be connected to. This can be | ||
520 | used as a check for the existence of the given repo and/or basic | ||
521 | git remote connectivity. | ||
522 | |||
523 | Returns True if the connection was successful, fals otherwise | ||
524 | """ | ||
525 | if not giturl: | ||
526 | return False | ||
527 | |||
528 | gitcmd = "git ls-remote %s > /dev/null 2>&1" % (giturl) | ||
529 | rc = subprocess.call(gitcmd, shell=True) | ||
530 | if rc == 0: | ||
531 | return True | ||
532 | |||
533 | return False | ||
534 | |||
535 | |||
536 | def get_verified_git_repo(input_str, name): | ||
537 | """ | ||
538 | Return git repo if verified, otherwise loop forever asking user | ||
539 | for filename. | ||
540 | """ | ||
541 | msg = input_str.strip() + " " | ||
542 | |||
543 | giturl = default(raw_input(msg), name) | ||
544 | |||
545 | while True: | ||
546 | if verify_git_repo(giturl): | ||
547 | return giturl | ||
548 | giturl = default(raw_input(msg), name) | ||
549 | |||
550 | |||
551 | def get_verified_file(input_str, name, filename_can_be_null): | ||
552 | """ | ||
553 | Return filename if the file exists, otherwise loop forever asking | ||
554 | user for filename. | ||
555 | """ | ||
556 | msg = input_str.strip() + " " | ||
557 | |||
558 | filename = default(raw_input(msg), name) | ||
559 | |||
560 | while True: | ||
561 | if not filename and filename_can_be_null: | ||
562 | return filename | ||
563 | if os.path.isfile(filename): | ||
564 | return filename | ||
565 | filename = default(raw_input(msg), name) | ||
566 | |||
567 | |||
568 | def replace_file(replace_this, with_this): | ||
569 | """ | ||
570 | Replace the given file with the contents of filename, retaining | ||
571 | the original filename. | ||
572 | """ | ||
573 | try: | ||
574 | replace_this.close() | ||
575 | shutil.copy(with_this, replace_this.name) | ||
576 | except IOError: | ||
577 | pass | ||
578 | |||
579 | |||
580 | def boolean(input_str, name): | ||
581 | """ | ||
582 | Return lowercase version of first char in string, or value in name. | ||
583 | """ | ||
584 | if not input_str: | ||
585 | return name | ||
586 | |||
587 | str = input_str.lower().strip() | ||
588 | if str and str[0] == "y" or str[0] == "n": | ||
589 | return str[0] | ||
590 | else: | ||
591 | return name | ||
592 | |||
593 | |||
594 | def strip_base(input_str): | ||
595 | """ | ||
596 | strip '/base' off the end of input_str, so we can use 'base' in | ||
597 | the branch names we present to the user. | ||
598 | """ | ||
599 | if input_str and input_str.endswith("/base"): | ||
600 | return input_str[:-len("/base")] | ||
601 | return input_str.strip() | ||
602 | |||
603 | |||
604 | deferred_choices = {} | ||
605 | |||
606 | def gen_choices_defer(input_line, context, checklist = False): | ||
607 | """ | ||
608 | Save the context hashed the name of the input item, which will be | ||
609 | passed to the gen function later. | ||
610 | """ | ||
611 | name = input_line.props["name"] | ||
612 | |||
613 | try: | ||
614 | nameappend = input_line.props["nameappend"] | ||
615 | except KeyError: | ||
616 | nameappend = "" | ||
617 | |||
618 | try: | ||
619 | branches_base = input_line.props["branches_base"] | ||
620 | except KeyError: | ||
621 | branches_base = "" | ||
622 | |||
623 | filename = input_line.props["filename"] | ||
624 | |||
625 | closetag_start = filename.find(CLOSE_TAG) | ||
626 | |||
627 | if closetag_start != -1: | ||
628 | filename = filename[closetag_start + len(CLOSE_TAG):] | ||
629 | |||
630 | filename = filename.strip() | ||
631 | filename = os.path.splitext(filename)[0] | ||
632 | |||
633 | captured_context = capture_context(context) | ||
634 | context["filename"] = filename | ||
635 | captured_context["filename"] = filename | ||
636 | context["nameappend"] = nameappend | ||
637 | captured_context["nameappend"] = nameappend | ||
638 | context["branches_base"] = branches_base | ||
639 | captured_context["branches_base"] = branches_base | ||
640 | |||
641 | deferred_choice = (input_line, captured_context, checklist) | ||
642 | key = name + "_" + filename + "_" + nameappend | ||
643 | deferred_choices[key] = deferred_choice | ||
644 | |||
645 | |||
646 | def invoke_deferred_choices(name): | ||
647 | """ | ||
648 | Invoke the choice generation function using the context hashed by | ||
649 | 'name'. | ||
650 | """ | ||
651 | deferred_choice = deferred_choices[name] | ||
652 | input_line = deferred_choice[0] | ||
653 | context = deferred_choice[1] | ||
654 | checklist = deferred_choice[2] | ||
655 | |||
656 | context["name"] = name | ||
657 | |||
658 | choices = input_line.gen_choices(context, checklist) | ||
659 | |||
660 | return choices | ||
661 | |||
662 | |||
663 | class ChoicelistInputLine(ListInputLine): | ||
664 | """ | ||
665 | Base class for choicelist Input lines. | ||
666 | props: | ||
667 | name: example - "xserver_choice" | ||
668 | msg: example - "Please select an xserver for this machine" | ||
669 | result: | ||
670 | Sets the value of the variable specified by 'name' to whichever Choice was chosen | ||
671 | example - xserver_choice = "xserver_vesa" | ||
672 | """ | ||
673 | def __init__(self, props, tag, lineno): | ||
674 | ListInputLine.__init__(self, props, tag, lineno) | ||
675 | |||
676 | def gen(self, context = None): | ||
677 | InputLine.gen(self, context) | ||
678 | |||
679 | gen_choices_defer(self, context) | ||
680 | name = self.props["name"] | ||
681 | nameappend = context["nameappend"] | ||
682 | filename = context["filename"] | ||
683 | |||
684 | try: | ||
685 | default_choice = self.props["default"] | ||
686 | except KeyError: | ||
687 | default_choice = "" | ||
688 | |||
689 | line = name + " = default(invoke_deferred_choices(\"" + name + "_" + filename + "_" + nameappend + "\"), \"" + default_choice + "\")" | ||
690 | |||
691 | return line | ||
692 | |||
693 | |||
694 | class ListValInputLine(InputLine): | ||
695 | """ | ||
696 | Abstract base class for choice and checkbox Input lines. | ||
697 | """ | ||
698 | def __init__(self, props, tag, lineno): | ||
699 | InputLine.__init__(self, props, tag, lineno) | ||
700 | |||
701 | try: | ||
702 | self.val = self.props["val"] | ||
703 | except KeyError: | ||
704 | self.parse_error("No input 'val' property found", self.lineno, self.line) | ||
705 | |||
706 | try: | ||
707 | self.desc = self.props["msg"] | ||
708 | except KeyError: | ||
709 | self.parse_error("No input 'msg' property found", self.lineno, self.line) | ||
710 | |||
711 | |||
712 | class ChoiceInputLine(ListValInputLine): | ||
713 | """ | ||
714 | Base class for choicelist item Input lines. | ||
715 | """ | ||
716 | def __init__(self, props, tag, lineno): | ||
717 | ListValInputLine.__init__(self, props, tag, lineno) | ||
718 | |||
719 | def gen(self, context = None): | ||
720 | return None | ||
721 | |||
722 | |||
723 | class ChecklistInputLine(ListInputLine): | ||
724 | """ | ||
725 | Base class for checklist Input lines. | ||
726 | """ | ||
727 | def __init__(self, props, tag, lineno): | ||
728 | ListInputLine.__init__(self, props, tag, lineno) | ||
729 | |||
730 | def gen(self, context = None): | ||
731 | InputLine.gen(self, context) | ||
732 | |||
733 | gen_choices_defer(self, context, True) | ||
734 | name = self.props["name"] | ||
735 | nameappend = context["nameappend"] | ||
736 | filename = context["filename"] | ||
737 | |||
738 | try: | ||
739 | default_choice = self.props["default"] | ||
740 | except KeyError: | ||
741 | default_choice = "" | ||
742 | |||
743 | line = name + " = default(invoke_deferred_choices(\"" + name + "_" + filename + "_" + nameappend + "\"), \"" + default_choice + "\")" | ||
744 | |||
745 | return line | ||
746 | |||
747 | |||
748 | class CheckInputLine(ListValInputLine): | ||
749 | """ | ||
750 | Base class for checklist item Input lines. | ||
751 | """ | ||
752 | def __init__(self, props, tag, lineno): | ||
753 | ListValInputLine.__init__(self, props, tag, lineno) | ||
754 | |||
755 | def gen(self, context = None): | ||
756 | return None | ||
757 | |||
758 | |||
759 | dirname_substitutions = {} | ||
760 | |||
761 | class SubstrateBase(object): | ||
762 | """ | ||
763 | Base class for both expanded and unexpanded file and dir container | ||
764 | objects. | ||
765 | """ | ||
766 | def __init__(self, filename, filebase, out_filebase): | ||
767 | self.filename = filename | ||
768 | self.filebase = filebase | ||
769 | self.translated_filename = filename | ||
770 | self.out_filebase = out_filebase | ||
771 | self.raw_lines = [] | ||
772 | self.expanded_lines = [] | ||
773 | self.prev_choicelist = None | ||
774 | |||
775 | def parse_error(self, msg, lineno, line): | ||
776 | raise SyntaxError("%s: [%s: %d]: %s" % (msg, self.filename, lineno, line)) | ||
777 | |||
778 | def expand_input_tag(self, tag, lineno): | ||
779 | """ | ||
780 | Input tags consist of the word 'input' at the beginning, | ||
781 | followed by name:value property pairs which are converted into | ||
782 | a dictionary. | ||
783 | """ | ||
784 | propstr = tag[len(INPUT_TAG):] | ||
785 | |||
786 | props = dict(prop.split(":", 1) for prop in shlex.split(propstr)) | ||
787 | props["filename"] = self.filename | ||
788 | |||
789 | input_type = props[INPUT_TYPE_PROPERTY] | ||
790 | if not props[INPUT_TYPE_PROPERTY]: | ||
791 | self.parse_error("No input 'type' property found", lineno, tag) | ||
792 | |||
793 | if input_type == "boolean": | ||
794 | return BooleanInputLine(props, tag, lineno) | ||
795 | if input_type == "edit": | ||
796 | return EditBoxInputLine(props, tag, lineno) | ||
797 | if input_type == "edit-git-repo": | ||
798 | return GitRepoEditBoxInputLine(props, tag, lineno) | ||
799 | if input_type == "edit-file": | ||
800 | return FileEditBoxInputLine(props, tag, lineno) | ||
801 | elif input_type == "choicelist": | ||
802 | self.prev_choicelist = ChoicelistInputLine(props, tag, lineno) | ||
803 | return self.prev_choicelist | ||
804 | elif input_type == "choice": | ||
805 | if not self.prev_choicelist: | ||
806 | self.parse_error("Found 'choice' input tag but no previous choicelist", | ||
807 | lineno, tag) | ||
808 | choice = ChoiceInputLine(props, tag, lineno) | ||
809 | self.prev_choicelist.choices.append(choice) | ||
810 | return choice | ||
811 | elif input_type == "checklist": | ||
812 | return ChecklistInputLine(props, tag, lineno) | ||
813 | elif input_type == "check": | ||
814 | return CheckInputLine(props, tag, lineno) | ||
815 | |||
816 | def expand_assignment_tag(self, start, line, lineno): | ||
817 | """ | ||
818 | Expand all tags in a line. | ||
819 | """ | ||
820 | expanded_line = AssignmentLine(line.rstrip()) | ||
821 | |||
822 | while start != -1: | ||
823 | end = line.find(CLOSE_TAG, start) | ||
824 | if end == -1: | ||
825 | self.parse_error("No close tag found for assignment tag", lineno, line) | ||
826 | else: | ||
827 | name = line[start + len(ASSIGN_TAG):end].strip() | ||
828 | expanded_line.add_assignment(start, end + len(CLOSE_TAG), name) | ||
829 | start = line.find(ASSIGN_TAG, end) | ||
830 | |||
831 | return expanded_line | ||
832 | |||
833 | def expand_tag(self, line, lineno): | ||
834 | """ | ||
835 | Returns a processed tag line, or None if there was no tag | ||
836 | |||
837 | The rules for tags are very simple: | ||
838 | - No nested tags | ||
839 | - Tags start with {{ and end with }} | ||
840 | - An assign tag, {{=, can appear anywhere and will | ||
841 | be replaced with what the assignment evaluates to | ||
842 | - Any other tag occupies the whole line it is on | ||
843 | - if there's anything else on the tag line, it's an error | ||
844 | - if it starts with 'input', it's an input tag and | ||
845 | will only be used for prompting and setting variables | ||
846 | - anything else is straight Python | ||
847 | - tags are in effect only until the next blank line or tag or 'pass' tag | ||
848 | - we don't have indentation in tags, but we need some way to end a block | ||
849 | forcefully without blank lines or other tags - that's the 'pass' tag | ||
850 | - todo: implement pass tag | ||
851 | - directories and filenames can have tags as well, but only assignment | ||
852 | and 'if' code lines | ||
853 | - directories and filenames are the only case where normal tags can | ||
854 | coexist with normal text on the same 'line' | ||
855 | """ | ||
856 | start = line.find(ASSIGN_TAG) | ||
857 | if start != -1: | ||
858 | return self.expand_assignment_tag(start, line, lineno) | ||
859 | |||
860 | start = line.find(OPEN_TAG) | ||
861 | if start == -1: | ||
862 | return None | ||
863 | |||
864 | end = line.find(CLOSE_TAG, 0) | ||
865 | if end == -1: | ||
866 | self.parse_error("No close tag found for open tag", lineno, line) | ||
867 | |||
868 | tag = line[start + len(OPEN_TAG):end].strip() | ||
869 | |||
870 | if not tag.lstrip().startswith(INPUT_TAG): | ||
871 | return CodeLine(tag) | ||
872 | |||
873 | return self.expand_input_tag(tag, lineno) | ||
874 | |||
875 | def append_translated_filename(self, filename): | ||
876 | """ | ||
877 | Simply append filename to translated_filename | ||
878 | """ | ||
879 | self.translated_filename = os.path.join(self.translated_filename, filename) | ||
880 | |||
881 | def get_substituted_file_or_dir_name(self, first_line, tag): | ||
882 | """ | ||
883 | If file or dir names contain name substitutions, return the name | ||
884 | to substitute. Note that this is just the file or dirname and | ||
885 | doesn't include the path. | ||
886 | """ | ||
887 | filename = first_line.find(tag) | ||
888 | if filename != -1: | ||
889 | filename += len(tag) | ||
890 | substituted_filename = first_line[filename:].strip() | ||
891 | this = substituted_filename.find(" this") | ||
892 | if this != -1: | ||
893 | head, tail = os.path.split(self.filename) | ||
894 | substituted_filename = substituted_filename[:this + 1] + tail | ||
895 | if tag == DIRNAME_TAG: # get rid of .noinstall in dirname | ||
896 | substituted_filename = substituted_filename.split('.')[0] | ||
897 | |||
898 | return substituted_filename | ||
899 | |||
900 | def get_substituted_filename(self, first_line): | ||
901 | """ | ||
902 | If a filename contains a name substitution, return the name to | ||
903 | substitute. Note that this is just the filename and doesn't | ||
904 | include the path. | ||
905 | """ | ||
906 | return self.get_substituted_file_or_dir_name(first_line, FILENAME_TAG) | ||
907 | |||
908 | def get_substituted_dirname(self, first_line): | ||
909 | """ | ||
910 | If a dirname contains a name substitution, return the name to | ||
911 | substitute. Note that this is just the dirname and doesn't | ||
912 | include the path. | ||
913 | """ | ||
914 | return self.get_substituted_file_or_dir_name(first_line, DIRNAME_TAG) | ||
915 | |||
916 | def substitute_filename(self, first_line): | ||
917 | """ | ||
918 | Find the filename in first_line and append it to translated_filename. | ||
919 | """ | ||
920 | substituted_filename = self.get_substituted_filename(first_line) | ||
921 | self.append_translated_filename(substituted_filename); | ||
922 | |||
923 | def substitute_dirname(self, first_line): | ||
924 | """ | ||
925 | Find the dirname in first_line and append it to translated_filename. | ||
926 | """ | ||
927 | substituted_dirname = self.get_substituted_dirname(first_line) | ||
928 | self.append_translated_filename(substituted_dirname); | ||
929 | |||
930 | def is_filename_substitution(self, line): | ||
931 | """ | ||
932 | Do we have a filename subustition? | ||
933 | """ | ||
934 | if line.find(FILENAME_TAG) != -1: | ||
935 | return True | ||
936 | return False | ||
937 | |||
938 | def is_dirname_substitution(self, line): | ||
939 | """ | ||
940 | Do we have a dirname subustition? | ||
941 | """ | ||
942 | if line.find(DIRNAME_TAG) != -1: | ||
943 | return True | ||
944 | return False | ||
945 | |||
946 | def translate_dirname(self, first_line): | ||
947 | """ | ||
948 | Just save the first_line mapped by filename. The later pass | ||
949 | through the directories will look for a dirname.noinstall | ||
950 | match and grab the substitution line. | ||
951 | """ | ||
952 | dirname_substitutions[self.filename] = first_line | ||
953 | |||
954 | def translate_dirnames_in_path(self, path): | ||
955 | """ | ||
956 | Translate dirnames below this file or dir, not including tail. | ||
957 | dirname_substititions is keyed on actual untranslated filenames. | ||
958 | translated_path contains the subsititutions for each element. | ||
959 | """ | ||
960 | remainder = path[len(self.filebase)+1:] | ||
961 | translated_path = untranslated_path = self.filebase | ||
962 | |||
963 | untranslated_dirs = remainder.split(os.sep) | ||
964 | |||
965 | for dir in untranslated_dirs: | ||
966 | key = os.path.join(untranslated_path, dir + '.noinstall') | ||
967 | try: | ||
968 | first_line = dirname_substitutions[key] | ||
969 | except KeyError: | ||
970 | translated_path = os.path.join(translated_path, dir) | ||
971 | untranslated_path = os.path.join(untranslated_path, dir) | ||
972 | continue | ||
973 | substituted_dir = self.get_substituted_dirname(first_line) | ||
974 | translated_path = os.path.join(translated_path, substituted_dir) | ||
975 | untranslated_path = os.path.join(untranslated_path, dir) | ||
976 | |||
977 | return translated_path | ||
978 | |||
979 | def translate_file_or_dir_name(self): | ||
980 | """ | ||
981 | Originally we were allowed to use open/close/assign tags and python | ||
982 | code in the filename, which fit in nicely with the way we | ||
983 | processed the templates and generated code. Now that we can't | ||
984 | do that, we make those tags proper file contents and have this | ||
985 | pass substitute the nice but non-functional names with those | ||
986 | 'strange' ones, and then proceed as usual. | ||
987 | |||
988 | So, if files or matching dir<.noinstall> files contain | ||
989 | filename substitutions, this function translates them into the | ||
990 | corresponding 'strange' names, which future passes will expand | ||
991 | as they always have. The resulting pathname is kept in the | ||
992 | file or directory's translated_filename. Another way to think | ||
993 | about it is that self.filename is the input filename, and | ||
994 | translated_filename is the output filename before expansion. | ||
995 | """ | ||
996 | # remove leaf file or dirname | ||
997 | head, tail = os.path.split(self.filename) | ||
998 | translated_path = self.translate_dirnames_in_path(head) | ||
999 | self.translated_filename = translated_path | ||
1000 | |||
1001 | # This is a dirname - does it have a matching .noinstall with | ||
1002 | # a substitution? If so, apply the dirname subsititution. | ||
1003 | if not os.path.isfile(self.filename): | ||
1004 | key = self.filename + ".noinstall" | ||
1005 | try: | ||
1006 | first_line = dirname_substitutions[key] | ||
1007 | except KeyError: | ||
1008 | self.append_translated_filename(tail) | ||
1009 | return | ||
1010 | self.substitute_dirname(first_line) | ||
1011 | return | ||
1012 | |||
1013 | f = open(self.filename) | ||
1014 | first_line = f.readline() | ||
1015 | f.close() | ||
1016 | |||
1017 | # This is a normal filename not needing translation, just use | ||
1018 | # it as-is. | ||
1019 | if not first_line or not first_line.startswith("#"): | ||
1020 | self.append_translated_filename(tail) | ||
1021 | return | ||
1022 | |||
1023 | # If we have a filename substitution (first line in the file | ||
1024 | # is a FILENAME_TAG line) do the substitution now. If we have | ||
1025 | # a dirname substitution (DIRNAME_TAG in dirname.noinstall | ||
1026 | # meta-file), hash it so we can apply it when we see the | ||
1027 | # matching dirname later. Otherwise we have a regular | ||
1028 | # filename, just use it as-is. | ||
1029 | if self.is_filename_substitution(first_line): | ||
1030 | self.substitute_filename(first_line) | ||
1031 | elif self.is_dirname_substitution(first_line): | ||
1032 | self.translate_dirname(first_line) | ||
1033 | else: | ||
1034 | self.append_translated_filename(tail) | ||
1035 | |||
1036 | def expand_file_or_dir_name(self): | ||
1037 | """ | ||
1038 | Expand file or dir names into codeline. Dirnames and | ||
1039 | filenames can only have assignments or if statements. First | ||
1040 | translate if statements into CodeLine + (dirname or filename | ||
1041 | creation). | ||
1042 | """ | ||
1043 | lineno = 0 | ||
1044 | |||
1045 | line = self.translated_filename[len(self.filebase):] | ||
1046 | if line.startswith("/"): | ||
1047 | line = line[1:] | ||
1048 | opentag_start = -1 | ||
1049 | |||
1050 | start = line.find(OPEN_TAG) | ||
1051 | while start != -1: | ||
1052 | if not line[start:].startswith(ASSIGN_TAG): | ||
1053 | opentag_start = start | ||
1054 | break | ||
1055 | start += len(ASSIGN_TAG) | ||
1056 | start = line.find(OPEN_TAG, start) | ||
1057 | |||
1058 | if opentag_start != -1: | ||
1059 | end = line.find(CLOSE_TAG, opentag_start) | ||
1060 | if end == -1: | ||
1061 | self.parse_error("No close tag found for open tag", lineno, line) | ||
1062 | # we have a {{ tag i.e. code | ||
1063 | tag = line[opentag_start + len(OPEN_TAG):end].strip() | ||
1064 | if not tag.lstrip().startswith(IF_TAG): | ||
1065 | self.parse_error("Only 'if' tags are allowed in file or directory names", | ||
1066 | lineno, line) | ||
1067 | self.expanded_lines.append(CodeLine(tag)) | ||
1068 | |||
1069 | # everything after }} is the actual filename (possibly with assignments) | ||
1070 | # everything before is the pathname | ||
1071 | line = line[:opentag_start] + line[end + len(CLOSE_TAG):].strip() | ||
1072 | |||
1073 | assign_start = line.find(ASSIGN_TAG) | ||
1074 | if assign_start != -1: | ||
1075 | assignment_tag = self.expand_assignment_tag(assign_start, line, lineno) | ||
1076 | if isinstance(self, SubstrateFile): | ||
1077 | assignment_tag.is_filename = True | ||
1078 | assignment_tag.out_filebase = self.out_filebase | ||
1079 | elif isinstance(self, SubstrateDir): | ||
1080 | assignment_tag.is_dirname = True | ||
1081 | assignment_tag.out_filebase = self.out_filebase | ||
1082 | self.expanded_lines.append(assignment_tag) | ||
1083 | return | ||
1084 | |||
1085 | normal_line = NormalLine(line) | ||
1086 | if isinstance(self, SubstrateFile): | ||
1087 | normal_line.is_filename = True | ||
1088 | normal_line.out_filebase = self.out_filebase | ||
1089 | elif isinstance(self, SubstrateDir): | ||
1090 | normal_line.is_dirname = True | ||
1091 | normal_line.out_filebase = self.out_filebase | ||
1092 | self.expanded_lines.append(normal_line) | ||
1093 | |||
1094 | def expand(self): | ||
1095 | """ | ||
1096 | Expand the file or dir name first, eventually this ends up | ||
1097 | creating the file or dir. | ||
1098 | """ | ||
1099 | self.translate_file_or_dir_name() | ||
1100 | self.expand_file_or_dir_name() | ||
1101 | |||
1102 | |||
1103 | class SubstrateFile(SubstrateBase): | ||
1104 | """ | ||
1105 | Container for both expanded and unexpanded substrate files. | ||
1106 | """ | ||
1107 | def __init__(self, filename, filebase, out_filebase): | ||
1108 | SubstrateBase.__init__(self, filename, filebase, out_filebase) | ||
1109 | |||
1110 | def read(self): | ||
1111 | if self.raw_lines: | ||
1112 | return | ||
1113 | f = open(self.filename) | ||
1114 | self.raw_lines = f.readlines() | ||
1115 | |||
1116 | def expand(self): | ||
1117 | """Expand the contents of all template tags in the file.""" | ||
1118 | SubstrateBase.expand(self) | ||
1119 | self.read() | ||
1120 | |||
1121 | for lineno, line in enumerate(self.raw_lines): | ||
1122 | # only first line can be a filename substitition | ||
1123 | if lineno == 0 and line.startswith("#") and FILENAME_TAG in line: | ||
1124 | continue # skip it - we've already expanded it | ||
1125 | expanded_line = self.expand_tag(line, lineno + 1) # humans not 0-based | ||
1126 | if not expanded_line: | ||
1127 | expanded_line = NormalLine(line.rstrip()) | ||
1128 | self.expanded_lines.append(expanded_line) | ||
1129 | |||
1130 | def gen(self, context = None): | ||
1131 | """Generate the code that generates the BSP.""" | ||
1132 | base_indent = 0 | ||
1133 | |||
1134 | indent = new_indent = base_indent | ||
1135 | |||
1136 | for line in self.expanded_lines: | ||
1137 | genline = line.gen(context) | ||
1138 | if not genline: | ||
1139 | continue | ||
1140 | if isinstance(line, InputLine): | ||
1141 | line.generated_line = genline | ||
1142 | continue | ||
1143 | if genline.startswith(OPEN_START): | ||
1144 | if indent == 1: | ||
1145 | base_indent = 1 | ||
1146 | if indent: | ||
1147 | if genline == BLANKLINE_STR or (not genline.startswith(NORMAL_START) | ||
1148 | and not genline.startswith(OPEN_START)): | ||
1149 | indent = new_indent = base_indent | ||
1150 | if genline.endswith(":"): | ||
1151 | new_indent = base_indent + 1 | ||
1152 | line.generated_line = (indent * INDENT_STR) + genline | ||
1153 | indent = new_indent | ||
1154 | |||
1155 | |||
1156 | class SubstrateDir(SubstrateBase): | ||
1157 | """ | ||
1158 | Container for both expanded and unexpanded substrate dirs. | ||
1159 | """ | ||
1160 | def __init__(self, filename, filebase, out_filebase): | ||
1161 | SubstrateBase.__init__(self, filename, filebase, out_filebase) | ||
1162 | |||
1163 | def expand(self): | ||
1164 | SubstrateBase.expand(self) | ||
1165 | |||
1166 | def gen(self, context = None): | ||
1167 | """Generate the code that generates the BSP.""" | ||
1168 | indent = new_indent = 0 | ||
1169 | for line in self.expanded_lines: | ||
1170 | genline = line.gen(context) | ||
1171 | if not genline: | ||
1172 | continue | ||
1173 | if genline.endswith(":"): | ||
1174 | new_indent = 1 | ||
1175 | else: | ||
1176 | new_indent = 0 | ||
1177 | line.generated_line = (indent * INDENT_STR) + genline | ||
1178 | indent = new_indent | ||
1179 | |||
1180 | |||
1181 | def expand_target(target, all_files, out_filebase): | ||
1182 | """ | ||
1183 | Expand the contents of all template tags in the target. This | ||
1184 | means removing tags and categorizing or creating lines so that | ||
1185 | future passes can process and present input lines and generate the | ||
1186 | corresponding lines of the Python program that will be exec'ed to | ||
1187 | actually produce the final BSP. 'all_files' includes directories. | ||
1188 | """ | ||
1189 | for root, dirs, files in os.walk(target): | ||
1190 | for file in files: | ||
1191 | if file.endswith("~") or file.endswith("#"): | ||
1192 | continue | ||
1193 | f = os.path.join(root, file) | ||
1194 | sfile = SubstrateFile(f, target, out_filebase) | ||
1195 | sfile.expand() | ||
1196 | all_files.append(sfile) | ||
1197 | |||
1198 | for dir in dirs: | ||
1199 | d = os.path.join(root, dir) | ||
1200 | sdir = SubstrateDir(d, target, out_filebase) | ||
1201 | sdir.expand() | ||
1202 | all_files.append(sdir) | ||
1203 | |||
1204 | |||
1205 | def gen_program_machine_lines(machine, program_lines): | ||
1206 | """ | ||
1207 | Use the input values we got from the command line. | ||
1208 | """ | ||
1209 | line = "machine = \"" + machine + "\"" | ||
1210 | program_lines.append(line) | ||
1211 | |||
1212 | line = "layer_name = \"" + machine + "\"" | ||
1213 | program_lines.append(line) | ||
1214 | |||
1215 | |||
1216 | def sort_inputlines(input_lines): | ||
1217 | """Sort input lines according to priority (position).""" | ||
1218 | input_lines.sort(key = lambda l: l.prio) | ||
1219 | |||
1220 | |||
1221 | def find_parent_dependency(lines, depends_on): | ||
1222 | for i, line in lines: | ||
1223 | if isinstance(line, CodeLine): | ||
1224 | continue | ||
1225 | if line.props["name"] == depends_on: | ||
1226 | return i | ||
1227 | |||
1228 | return -1 | ||
1229 | |||
1230 | |||
1231 | def process_inputline_dependencies(input_lines, all_inputlines): | ||
1232 | """If any input lines depend on others, put the others first.""" | ||
1233 | for line in input_lines: | ||
1234 | if isinstance(line, InputLineGroup): | ||
1235 | group_inputlines = [] | ||
1236 | process_inputline_dependencies(line.group, group_inputlines) | ||
1237 | line.group = group_inputlines | ||
1238 | all_inputlines.append(line) | ||
1239 | continue | ||
1240 | |||
1241 | if isinstance(line, CodeLine) or isinstance(line, NormalLine): | ||
1242 | all_inputlines.append(line) | ||
1243 | continue | ||
1244 | |||
1245 | try: | ||
1246 | depends_on = line.props["depends-on"] | ||
1247 | depends_codeline = "if " + line.props["depends-on"] + " == \"" + line.props["depends-on-val"] + "\":" | ||
1248 | all_inputlines.append(CodeLine(depends_codeline)) | ||
1249 | all_inputlines.append(line) | ||
1250 | except KeyError: | ||
1251 | all_inputlines.append(line) | ||
1252 | |||
1253 | |||
1254 | def conditional_filename(filename): | ||
1255 | """ | ||
1256 | Check if the filename itself contains a conditional statement. If | ||
1257 | so, return a codeline for it. | ||
1258 | """ | ||
1259 | opentag_start = filename.find(OPEN_TAG) | ||
1260 | |||
1261 | if opentag_start != -1: | ||
1262 | if filename[opentag_start:].startswith(ASSIGN_TAG): | ||
1263 | return None | ||
1264 | end = filename.find(CLOSE_TAG, opentag_start) | ||
1265 | if end == -1: | ||
1266 | print "No close tag found for open tag in filename %s" % filename | ||
1267 | sys.exit(1) | ||
1268 | |||
1269 | # we have a {{ tag i.e. code | ||
1270 | tag = filename[opentag_start + len(OPEN_TAG):end].strip() | ||
1271 | if not tag.lstrip().startswith(IF_TAG): | ||
1272 | print "Only 'if' tags are allowed in file or directory names, filename: %s" % filename | ||
1273 | sys.exit(1) | ||
1274 | |||
1275 | return CodeLine(tag) | ||
1276 | |||
1277 | return None | ||
1278 | |||
1279 | |||
1280 | class InputLineGroup(InputLine): | ||
1281 | """ | ||
1282 | InputLine that does nothing but group other input lines | ||
1283 | corresponding to all the input lines in a SubstrateFile so they | ||
1284 | can be generated as a group. prio is the only property used. | ||
1285 | """ | ||
1286 | def __init__(self, codeline): | ||
1287 | InputLine.__init__(self, {}, "", 0) | ||
1288 | self.group = [] | ||
1289 | self.prio = sys.maxint | ||
1290 | self.group.append(codeline) | ||
1291 | |||
1292 | def append(self, line): | ||
1293 | self.group.append(line) | ||
1294 | if line.prio < self.prio: | ||
1295 | self.prio = line.prio | ||
1296 | |||
1297 | def len(self): | ||
1298 | return len(self.group) | ||
1299 | |||
1300 | |||
1301 | def gather_inputlines(files): | ||
1302 | """ | ||
1303 | Gather all the InputLines - we want to generate them first. | ||
1304 | """ | ||
1305 | all_inputlines = [] | ||
1306 | input_lines = [] | ||
1307 | |||
1308 | for file in files: | ||
1309 | if isinstance(file, SubstrateFile): | ||
1310 | group = None | ||
1311 | basename = os.path.basename(file.translated_filename) | ||
1312 | |||
1313 | codeline = conditional_filename(basename) | ||
1314 | if codeline: | ||
1315 | group = InputLineGroup(codeline) | ||
1316 | |||
1317 | have_condition = False | ||
1318 | condition_to_write = None | ||
1319 | for line in file.expanded_lines: | ||
1320 | if isinstance(line, CodeLine): | ||
1321 | have_condition = True | ||
1322 | condition_to_write = line | ||
1323 | continue | ||
1324 | if isinstance(line, InputLine): | ||
1325 | if group: | ||
1326 | if condition_to_write: | ||
1327 | condition_to_write.prio = line.prio | ||
1328 | condition_to_write.discard = True | ||
1329 | group.append(condition_to_write) | ||
1330 | condition_to_write = None | ||
1331 | group.append(line) | ||
1332 | else: | ||
1333 | if condition_to_write: | ||
1334 | condition_to_write.prio = line.prio | ||
1335 | condition_to_write.discard = True | ||
1336 | input_lines.append(condition_to_write) | ||
1337 | condition_to_write = None | ||
1338 | input_lines.append(line) | ||
1339 | else: | ||
1340 | if condition_to_write: | ||
1341 | condition_to_write = None | ||
1342 | if have_condition: | ||
1343 | if not line.line.strip(): | ||
1344 | line.discard = True | ||
1345 | input_lines.append(line) | ||
1346 | have_condition = False | ||
1347 | |||
1348 | if group and group.len() > 1: | ||
1349 | input_lines.append(group) | ||
1350 | |||
1351 | sort_inputlines(input_lines) | ||
1352 | process_inputline_dependencies(input_lines, all_inputlines) | ||
1353 | |||
1354 | return all_inputlines | ||
1355 | |||
1356 | |||
1357 | def run_program_lines(linelist, codedump): | ||
1358 | """ | ||
1359 | For a single file, print all the python code into a buf and execute it. | ||
1360 | """ | ||
1361 | buf = "\n".join(linelist) | ||
1362 | |||
1363 | if codedump: | ||
1364 | of = open("bspgen.out", "w") | ||
1365 | of.write(buf) | ||
1366 | of.close() | ||
1367 | exec buf | ||
1368 | |||
1369 | |||
1370 | def gen_target(files, context = None): | ||
1371 | """ | ||
1372 | Generate the python code for each file. | ||
1373 | """ | ||
1374 | for file in files: | ||
1375 | file.gen(context) | ||
1376 | |||
1377 | |||
1378 | def gen_program_header_lines(program_lines): | ||
1379 | """ | ||
1380 | Generate any imports we need. | ||
1381 | """ | ||
1382 | program_lines.append("current_file = \"\"") | ||
1383 | |||
1384 | |||
1385 | def gen_supplied_property_vals(properties, program_lines): | ||
1386 | """ | ||
1387 | Generate user-specified entries for input values instead of | ||
1388 | generating input prompts. | ||
1389 | """ | ||
1390 | for name, val in properties.iteritems(): | ||
1391 | program_line = name + " = \"" + val + "\"" | ||
1392 | program_lines.append(program_line) | ||
1393 | |||
1394 | |||
1395 | def gen_initial_property_vals(input_lines, program_lines): | ||
1396 | """ | ||
1397 | Generate null or default entries for input values, so we don't | ||
1398 | have undefined variables. | ||
1399 | """ | ||
1400 | for line in input_lines: | ||
1401 | if isinstance(line, InputLineGroup): | ||
1402 | gen_initial_property_vals(line.group, program_lines) | ||
1403 | continue | ||
1404 | |||
1405 | if isinstance(line, InputLine): | ||
1406 | try: | ||
1407 | name = line.props["name"] | ||
1408 | try: | ||
1409 | default_val = "\"" + line.props["default"] + "\"" | ||
1410 | except: | ||
1411 | default_val = "\"\"" | ||
1412 | program_line = name + " = " + default_val | ||
1413 | program_lines.append(program_line) | ||
1414 | except KeyError: | ||
1415 | pass | ||
1416 | |||
1417 | |||
1418 | def gen_program_input_lines(input_lines, program_lines, context, in_group = False): | ||
1419 | """ | ||
1420 | Generate only the input lines used for prompting the user. For | ||
1421 | that, we only have input lines and CodeLines that affect the next | ||
1422 | input line. | ||
1423 | """ | ||
1424 | indent = new_indent = 0 | ||
1425 | |||
1426 | for line in input_lines: | ||
1427 | if isinstance(line, InputLineGroup): | ||
1428 | gen_program_input_lines(line.group, program_lines, context, True) | ||
1429 | continue | ||
1430 | if not line.line.strip(): | ||
1431 | continue | ||
1432 | |||
1433 | genline = line.gen(context) | ||
1434 | if not genline: | ||
1435 | continue | ||
1436 | if genline.endswith(":"): | ||
1437 | new_indent += 1 | ||
1438 | else: | ||
1439 | if indent > 1 or (not in_group and indent): | ||
1440 | new_indent -= 1 | ||
1441 | |||
1442 | line.generated_line = (indent * INDENT_STR) + genline | ||
1443 | program_lines.append(line.generated_line) | ||
1444 | |||
1445 | indent = new_indent | ||
1446 | |||
1447 | |||
1448 | def gen_program_lines(target_files, program_lines): | ||
1449 | """ | ||
1450 | Generate the program lines that make up the BSP generation | ||
1451 | program. This appends the generated lines of all target_files to | ||
1452 | program_lines, and skips input lines, which are dealt with | ||
1453 | separately, or omitted. | ||
1454 | """ | ||
1455 | for file in target_files: | ||
1456 | if file.filename.endswith("noinstall"): | ||
1457 | continue | ||
1458 | |||
1459 | for line in file.expanded_lines: | ||
1460 | if isinstance(line, InputLine): | ||
1461 | continue | ||
1462 | if line.discard: | ||
1463 | continue | ||
1464 | |||
1465 | program_lines.append(line.generated_line) | ||
1466 | |||
1467 | |||
1468 | def create_context(machine, arch, scripts_path): | ||
1469 | """ | ||
1470 | Create a context object for use in deferred function invocation. | ||
1471 | """ | ||
1472 | context = {} | ||
1473 | |||
1474 | context["machine"] = machine | ||
1475 | context["arch"] = arch | ||
1476 | context["scripts_path"] = scripts_path | ||
1477 | |||
1478 | return context | ||
1479 | |||
1480 | |||
1481 | def capture_context(context): | ||
1482 | """ | ||
1483 | Create a context object for use in deferred function invocation. | ||
1484 | """ | ||
1485 | captured_context = {} | ||
1486 | |||
1487 | captured_context["machine"] = context["machine"] | ||
1488 | captured_context["arch"] = context["arch"] | ||
1489 | captured_context["scripts_path"] = context["scripts_path"] | ||
1490 | |||
1491 | return captured_context | ||
1492 | |||
1493 | |||
1494 | def expand_targets(context, bsp_output_dir, expand_common=True): | ||
1495 | """ | ||
1496 | Expand all the tags in both the common and machine-specific | ||
1497 | 'targets'. | ||
1498 | |||
1499 | If expand_common is False, don't expand the common target (this | ||
1500 | option is used to create special-purpose layers). | ||
1501 | """ | ||
1502 | target_files = [] | ||
1503 | |||
1504 | machine = context["machine"] | ||
1505 | arch = context["arch"] | ||
1506 | scripts_path = context["scripts_path"] | ||
1507 | |||
1508 | lib_path = scripts_path + '/lib' | ||
1509 | bsp_path = lib_path + '/bsp' | ||
1510 | arch_path = bsp_path + '/substrate/target/arch' | ||
1511 | |||
1512 | if expand_common: | ||
1513 | common = os.path.join(arch_path, "common") | ||
1514 | expand_target(common, target_files, bsp_output_dir) | ||
1515 | |||
1516 | arches = os.listdir(arch_path) | ||
1517 | if arch not in arches or arch == "common": | ||
1518 | print "Invalid karch, exiting\n" | ||
1519 | sys.exit(1) | ||
1520 | |||
1521 | target = os.path.join(arch_path, arch) | ||
1522 | expand_target(target, target_files, bsp_output_dir) | ||
1523 | |||
1524 | gen_target(target_files, context) | ||
1525 | |||
1526 | return target_files | ||
1527 | |||
1528 | |||
1529 | def yocto_common_create(machine, target, scripts_path, layer_output_dir, codedump, properties_file, properties_str="", expand_common=True): | ||
1530 | """ | ||
1531 | Common layer-creation code | ||
1532 | |||
1533 | machine - user-defined machine name (if needed, will generate 'machine' var) | ||
1534 | target - the 'target' the layer will be based on, must be one in | ||
1535 | scripts/lib/bsp/substrate/target/arch | ||
1536 | scripts_path - absolute path to yocto /scripts dir | ||
1537 | layer_output_dir - dirname to create for layer | ||
1538 | codedump - dump generated code to bspgen.out | ||
1539 | properties_file - use values from this file if nonempty i.e no prompting | ||
1540 | properties_str - use values from this string if nonempty i.e no prompting | ||
1541 | expand_common - boolean, use the contents of (for bsp layers) arch/common | ||
1542 | """ | ||
1543 | if os.path.exists(layer_output_dir): | ||
1544 | print "\nlayer output dir already exists, exiting. (%s)" % layer_output_dir | ||
1545 | sys.exit(1) | ||
1546 | |||
1547 | properties = None | ||
1548 | |||
1549 | if properties_file: | ||
1550 | try: | ||
1551 | infile = open(properties_file, "r") | ||
1552 | except IOError: | ||
1553 | print "Couldn't open properties file %s for reading, exiting" % properties_file | ||
1554 | sys.exit(1) | ||
1555 | |||
1556 | properties = json.load(infile) | ||
1557 | |||
1558 | if properties_str and not properties: | ||
1559 | properties = json.loads(properties_str) | ||
1560 | |||
1561 | os.mkdir(layer_output_dir) | ||
1562 | |||
1563 | context = create_context(machine, target, scripts_path) | ||
1564 | target_files = expand_targets(context, layer_output_dir, expand_common) | ||
1565 | |||
1566 | input_lines = gather_inputlines(target_files) | ||
1567 | |||
1568 | program_lines = [] | ||
1569 | |||
1570 | gen_program_header_lines(program_lines) | ||
1571 | |||
1572 | gen_initial_property_vals(input_lines, program_lines) | ||
1573 | |||
1574 | if properties: | ||
1575 | gen_supplied_property_vals(properties, program_lines) | ||
1576 | |||
1577 | gen_program_machine_lines(machine, program_lines) | ||
1578 | |||
1579 | if not properties: | ||
1580 | gen_program_input_lines(input_lines, program_lines, context) | ||
1581 | |||
1582 | gen_program_lines(target_files, program_lines) | ||
1583 | |||
1584 | run_program_lines(program_lines, codedump) | ||
1585 | |||
1586 | |||
1587 | def yocto_layer_create(layer_name, scripts_path, layer_output_dir, codedump, properties_file, properties=""): | ||
1588 | """ | ||
1589 | Create yocto layer | ||
1590 | |||
1591 | layer_name - user-defined layer name | ||
1592 | scripts_path - absolute path to yocto /scripts dir | ||
1593 | layer_output_dir - dirname to create for layer | ||
1594 | codedump - dump generated code to bspgen.out | ||
1595 | properties_file - use values from this file if nonempty i.e no prompting | ||
1596 | properties - use values from this string if nonempty i.e no prompting | ||
1597 | """ | ||
1598 | yocto_common_create(layer_name, "layer", scripts_path, layer_output_dir, codedump, properties_file, properties, False) | ||
1599 | |||
1600 | print "\nNew layer created in %s.\n" % (layer_output_dir) | ||
1601 | print "Don't forget to add it to your BBLAYERS (for details see %s\README)." % (layer_output_dir) | ||
1602 | |||
1603 | |||
1604 | def yocto_bsp_create(machine, arch, scripts_path, bsp_output_dir, codedump, properties_file, properties=None): | ||
1605 | """ | ||
1606 | Create bsp | ||
1607 | |||
1608 | machine - user-defined machine name | ||
1609 | arch - the arch the bsp will be based on, must be one in | ||
1610 | scripts/lib/bsp/substrate/target/arch | ||
1611 | scripts_path - absolute path to yocto /scripts dir | ||
1612 | bsp_output_dir - dirname to create for BSP | ||
1613 | codedump - dump generated code to bspgen.out | ||
1614 | properties_file - use values from this file if nonempty i.e no prompting | ||
1615 | properties - use values from this string if nonempty i.e no prompting | ||
1616 | """ | ||
1617 | yocto_common_create(machine, arch, scripts_path, bsp_output_dir, codedump, properties_file, properties) | ||
1618 | |||
1619 | print "\nNew %s BSP created in %s" % (arch, bsp_output_dir) | ||
1620 | |||
1621 | |||
1622 | def print_dict(items, indent = 0): | ||
1623 | """ | ||
1624 | Print the values in a possibly nested dictionary. | ||
1625 | """ | ||
1626 | for key, val in items.iteritems(): | ||
1627 | print " "*indent + "\"%s\" :" % key, | ||
1628 | if type(val) == dict: | ||
1629 | print "{" | ||
1630 | print_dict(val, indent + 1) | ||
1631 | print " "*indent + "}" | ||
1632 | else: | ||
1633 | print "%s" % val | ||
1634 | |||
1635 | |||
1636 | def get_properties(input_lines): | ||
1637 | """ | ||
1638 | Get the complete set of properties for all the input items in the | ||
1639 | BSP, as a possibly nested dictionary. | ||
1640 | """ | ||
1641 | properties = {} | ||
1642 | |||
1643 | for line in input_lines: | ||
1644 | if isinstance(line, InputLineGroup): | ||
1645 | statement = line.group[0].line | ||
1646 | group_properties = get_properties(line.group) | ||
1647 | properties[statement] = group_properties | ||
1648 | continue | ||
1649 | |||
1650 | if not isinstance(line, InputLine): | ||
1651 | continue | ||
1652 | |||
1653 | if isinstance(line, ChoiceInputLine): | ||
1654 | continue | ||
1655 | |||
1656 | props = line.props | ||
1657 | item = {} | ||
1658 | name = props["name"] | ||
1659 | for key, val in props.items(): | ||
1660 | if not key == "name": | ||
1661 | item[key] = val | ||
1662 | properties[name] = item | ||
1663 | |||
1664 | return properties | ||
1665 | |||
1666 | |||
1667 | def yocto_layer_list_properties(arch, scripts_path, properties_file, expand_common=True): | ||
1668 | """ | ||
1669 | List the complete set of properties for all the input items in the | ||
1670 | layer. If properties_file is non-null, write the complete set of | ||
1671 | properties as a nested JSON object corresponding to a possibly | ||
1672 | nested dictionary. | ||
1673 | """ | ||
1674 | context = create_context("unused", arch, scripts_path) | ||
1675 | target_files = expand_targets(context, "unused", expand_common) | ||
1676 | |||
1677 | input_lines = gather_inputlines(target_files) | ||
1678 | |||
1679 | properties = get_properties(input_lines) | ||
1680 | if properties_file: | ||
1681 | try: | ||
1682 | of = open(properties_file, "w") | ||
1683 | except IOError: | ||
1684 | print "Couldn't open properties file %s for writing, exiting" % properties_file | ||
1685 | sys.exit(1) | ||
1686 | |||
1687 | json.dump(properties, of) | ||
1688 | |||
1689 | print_dict(properties) | ||
1690 | |||
1691 | |||
1692 | def split_nested_property(property): | ||
1693 | """ | ||
1694 | A property name of the form x.y describes a nested property | ||
1695 | i.e. the property y is contained within x and can be addressed | ||
1696 | using standard JSON syntax for nested properties. Note that if a | ||
1697 | property name itself contains '.', it should be contained in | ||
1698 | double quotes. | ||
1699 | """ | ||
1700 | splittable_property = "" | ||
1701 | in_quotes = False | ||
1702 | for c in property: | ||
1703 | if c == '.' and not in_quotes: | ||
1704 | splittable_property += '\n' | ||
1705 | continue | ||
1706 | if c == '"': | ||
1707 | in_quotes = not in_quotes | ||
1708 | splittable_property += c | ||
1709 | |||
1710 | split_properties = splittable_property.split('\n') | ||
1711 | |||
1712 | if len(split_properties) > 1: | ||
1713 | return split_properties | ||
1714 | |||
1715 | return None | ||
1716 | |||
1717 | |||
1718 | def find_input_line_group(substring, input_lines): | ||
1719 | """ | ||
1720 | Find and return the InputLineGroup containing the specified substring. | ||
1721 | """ | ||
1722 | for line in input_lines: | ||
1723 | if isinstance(line, InputLineGroup): | ||
1724 | if substring in line.group[0].line: | ||
1725 | return line | ||
1726 | |||
1727 | return None | ||
1728 | |||
1729 | |||
1730 | def find_input_line(name, input_lines): | ||
1731 | """ | ||
1732 | Find the input line with the specified name. | ||
1733 | """ | ||
1734 | for line in input_lines: | ||
1735 | if isinstance(line, InputLineGroup): | ||
1736 | l = find_input_line(name, line.group) | ||
1737 | if l: | ||
1738 | return l | ||
1739 | |||
1740 | if isinstance(line, InputLine): | ||
1741 | try: | ||
1742 | if line.props["name"] == name: | ||
1743 | return line | ||
1744 | if line.props["name"] + "_" + line.props["nameappend"] == name: | ||
1745 | return line | ||
1746 | except KeyError: | ||
1747 | pass | ||
1748 | |||
1749 | return None | ||
1750 | |||
1751 | |||
1752 | def print_values(type, values_list): | ||
1753 | """ | ||
1754 | Print the values in the given list of values. | ||
1755 | """ | ||
1756 | if type == "choicelist": | ||
1757 | for value in values_list: | ||
1758 | print "[\"%s\", \"%s\"]" % (value[0], value[1]) | ||
1759 | elif type == "boolean": | ||
1760 | for value in values_list: | ||
1761 | print "[\"%s\", \"%s\"]" % (value[0], value[1]) | ||
1762 | |||
1763 | |||
1764 | def yocto_layer_list_property_values(arch, property, scripts_path, properties_file, expand_common=True): | ||
1765 | """ | ||
1766 | List the possible values for a given input property. If | ||
1767 | properties_file is non-null, write the complete set of properties | ||
1768 | as a JSON object corresponding to an array of possible values. | ||
1769 | """ | ||
1770 | context = create_context("unused", arch, scripts_path) | ||
1771 | context["name"] = property | ||
1772 | |||
1773 | target_files = expand_targets(context, "unused", expand_common) | ||
1774 | |||
1775 | input_lines = gather_inputlines(target_files) | ||
1776 | |||
1777 | properties = get_properties(input_lines) | ||
1778 | |||
1779 | nested_properties = split_nested_property(property) | ||
1780 | if nested_properties: | ||
1781 | # currently the outer property of a nested property always | ||
1782 | # corresponds to an input line group | ||
1783 | input_line_group = find_input_line_group(nested_properties[0], input_lines) | ||
1784 | if input_line_group: | ||
1785 | input_lines[:] = input_line_group.group[1:] | ||
1786 | # The inner property of a nested property name is the | ||
1787 | # actual property name we want, so reset to that | ||
1788 | property = nested_properties[1] | ||
1789 | |||
1790 | input_line = find_input_line(property, input_lines) | ||
1791 | if not input_line: | ||
1792 | print "Couldn't find values for property %s" % property | ||
1793 | return | ||
1794 | |||
1795 | values_list = [] | ||
1796 | |||
1797 | type = input_line.props["type"] | ||
1798 | if type == "boolean": | ||
1799 | values_list.append(["y", "n"]) | ||
1800 | elif type == "choicelist" or type == "checklist": | ||
1801 | try: | ||
1802 | gen_fn = input_line.props["gen"] | ||
1803 | if nested_properties: | ||
1804 | context["filename"] = nested_properties[0] | ||
1805 | try: | ||
1806 | context["branches_base"] = input_line.props["branches_base"] | ||
1807 | except KeyError: | ||
1808 | context["branches_base"] = None | ||
1809 | values_list = input_line.gen_choices_list(context, False) | ||
1810 | except KeyError: | ||
1811 | for choice in input_line.choices: | ||
1812 | choicepair = [] | ||
1813 | choicepair.append(choice.val) | ||
1814 | choicepair.append(choice.desc) | ||
1815 | values_list.append(choicepair) | ||
1816 | |||
1817 | if properties_file: | ||
1818 | try: | ||
1819 | of = open(properties_file, "w") | ||
1820 | except IOError: | ||
1821 | print "Couldn't open properties file %s for writing, exiting" % properties_file | ||
1822 | sys.exit(1) | ||
1823 | |||
1824 | json.dump(values_list, of) | ||
1825 | |||
1826 | print_values(type, values_list) | ||
1827 | |||
1828 | |||
1829 | def yocto_bsp_list(args, scripts_path, properties_file): | ||
1830 | """ | ||
1831 | Print available architectures, or the complete list of properties | ||
1832 | defined by the BSP, or the possible values for a particular BSP | ||
1833 | property. | ||
1834 | """ | ||
1835 | if len(args) < 1: | ||
1836 | return False | ||
1837 | |||
1838 | if args[0] == "karch": | ||
1839 | lib_path = scripts_path + '/lib' | ||
1840 | bsp_path = lib_path + '/bsp' | ||
1841 | arch_path = bsp_path + '/substrate/target/arch' | ||
1842 | print "Architectures available:" | ||
1843 | for arch in os.listdir(arch_path): | ||
1844 | if arch == "common" or arch == "layer": | ||
1845 | continue | ||
1846 | print " %s" % arch | ||
1847 | return True | ||
1848 | else: | ||
1849 | arch = args[0] | ||
1850 | |||
1851 | if len(args) < 2 or len(args) > 3: | ||
1852 | return False | ||
1853 | |||
1854 | if len(args) == 2: | ||
1855 | if args[1] == "properties": | ||
1856 | yocto_layer_list_properties(arch, scripts_path, properties_file) | ||
1857 | else: | ||
1858 | return False | ||
1859 | |||
1860 | if len(args) == 3: | ||
1861 | if args[1] == "property": | ||
1862 | yocto_layer_list_property_values(arch, args[2], scripts_path, properties_file) | ||
1863 | else: | ||
1864 | return False | ||
1865 | |||
1866 | return True | ||
1867 | |||
1868 | |||
1869 | def yocto_layer_list(args, scripts_path, properties_file): | ||
1870 | """ | ||
1871 | Print the complete list of input properties defined by the layer, | ||
1872 | or the possible values for a particular layer property. | ||
1873 | """ | ||
1874 | if len(args) < 1: | ||
1875 | return False | ||
1876 | |||
1877 | if len(args) < 1 or len(args) > 2: | ||
1878 | return False | ||
1879 | |||
1880 | if len(args) == 1: | ||
1881 | if args[0] == "properties": | ||
1882 | yocto_layer_list_properties("layer", scripts_path, properties_file, False) | ||
1883 | else: | ||
1884 | return False | ||
1885 | |||
1886 | if len(args) == 2: | ||
1887 | if args[0] == "property": | ||
1888 | yocto_layer_list_property_values("layer", args[1], scripts_path, properties_file, False) | ||
1889 | else: | ||
1890 | return False | ||
1891 | |||
1892 | return True | ||
1893 | |||
1894 | |||
1895 | def map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch): | ||
1896 | """ | ||
1897 | Return the linux-yocto bsp branch to use with the specified | ||
1898 | kbranch. This handles the -standard variants for 3.4 and 3.8; the | ||
1899 | other variants don't need mappings. | ||
1900 | """ | ||
1901 | if need_new_kbranch == "y": | ||
1902 | kbranch = new_kbranch | ||
1903 | else: | ||
1904 | kbranch = existing_kbranch | ||
1905 | |||
1906 | if kbranch.startswith("standard/common-pc-64"): | ||
1907 | return "bsp/common-pc-64/common-pc-64-standard.scc" | ||
1908 | if kbranch.startswith("standard/common-pc"): | ||
1909 | return "bsp/common-pc/common-pc-standard.scc" | ||
1910 | else: | ||
1911 | return "ktypes/standard/standard.scc" | ||
1912 | |||
1913 | |||
1914 | def map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch): | ||
1915 | """ | ||
1916 | Return the linux-yocto bsp branch to use with the specified | ||
1917 | kbranch. This handles the -preempt-rt variants for 3.4 and 3.8; | ||
1918 | the other variants don't need mappings. | ||
1919 | """ | ||
1920 | if need_new_kbranch == "y": | ||
1921 | kbranch = new_kbranch | ||
1922 | else: | ||
1923 | kbranch = existing_kbranch | ||
1924 | |||
1925 | if kbranch.startswith("standard/preempt-rt/common-pc-64"): | ||
1926 | return "bsp/common-pc-64/common-pc-64-preempt-rt.scc" | ||
1927 | if kbranch.startswith("standard/preempt-rt/common-pc"): | ||
1928 | return "bsp/common-pc/common-pc-preempt-rt.scc" | ||
1929 | else: | ||
1930 | return "ktypes/preempt-rt/preempt-rt.scc" | ||
1931 | |||
1932 | |||
1933 | def map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch): | ||
1934 | """ | ||
1935 | Return the linux-yocto bsp branch to use with the specified | ||
1936 | kbranch. This handles the -tiny variants for 3.4 and 3.8; the | ||
1937 | other variants don't need mappings. | ||
1938 | """ | ||
1939 | if need_new_kbranch == "y": | ||
1940 | kbranch = new_kbranch | ||
1941 | else: | ||
1942 | kbranch = existing_kbranch | ||
1943 | |||
1944 | if kbranch.startswith("standard/tiny/common-pc"): | ||
1945 | return "bsp/common-pc/common-pc-tiny.scc" | ||
1946 | else: | ||
1947 | return "ktypes/tiny/tiny.scc" | ||
diff --git a/scripts/lib/bsp/help.py b/scripts/lib/bsp/help.py new file mode 100644 index 0000000000..7c436d6be0 --- /dev/null +++ b/scripts/lib/bsp/help.py | |||
@@ -0,0 +1,1043 @@ | |||
1 | # ex:ts=4:sw=4:sts=4:et | ||
2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | ||
3 | # | ||
4 | # Copyright (c) 2012, Intel Corporation. | ||
5 | # All rights reserved. | ||
6 | # | ||
7 | # This program is free software; you can redistribute it and/or modify | ||
8 | # it under the terms of the GNU General Public License version 2 as | ||
9 | # published by the Free Software Foundation. | ||
10 | # | ||
11 | # This program is distributed in the hope that it will be useful, | ||
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | # GNU General Public License for more details. | ||
15 | # | ||
16 | # You should have received a copy of the GNU General Public License along | ||
17 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | # | ||
20 | # DESCRIPTION | ||
21 | # This module implements some basic help invocation functions along | ||
22 | # with the bulk of the help topic text for the Yocto BSP Tools. | ||
23 | # | ||
24 | # AUTHORS | ||
25 | # Tom Zanussi <tom.zanussi (at] intel.com> | ||
26 | # | ||
27 | |||
28 | import subprocess | ||
29 | import logging | ||
30 | |||
31 | |||
32 | def subcommand_error(args): | ||
33 | logging.info("invalid subcommand %s" % args[0]) | ||
34 | |||
35 | |||
36 | def display_help(subcommand, subcommands): | ||
37 | """ | ||
38 | Display help for subcommand. | ||
39 | """ | ||
40 | if subcommand not in subcommands: | ||
41 | return False | ||
42 | |||
43 | help = subcommands.get(subcommand, subcommand_error)[2] | ||
44 | pager = subprocess.Popen('less', stdin=subprocess.PIPE) | ||
45 | pager.communicate(help) | ||
46 | |||
47 | return True | ||
48 | |||
49 | |||
50 | def yocto_help(args, usage_str, subcommands): | ||
51 | """ | ||
52 | Subcommand help dispatcher. | ||
53 | """ | ||
54 | if len(args) == 1 or not display_help(args[1], subcommands): | ||
55 | print(usage_str) | ||
56 | |||
57 | |||
58 | def invoke_subcommand(args, parser, main_command_usage, subcommands): | ||
59 | """ | ||
60 | Dispatch to subcommand handler borrowed from combo-layer. | ||
61 | Should use argparse, but has to work in 2.6. | ||
62 | """ | ||
63 | if not args: | ||
64 | logging.error("No subcommand specified, exiting") | ||
65 | parser.print_help() | ||
66 | elif args[0] == "help": | ||
67 | yocto_help(args, main_command_usage, subcommands) | ||
68 | elif args[0] not in subcommands: | ||
69 | logging.error("Unsupported subcommand %s, exiting\n" % (args[0])) | ||
70 | parser.print_help() | ||
71 | else: | ||
72 | usage = subcommands.get(args[0], subcommand_error)[1] | ||
73 | subcommands.get(args[0], subcommand_error)[0](args[1:], usage) | ||
74 | |||
75 | |||
76 | ## | ||
77 | # yocto-bsp help and usage strings | ||
78 | ## | ||
79 | |||
80 | yocto_bsp_usage = """ | ||
81 | |||
82 | Create a customized Yocto BSP layer. | ||
83 | |||
84 | usage: yocto-bsp [--version] [--help] COMMAND [ARGS] | ||
85 | |||
86 | Current 'yocto-bsp' commands are: | ||
87 | create Create a new Yocto BSP | ||
88 | list List available values for options and BSP properties | ||
89 | |||
90 | See 'yocto-bsp help COMMAND' for more information on a specific command. | ||
91 | """ | ||
92 | |||
93 | yocto_bsp_help_usage = """ | ||
94 | |||
95 | usage: yocto-bsp help <subcommand> | ||
96 | |||
97 | This command displays detailed help for the specified subcommand. | ||
98 | """ | ||
99 | |||
100 | yocto_bsp_create_usage = """ | ||
101 | |||
102 | Create a new Yocto BSP | ||
103 | |||
104 | usage: yocto-bsp create <bsp-name> <karch> [-o <DIRNAME> | --outdir <DIRNAME>] | ||
105 | [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>] | ||
106 | |||
107 | This command creates a Yocto BSP based on the specified parameters. | ||
108 | The new BSP will be a new Yocto BSP layer contained by default within | ||
109 | the top-level directory specified as 'meta-bsp-name'. The -o option | ||
110 | can be used to place the BSP layer in a directory with a different | ||
111 | name and location. | ||
112 | |||
113 | The value of the 'karch' parameter determines the set of files that | ||
114 | will be generated for the BSP, along with the specific set of | ||
115 | 'properties' that will be used to fill out the BSP-specific portions | ||
116 | of the BSP. The possible values for the 'karch' paramter can be | ||
117 | listed via 'yocto-bsp list karch'. | ||
118 | |||
119 | NOTE: Once created, you should add your new layer to your | ||
120 | bblayers.conf file in order for it to be subsequently seen and | ||
121 | modified by the yocto-kernel tool. | ||
122 | |||
123 | See 'yocto bsp help create' for more detailed instructions. | ||
124 | """ | ||
125 | |||
126 | yocto_bsp_create_help = """ | ||
127 | |||
128 | NAME | ||
129 | yocto-bsp create - Create a new Yocto BSP | ||
130 | |||
131 | SYNOPSIS | ||
132 | yocto-bsp create <bsp-name> <karch> [-o <DIRNAME> | --outdir <DIRNAME>] | ||
133 | [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>] | ||
134 | |||
135 | DESCRIPTION | ||
136 | This command creates a Yocto BSP based on the specified | ||
137 | parameters. The new BSP will be a new Yocto BSP layer contained | ||
138 | by default within the top-level directory specified as | ||
139 | 'meta-bsp-name'. The -o option can be used to place the BSP layer | ||
140 | in a directory with a different name and location. | ||
141 | |||
142 | The value of the 'karch' parameter determines the set of files | ||
143 | that will be generated for the BSP, along with the specific set of | ||
144 | 'properties' that will be used to fill out the BSP-specific | ||
145 | portions of the BSP. The possible values for the 'karch' paramter | ||
146 | can be listed via 'yocto-bsp list karch'. | ||
147 | |||
148 | The BSP-specific properties that define the values that will be | ||
149 | used to generate a particular BSP can be specified on the | ||
150 | command-line using the -i option and supplying a JSON object | ||
151 | consisting of the set of name:value pairs needed by the BSP. | ||
152 | |||
153 | If the -i option is not used, the user will be interactively | ||
154 | prompted for each of the required property values, which will then | ||
155 | be used as values for BSP generation. | ||
156 | |||
157 | The set of properties available for a given architecture can be | ||
158 | listed using the 'yocto-bsp list' command. | ||
159 | |||
160 | Specifying -c causes the Python code generated and executed to | ||
161 | create the BSP to be dumped to the 'bspgen.out' file in the | ||
162 | current directory, and is useful for debugging. | ||
163 | |||
164 | NOTE: Once created, you should add your new layer to your | ||
165 | bblayers.conf file in order for it to be subsequently seen and | ||
166 | modified by the yocto-kernel tool. | ||
167 | |||
168 | For example, assuming your poky repo is at /path/to/poky, your new | ||
169 | BSP layer is at /path/to/poky/meta-mybsp, and your build directory | ||
170 | is /path/to/build: | ||
171 | |||
172 | $ gedit /path/to/build/conf/bblayers.conf | ||
173 | |||
174 | BBLAYERS ?= " \\ | ||
175 | /path/to/poky/meta \\ | ||
176 | /path/to/poky/meta-yocto \\ | ||
177 | /path/to/poky/meta-mybsp \\ | ||
178 | " | ||
179 | """ | ||
180 | |||
181 | yocto_bsp_list_usage = """ | ||
182 | |||
183 | usage: yocto-bsp list karch | ||
184 | yocto-bsp list <karch> properties | ||
185 | [-o <JSON PROPERTY FILE> | --outfile <JSON PROPERTY_FILE>] | ||
186 | yocto-bsp list <karch> property <xxx> | ||
187 | [-o <JSON PROPERTY FILE> | --outfile <JSON PROPERTY_FILE>] | ||
188 | |||
189 | This command enumerates the complete set of possible values for a | ||
190 | specified option or property needed by the BSP creation process. | ||
191 | |||
192 | The first form enumerates all the possible values that exist and can | ||
193 | be specified for the 'karch' parameter to the 'yocto bsp create' | ||
194 | command. | ||
195 | |||
196 | The second form enumerates all the possible properties that exist and | ||
197 | must have values specified for them in the 'yocto bsp create' command | ||
198 | for the given 'karch'. | ||
199 | |||
200 | The third form enumerates all the possible values that exist and can | ||
201 | be specified for any of the enumerable properties of the given | ||
202 | 'karch' in the 'yocto bsp create' command. | ||
203 | |||
204 | See 'yocto-bsp help list' for more details. | ||
205 | """ | ||
206 | |||
207 | yocto_bsp_list_help = """ | ||
208 | |||
209 | NAME | ||
210 | yocto-bsp list - List available values for options and BSP properties | ||
211 | |||
212 | SYNOPSIS | ||
213 | yocto-bsp list karch | ||
214 | yocto-bsp list <karch> properties | ||
215 | [--o <JSON PROPERTY FILE> | -outfile <JSON PROPERTY_FILE>] | ||
216 | yocto-bsp list <karch> property <xxx> | ||
217 | [--o <JSON PROPERTY FILE> | -outfile <JSON PROPERTY_FILE>] | ||
218 | |||
219 | DESCRIPTION | ||
220 | This command enumerates the complete set of possible values for a | ||
221 | specified option or property needed by the BSP creation process. | ||
222 | |||
223 | The first form enumerates all the possible values that exist and | ||
224 | can be specified for the 'karch' parameter to the 'yocto bsp | ||
225 | create' command. Example output for the 'list karch' command: | ||
226 | |||
227 | $ yocto-bsp list karch | ||
228 | Architectures available: | ||
229 | arm | ||
230 | powerpc | ||
231 | i386 | ||
232 | mips | ||
233 | x86_64 | ||
234 | qemu | ||
235 | |||
236 | The second form enumerates all the possible properties that exist | ||
237 | and must have values specified for them in the 'yocto bsp create' | ||
238 | command for the given 'karch'. This command is mainly meant to | ||
239 | allow the development user interface alternatives to the default | ||
240 | text-based prompting interface. If the -o option is specified, | ||
241 | the list of properties, in addition to being displayed, will be | ||
242 | written to the specified file as a JSON object. In this case, the | ||
243 | object will consist of the set of name:value pairs corresponding | ||
244 | to the (possibly nested) dictionary of properties defined by the | ||
245 | input statements used by the BSP. Some example output for the | ||
246 | 'list properties' command: | ||
247 | |||
248 | $ yocto-bsp list arm properties | ||
249 | "touchscreen" : { | ||
250 | "msg" : Does your BSP have a touchscreen? (y/N) | ||
251 | "default" : n | ||
252 | "type" : boolean | ||
253 | } | ||
254 | "uboot_loadaddress" : { | ||
255 | "msg" : Please specify a value for UBOOT_LOADADDRESS. | ||
256 | "default" : 0x80008000 | ||
257 | "type" : edit | ||
258 | "prio" : 40 | ||
259 | } | ||
260 | "kernel_choice" : { | ||
261 | "prio" : 10 | ||
262 | "default" : linux-yocto_3.2 | ||
263 | "depends-on" : use_default_kernel | ||
264 | "depends-on-val" : n | ||
265 | "msg" : Please choose the kernel to use in this BSP => | ||
266 | "type" : choicelist | ||
267 | "gen" : bsp.kernel.kernels | ||
268 | } | ||
269 | "if kernel_choice == "linux-yocto_3.0":" : { | ||
270 | "base_kbranch_linux_yocto_3_0" : { | ||
271 | "prio" : 20 | ||
272 | "default" : yocto/standard | ||
273 | "depends-on" : new_kbranch_linux_yocto_3_0 | ||
274 | "depends-on-val" : y | ||
275 | "msg" : Please choose a machine branch to base this BSP on => | ||
276 | "type" : choicelist | ||
277 | "gen" : bsp.kernel.all_branches | ||
278 | } | ||
279 | . | ||
280 | . | ||
281 | . | ||
282 | |||
283 | Each entry in the output consists of the name of the input element | ||
284 | e.g. "touchscreen", followed by the properties defined for that | ||
285 | element enclosed in braces. This information should provide | ||
286 | sufficient information to create a complete user interface with. | ||
287 | Two features of the scheme provide for conditional input. First, | ||
288 | if a Python "if" statement appears in place of an input element | ||
289 | name, the set of enclosed input elements apply and should be | ||
290 | presented to the user only if the 'if' statement evaluates to | ||
291 | true. The test in the if statement will always reference another | ||
292 | input element in the list, which means that the element being | ||
293 | tested should be presented to the user before the elements | ||
294 | enclosed by the if block. Secondly, in a similar way, some | ||
295 | elements contain "depends-on" and depends-on-val" tags, which mean | ||
296 | that the affected input element should only be presented to the | ||
297 | user if the element it depends on has already been presented to | ||
298 | the user and the user has selected the specified value for that | ||
299 | element. | ||
300 | |||
301 | The third form enumerates all the possible values that exist and | ||
302 | can be specified for any of the enumerable properties of the given | ||
303 | 'karch' in the 'yocto bsp create' command. If the -o option is | ||
304 | specified, the list of values for the given property, in addition | ||
305 | to being displayed, will be written to the specified file as a | ||
306 | JSON object. In this case, the object will consist of the set of | ||
307 | name:value pairs corresponding to the array of property values | ||
308 | associated with the property. | ||
309 | |||
310 | $ yocto-bsp list i386 property xserver_choice | ||
311 | ["xserver_vesa", "VESA xserver support"] | ||
312 | ["xserver_i915", "i915 xserver support"] | ||
313 | |||
314 | $ yocto-bsp list arm property base_kbranch_linux_yocto_3_0 | ||
315 | Getting branches from remote repo git://git.yoctoproject.org/linux-yocto-3.0... | ||
316 | ["yocto/base", "yocto/base"] | ||
317 | ["yocto/eg20t", "yocto/eg20t"] | ||
318 | ["yocto/gma500", "yocto/gma500"] | ||
319 | ["yocto/pvr", "yocto/pvr"] | ||
320 | ["yocto/standard/arm-versatile-926ejs", "yocto/standard/arm-versatile-926ejs"] | ||
321 | ["yocto/standard/base", "yocto/standard/base"] | ||
322 | ["yocto/standard/cedartrail", "yocto/standard/cedartrail"] | ||
323 | . | ||
324 | . | ||
325 | . | ||
326 | ["yocto/standard/qemu-ppc32", "yocto/standard/qemu-ppc32"] | ||
327 | ["yocto/standard/routerstationpro", "yocto/standard/routerstationpro"] | ||
328 | |||
329 | The third form as well is meant mainly for developers of | ||
330 | alternative interfaces - it allows the developer to fetch the | ||
331 | possible values for a given input element on-demand. This | ||
332 | on-demand capability is especially valuable for elements that | ||
333 | require relatively expensive remote operations to fulfill, such as | ||
334 | the example that returns the set of branches available in a remote | ||
335 | git tree above. | ||
336 | |||
337 | """ | ||
338 | |||
339 | ## | ||
340 | # yocto-kernel help and usage strings | ||
341 | ## | ||
342 | |||
343 | yocto_kernel_usage = """ | ||
344 | |||
345 | Modify and list Yocto BSP kernel config items and patches. | ||
346 | |||
347 | usage: yocto-kernel [--version] [--help] COMMAND [ARGS] | ||
348 | |||
349 | Current 'yocto-kernel' commands are: | ||
350 | config list List the modifiable set of bare kernel config options for a BSP | ||
351 | config add Add or modify bare kernel config options for a BSP | ||
352 | config rm Remove bare kernel config options from a BSP | ||
353 | patch list List the patches associated with a BSP | ||
354 | patch add Patch the Yocto kernel for a BSP | ||
355 | patch rm Remove patches from a BSP | ||
356 | feature list List the features used by a BSP | ||
357 | feature add Have a BSP use a feature | ||
358 | feature rm Have a BSP stop using a feature | ||
359 | features list List the features available to BSPs | ||
360 | feature describe Describe a particular feature | ||
361 | feature create Create a new BSP-local feature | ||
362 | feature destroy Remove a BSP-local feature | ||
363 | |||
364 | See 'yocto-kernel help COMMAND' for more information on a specific command. | ||
365 | |||
366 | """ | ||
367 | |||
368 | |||
369 | yocto_kernel_help_usage = """ | ||
370 | |||
371 | usage: yocto-kernel help <subcommand> | ||
372 | |||
373 | This command displays detailed help for the specified subcommand. | ||
374 | """ | ||
375 | |||
376 | yocto_kernel_config_list_usage = """ | ||
377 | |||
378 | List the modifiable set of bare kernel config options for a BSP | ||
379 | |||
380 | usage: yocto-kernel config list <bsp-name> | ||
381 | |||
382 | This command lists the 'modifiable' config items for a BSP i.e. the | ||
383 | items which are eligible for modification or removal by other | ||
384 | yocto-kernel commands. | ||
385 | |||
386 | 'modifiable' config items are the config items contained a BSP's | ||
387 | user-config.cfg base config. | ||
388 | """ | ||
389 | |||
390 | |||
391 | yocto_kernel_config_list_help = """ | ||
392 | |||
393 | NAME | ||
394 | yocto-kernel config list - List the modifiable set of bare kernel | ||
395 | config options for a BSP | ||
396 | |||
397 | SYNOPSIS | ||
398 | yocto-kernel config list <bsp-name> | ||
399 | |||
400 | DESCRIPTION | ||
401 | This command lists the 'modifiable' config items for a BSP | ||
402 | i.e. the items which are eligible for modification or removal by | ||
403 | other yocto-kernel commands. | ||
404 | """ | ||
405 | |||
406 | |||
407 | yocto_kernel_config_add_usage = """ | ||
408 | |||
409 | Add or modify bare kernel config options for a BSP | ||
410 | |||
411 | usage: yocto-kernel config add <bsp-name> [<CONFIG_XXX=x> ...] | ||
412 | |||
413 | This command adds one or more CONFIG_XXX=x items to a BSP's user-config.cfg | ||
414 | base config. | ||
415 | """ | ||
416 | |||
417 | |||
418 | yocto_kernel_config_add_help = """ | ||
419 | |||
420 | NAME | ||
421 | yocto-kernel config add - Add or modify bare kernel config options | ||
422 | for a BSP | ||
423 | |||
424 | SYNOPSIS | ||
425 | yocto-kernel config add <bsp-name> [<CONFIG_XXX=x> ...] | ||
426 | |||
427 | DESCRIPTION | ||
428 | This command adds one or more CONFIG_XXX=x items to a BSP's | ||
429 | foo.cfg base config. | ||
430 | |||
431 | NOTE: It's up to the user to determine whether or not the config | ||
432 | options being added make sense or not - this command does no | ||
433 | sanity checking or verification of any kind to ensure that a | ||
434 | config option really makes sense and will actually be set in in | ||
435 | the final config. For example, if a config option depends on | ||
436 | other config options, it will be turned off by kconfig if the | ||
437 | other options aren't set correctly. | ||
438 | """ | ||
439 | |||
440 | |||
441 | yocto_kernel_config_rm_usage = """ | ||
442 | |||
443 | Remove bare kernel config options from a BSP | ||
444 | |||
445 | usage: yocto-kernel config rm <bsp-name> | ||
446 | |||
447 | This command removes (turns off) one or more CONFIG_XXX items from a | ||
448 | BSP's user-config.cfg base config. | ||
449 | |||
450 | The set of config items available to be removed by this command for a | ||
451 | BSP is listed and the user prompted for the specific items to remove. | ||
452 | """ | ||
453 | |||
454 | |||
455 | yocto_kernel_config_rm_help = """ | ||
456 | |||
457 | NAME | ||
458 | yocto-kernel config rm - Remove bare kernel config options from a | ||
459 | BSP | ||
460 | |||
461 | SYNOPSIS | ||
462 | yocto-kernel config rm <bsp-name> | ||
463 | |||
464 | DESCRIPTION | ||
465 | This command removes (turns off) one or more CONFIG_XXX items from a | ||
466 | BSP's user-config.cfg base config. | ||
467 | |||
468 | The set of config items available to be removed by this command | ||
469 | for a BSP is listed and the user prompted for the specific items | ||
470 | to remove. | ||
471 | """ | ||
472 | |||
473 | |||
474 | yocto_kernel_patch_list_usage = """ | ||
475 | |||
476 | List the patches associated with the kernel for a BSP | ||
477 | |||
478 | usage: yocto-kernel patch list <bsp-name> | ||
479 | |||
480 | This command lists the patches associated with a BSP. | ||
481 | |||
482 | NOTE: this only applies to patches listed in the kernel recipe's | ||
483 | user-patches.scc file (and currently repeated in its SRC_URI). | ||
484 | """ | ||
485 | |||
486 | |||
487 | yocto_kernel_patch_list_help = """ | ||
488 | |||
489 | NAME | ||
490 | yocto-kernel patch list - List the patches associated with the kernel | ||
491 | for a BSP | ||
492 | |||
493 | SYNOPSIS | ||
494 | yocto-kernel patch list <bsp-name> | ||
495 | |||
496 | DESCRIPTION | ||
497 | This command lists the patches associated with a BSP. | ||
498 | |||
499 | NOTE: this only applies to patches listed in the kernel recipe's | ||
500 | user-patches.scc file (and currently repeated in its SRC_URI). | ||
501 | """ | ||
502 | |||
503 | |||
504 | yocto_kernel_patch_add_usage = """ | ||
505 | |||
506 | Patch the Yocto kernel for a specific BSP | ||
507 | |||
508 | usage: yocto-kernel patch add <bsp-name> [<PATCH> ...] | ||
509 | |||
510 | This command adds one or more patches to a BSP's machine branch. The | ||
511 | patch will be added to the BSP's linux-yocto kernel user-patches.scc | ||
512 | file (and currently repeated in its SRC_URI) and will be guaranteed | ||
513 | to be applied in the order specified. | ||
514 | """ | ||
515 | |||
516 | |||
517 | yocto_kernel_patch_add_help = """ | ||
518 | |||
519 | NAME | ||
520 | yocto-kernel patch add - Patch the Yocto kernel for a specific BSP | ||
521 | |||
522 | SYNOPSIS | ||
523 | yocto-kernel patch add <bsp-name> [<PATCH> ...] | ||
524 | |||
525 | DESCRIPTION | ||
526 | This command adds one or more patches to a BSP's machine branch. | ||
527 | The patch will be added to the BSP's linux-yocto kernel | ||
528 | user-patches.scc file (and currently repeated in its SRC_URI) and | ||
529 | will be guaranteed to be applied in the order specified. | ||
530 | |||
531 | NOTE: It's up to the user to determine whether or not the patches | ||
532 | being added makes sense or not - this command does no sanity | ||
533 | checking or verification of any kind to ensure that a patch can | ||
534 | actually be applied to the BSP's kernel branch; it's assumed that | ||
535 | the user has already done that. | ||
536 | """ | ||
537 | |||
538 | |||
539 | yocto_kernel_patch_rm_usage = """ | ||
540 | |||
541 | Remove a patch from the Yocto kernel for a specific BSP | ||
542 | |||
543 | usage: yocto-kernel patch rm <bsp-name> | ||
544 | |||
545 | This command removes one or more patches from a BSP's machine branch. | ||
546 | The patch will be removed from the BSP's linux-yocto kernel | ||
547 | user-patches.scc file (and currently repeated in its SRC_URI) and | ||
548 | kernel SRC_URI dir. | ||
549 | |||
550 | The set of patches available to be removed by this command for a BSP | ||
551 | is listed and the user prompted for the specific patches to remove. | ||
552 | """ | ||
553 | |||
554 | |||
555 | yocto_kernel_patch_rm_help = """ | ||
556 | |||
557 | NAME | ||
558 | yocto-kernel patch rm - Remove a patch from the Yocto kernel for a specific BSP | ||
559 | |||
560 | SYNOPSIS | ||
561 | yocto-kernel patch rm <bsp-name> | ||
562 | |||
563 | DESCRIPTION | ||
564 | This command removes one or more patches from a BSP's machine | ||
565 | branch. The patch will be removed from the BSP's linux-yocto | ||
566 | kernel user-patches.scc file (and currently repeated in its | ||
567 | SRC_URI). | ||
568 | |||
569 | The set of patches available to be removed by this command for a | ||
570 | BSP is listed and the user prompted for the specific patches to | ||
571 | remove. | ||
572 | """ | ||
573 | |||
574 | yocto_kernel_feature_list_usage = """ | ||
575 | |||
576 | List the BSP features that are being used by a BSP | ||
577 | |||
578 | usage: yocto-kernel feature list <bsp-name> | ||
579 | |||
580 | This command lists the features being used by a BSP i.e. the features | ||
581 | which are eligible for modification or removal by other yocto-kernel | ||
582 | commands. | ||
583 | |||
584 | 'modifiable' features are the features listed in a BSP's | ||
585 | user-features.scc file. | ||
586 | """ | ||
587 | |||
588 | |||
589 | yocto_kernel_feature_list_help = """ | ||
590 | |||
591 | NAME | ||
592 | yocto-kernel feature list - List the modifiable set of features | ||
593 | being used by a BSP | ||
594 | |||
595 | SYNOPSIS | ||
596 | yocto-kernel feature list <bsp-name> | ||
597 | |||
598 | DESCRIPTION | ||
599 | This command lists the 'modifiable' features being used by a BSP | ||
600 | i.e. the features which are eligible for modification or removal | ||
601 | by other yocto-kernel commands. | ||
602 | """ | ||
603 | |||
604 | |||
605 | yocto_kernel_feature_add_usage = """ | ||
606 | |||
607 | Add to or modify the list of features being used for a BSP | ||
608 | |||
609 | usage: yocto-kernel feature add <bsp-name> [/xxxx/yyyy/feature.scc ...] | ||
610 | |||
611 | This command adds one or more feature items to a BSP's kernel | ||
612 | user-features.scc file, which is the file used to manage features in | ||
613 | a yocto-bsp-generated BSP. Features to be added must be specified as | ||
614 | fully-qualified feature names. | ||
615 | """ | ||
616 | |||
617 | |||
618 | yocto_kernel_feature_add_help = """ | ||
619 | |||
620 | NAME | ||
621 | yocto-kernel feature add - Add to or modify the list of features | ||
622 | being used for a BSP | ||
623 | |||
624 | SYNOPSIS | ||
625 | yocto-kernel feature add <bsp-name> [/xxxx/yyyy/feature.scc ...] | ||
626 | |||
627 | DESCRIPTION | ||
628 | This command adds one or more feature items to a BSP's | ||
629 | user-features.scc file, which is the file used to manage features | ||
630 | in a yocto-bsp-generated BSP. Features to be added must be | ||
631 | specified as fully-qualified feature names. | ||
632 | """ | ||
633 | |||
634 | |||
635 | yocto_kernel_feature_rm_usage = """ | ||
636 | |||
637 | Remove a feature from the list of features being used for a BSP | ||
638 | |||
639 | usage: yocto-kernel feature rm <bsp-name> | ||
640 | |||
641 | This command removes (turns off) one or more features from a BSP's | ||
642 | user-features.scc file, which is the file used to manage features in | ||
643 | a yocto-bsp-generated BSP. | ||
644 | |||
645 | The set of features available to be removed by this command for a BSP | ||
646 | is listed and the user prompted for the specific items to remove. | ||
647 | """ | ||
648 | |||
649 | |||
650 | yocto_kernel_feature_rm_help = """ | ||
651 | |||
652 | NAME | ||
653 | yocto-kernel feature rm - Remove a feature from the list of | ||
654 | features being used for a BSP | ||
655 | |||
656 | SYNOPSIS | ||
657 | yocto-kernel feature rm <bsp-name> | ||
658 | |||
659 | DESCRIPTION | ||
660 | This command removes (turns off) one or more features from a BSP's | ||
661 | user-features.scc file, which is the file used to manage features | ||
662 | in a yocto-bsp-generated BSP. | ||
663 | |||
664 | The set of features available to be removed by this command for a | ||
665 | BSP is listed and the user prompted for the specific items to | ||
666 | remove. | ||
667 | """ | ||
668 | |||
669 | |||
670 | yocto_kernel_available_features_list_usage = """ | ||
671 | |||
672 | List the set of kernel features available to a BSP | ||
673 | |||
674 | usage: yocto-kernel features list <bsp-name> | ||
675 | |||
676 | This command lists the complete set of kernel features available to a | ||
677 | BSP. This includes the features contained in linux-yocto meta | ||
678 | branches as well as recipe-space features defined locally to the BSP. | ||
679 | """ | ||
680 | |||
681 | |||
682 | yocto_kernel_available_features_list_help = """ | ||
683 | |||
684 | NAME | ||
685 | yocto-kernel features list - List the set of kernel features | ||
686 | available to a BSP | ||
687 | |||
688 | SYNOPSIS | ||
689 | yocto-kernel features list <bsp-name> | ||
690 | |||
691 | DESCRIPTION | ||
692 | This command lists the complete set of kernel features available | ||
693 | to a BSP. This includes the features contained in linux-yocto | ||
694 | meta branches as well as recipe-space features defined locally to | ||
695 | the BSP. | ||
696 | """ | ||
697 | |||
698 | |||
699 | yocto_kernel_feature_describe_usage = """ | ||
700 | |||
701 | Print the description and compatibility information for a given kernel feature | ||
702 | |||
703 | usage: yocto-kernel feature describe <bsp-name> [/xxxx/yyyy/feature.scc ...] | ||
704 | |||
705 | This command prints the description and compatibility of a specific | ||
706 | feature in the format 'description [compatibility]. | ||
707 | """ | ||
708 | |||
709 | |||
710 | yocto_kernel_feature_describe_help = """ | ||
711 | |||
712 | NAME | ||
713 | yocto-kernel feature describe - print the description and | ||
714 | compatibility information for a given kernel feature | ||
715 | |||
716 | SYNOPSIS | ||
717 | yocto-kernel feature describe <bsp-name> [/xxxx/yyyy/feature.scc ...] | ||
718 | |||
719 | DESCRIPTION | ||
720 | This command prints the description and compatibility of a | ||
721 | specific feature in the format 'description [compatibility]. If | ||
722 | the feature doesn't define a description or compatibility, a | ||
723 | string with generic unknown values will be printed. | ||
724 | """ | ||
725 | |||
726 | |||
727 | yocto_kernel_feature_create_usage = """ | ||
728 | |||
729 | Create a recipe-space kernel feature in a BSP | ||
730 | |||
731 | usage: yocto-kernel feature create <bsp-name> newfeature.scc \ | ||
732 | "Feature Description" capabilities [<CONFIG_XXX=x> ...] [<PATCH> ...] | ||
733 | |||
734 | This command creates a new kernel feature from the bare config | ||
735 | options and patches specified on the command-line. | ||
736 | """ | ||
737 | |||
738 | |||
739 | yocto_kernel_feature_create_help = """ | ||
740 | |||
741 | NAME | ||
742 | yocto-kernel feature create - create a recipe-space kernel feature | ||
743 | in a BSP | ||
744 | |||
745 | SYNOPSIS | ||
746 | yocto-kernel feature create <bsp-name> newfeature.scc \ | ||
747 | "Feature Description" capabilities [<CONFIG_XXX=x> ...] [<PATCH> ...] | ||
748 | |||
749 | DESCRIPTION | ||
750 | This command creates a new kernel feature from the bare config | ||
751 | options and patches specified on the command-line. The new | ||
752 | feature will be created in recipe-space, specifically in either | ||
753 | the kernel .bbappend's /files/cfg or /files/features subdirectory, | ||
754 | depending on whether or not the feature contains config items only | ||
755 | or config items along with patches. The named feature must end | ||
756 | with .scc and must not contain a feature directory to contain the | ||
757 | feature (this will be determined automatically), and a feature | ||
758 | decription in double-quotes along with a capabilities string | ||
759 | (which for the time being can be one of: 'all' or 'board'). | ||
760 | """ | ||
761 | |||
762 | |||
763 | yocto_kernel_feature_destroy_usage = """ | ||
764 | |||
765 | Destroy a recipe-space kernel feature in a BSP | ||
766 | |||
767 | usage: yocto-kernel feature destroy <bsp-name> feature.scc | ||
768 | |||
769 | This command destroys a kernel feature defined in the specified BSP's | ||
770 | recipe-space kernel definition. | ||
771 | """ | ||
772 | |||
773 | |||
774 | yocto_kernel_feature_destroy_help = """ | ||
775 | |||
776 | NAME | ||
777 | yocto-kernel feature destroy <bsp-name> feature.scc - destroy a | ||
778 | recipe-space kernel feature in a BSP | ||
779 | |||
780 | SYNOPSIS | ||
781 | yocto-kernel feature destroy <bsp-name> feature.scc | ||
782 | |||
783 | DESCRIPTION | ||
784 | This command destroys a kernel feature defined in the specified | ||
785 | BSP's recipe-space kernel definition. The named feature must end | ||
786 | with .scc and must not contain a feature directory to contain the | ||
787 | feature (this will be determined automatically). If the kernel | ||
788 | feature is in use by a BSP, it can't be removed until the BSP | ||
789 | stops using it (see yocto-kernel feature rm to stop using it). | ||
790 | """ | ||
791 | |||
792 | ## | ||
793 | # yocto-layer help and usage strings | ||
794 | ## | ||
795 | |||
796 | yocto_layer_usage = """ | ||
797 | |||
798 | Create a generic Yocto layer. | ||
799 | |||
800 | usage: yocto-layer [--version] [--help] COMMAND [ARGS] | ||
801 | |||
802 | Current 'yocto-layer' commands are: | ||
803 | create Create a new generic Yocto layer | ||
804 | list List available values for input options and properties | ||
805 | |||
806 | See 'yocto-layer help COMMAND' for more information on a specific command. | ||
807 | """ | ||
808 | |||
809 | yocto_layer_help_usage = """ | ||
810 | |||
811 | usage: yocto-layer help <subcommand> | ||
812 | |||
813 | This command displays detailed help for the specified subcommand. | ||
814 | """ | ||
815 | |||
816 | yocto_layer_create_usage = """ | ||
817 | |||
818 | Create a new generic Yocto layer | ||
819 | |||
820 | usage: yocto-layer create <layer-name> [layer_priority] | ||
821 | [-o <DIRNAME> | --outdir <DIRNAME>] | ||
822 | [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>] | ||
823 | |||
824 | This command creates a generic Yocto layer based on the specified | ||
825 | parameters. The new layer will be a new Yocto layer contained by | ||
826 | default within the top-level directory specified as | ||
827 | 'meta-layer-name'. The -o option can be used to place the layer in a | ||
828 | directory with a different name and location. | ||
829 | |||
830 | If layer_priority is specified, a simple layer will be created using | ||
831 | the given layer priority, and the user will not be prompted for | ||
832 | further input. | ||
833 | |||
834 | NOTE: Once created, you should add your new layer to your | ||
835 | bblayers.conf file in order for it to be subsequently seen and | ||
836 | modified by the yocto-kernel tool. Instructions for doing this can | ||
837 | be found in the README file generated in the layer's top-level | ||
838 | directory. | ||
839 | |||
840 | See 'yocto layer help create' for more detailed instructions. | ||
841 | """ | ||
842 | |||
843 | yocto_layer_create_help = """ | ||
844 | |||
845 | NAME | ||
846 | yocto-layer create - Create a new generic Yocto layer | ||
847 | |||
848 | SYNOPSIS | ||
849 | yocto-layer create <layer-name> [layer_priority] | ||
850 | [-o <DIRNAME> | --outdir <DIRNAME>] | ||
851 | [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>] | ||
852 | |||
853 | DESCRIPTION | ||
854 | This command creates a generic Yocto layer based on the specified | ||
855 | parameters. The new layer will be a new Yocto layer contained by | ||
856 | default within the top-level directory specified as | ||
857 | 'meta-layer-name'. The -o option can be used to place the layer | ||
858 | in a directory with a different name and location. | ||
859 | |||
860 | If layer_priority is specified, a simple layer will be created | ||
861 | using the given layer priority, and the user will not be prompted | ||
862 | for further input. | ||
863 | |||
864 | The layer-specific properties that define the values that will be | ||
865 | used to generate the layer can be specified on the command-line | ||
866 | using the -i option and supplying a JSON object consisting of the | ||
867 | set of name:value pairs needed by the layer. | ||
868 | |||
869 | If the -i option is not used, the user will be interactively | ||
870 | prompted for each of the required property values, which will then | ||
871 | be used as values for layer generation. | ||
872 | |||
873 | The set of properties available can be listed using the | ||
874 | 'yocto-layer list' command. | ||
875 | |||
876 | Specifying -c causes the Python code generated and executed to | ||
877 | create the layer to be dumped to the 'bspgen.out' file in the | ||
878 | current directory, and is useful for debugging. | ||
879 | |||
880 | NOTE: Once created, you should add your new layer to your | ||
881 | bblayers.conf file in order for it to be subsequently seen and | ||
882 | modified by the yocto-kernel tool. Instructions for doing this | ||
883 | can be found in the README file generated in the layer's top-level | ||
884 | directory. | ||
885 | |||
886 | For example, assuming your poky repo is at /path/to/poky, your new | ||
887 | layer is at /path/to/poky/meta-mylayer, and your build directory | ||
888 | is /path/to/build: | ||
889 | |||
890 | $ gedit /path/to/build/conf/bblayers.conf | ||
891 | |||
892 | BBLAYERS ?= " \\ | ||
893 | /path/to/poky/meta \\ | ||
894 | /path/to/poky/meta-yocto \\ | ||
895 | /path/to/poky/meta-mylayer \\ | ||
896 | " | ||
897 | """ | ||
898 | |||
899 | yocto_layer_list_usage = """ | ||
900 | |||
901 | usage: yocto-layer list properties | ||
902 | [-o <JSON PROPERTY FILE> | --outfile <JSON PROPERTY_FILE>] | ||
903 | yocto-layer list property <xxx> | ||
904 | [-o <JSON PROPERTY FILE> | --outfile <JSON PROPERTY_FILE>] | ||
905 | |||
906 | This command enumerates the complete set of possible values for a | ||
907 | specified option or property needed by the layer creation process. | ||
908 | |||
909 | The first form enumerates all the possible properties that exist and | ||
910 | must have values specified for them in the 'yocto-layer create' | ||
911 | command. | ||
912 | |||
913 | The second form enumerates all the possible values that exist and can | ||
914 | be specified for any of the enumerable properties in the 'yocto-layer | ||
915 | create' command. | ||
916 | |||
917 | See 'yocto-layer help list' for more details. | ||
918 | """ | ||
919 | |||
920 | yocto_layer_list_help = """ | ||
921 | |||
922 | NAME | ||
923 | yocto-layer list - List available values for layer input options and properties | ||
924 | |||
925 | SYNOPSIS | ||
926 | yocto-layer list properties | ||
927 | [--o <JSON PROPERTY FILE> | -outfile <JSON PROPERTY_FILE>] | ||
928 | yocto-layer list property <xxx> | ||
929 | [--o <JSON PROPERTY FILE> | -outfile <JSON PROPERTY_FILE>] | ||
930 | |||
931 | DESCRIPTION | ||
932 | This command enumerates the complete set of possible values for a | ||
933 | specified option or property needed by the layer creation process. | ||
934 | |||
935 | The first form enumerates all the possible properties that exist | ||
936 | and must have values specified for them in the 'yocto-layer | ||
937 | create' command. This command is mainly meant to aid the | ||
938 | development of user interface alternatives to the default | ||
939 | text-based prompting interface. If the -o option is specified, | ||
940 | the list of properties, in addition to being displayed, will be | ||
941 | written to the specified file as a JSON object. In this case, the | ||
942 | object will consist of the set of name:value pairs corresponding | ||
943 | to the (possibly nested) dictionary of properties defined by the | ||
944 | input statements used by the BSP. Some example output for the | ||
945 | 'list properties' command: | ||
946 | |||
947 | $ yocto-layer list properties | ||
948 | "example_bbappend_name" : { | ||
949 | "default" : example | ||
950 | "msg" : Please enter the name you'd like to use for your bbappend file: | ||
951 | "type" : edit | ||
952 | "prio" : 20 | ||
953 | "filename" : /home/trz/yocto/yocto-layer-dev/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall | ||
954 | } | ||
955 | "create_example_recipe" : { | ||
956 | "default" : n | ||
957 | "msg" : Would you like to have an example recipe created? (y/n) | ||
958 | "type" : boolean | ||
959 | "prio" : 20 | ||
960 | "filename" : /home/trz/yocto/yocto-layer-dev/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall | ||
961 | } | ||
962 | "example_recipe_name" : { | ||
963 | "default" : example | ||
964 | "msg" : Please enter the name you'd like to use for your example recipe: | ||
965 | "type" : edit | ||
966 | "prio" : 20 | ||
967 | "filename" : /home/trz/yocto/yocto-layer-dev/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall | ||
968 | } | ||
969 | "layer_priority" : { | ||
970 | "default" : 6 | ||
971 | "msg" : Please enter the layer priority you'd like to use for the layer: | ||
972 | "type" : edit | ||
973 | "prio" : 20 | ||
974 | "filename" : /home/trz/yocto/yocto-layer-dev/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall | ||
975 | } | ||
976 | "create_example_bbappend" : { | ||
977 | "default" : n | ||
978 | "msg" : Would you like to have an example bbappend file created? (y/n) | ||
979 | "type" : boolean | ||
980 | "prio" : 20 | ||
981 | "filename" : /home/trz/yocto/yocto-layer-dev/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall | ||
982 | } | ||
983 | "example_bbappend_version" : { | ||
984 | "default" : 0.1 | ||
985 | "msg" : Please enter the version number you'd like to use for your bbappend file (this should match the recipe you're appending to): | ||
986 | "type" : edit | ||
987 | "prio" : 20 | ||
988 | "filename" : /home/trz/yocto/yocto-layer-dev/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall | ||
989 | } | ||
990 | |||
991 | Each entry in the output consists of the name of the input element | ||
992 | e.g. "layer_priority", followed by the properties defined for that | ||
993 | element enclosed in braces. This information should provide | ||
994 | sufficient information to create a complete user interface. Two | ||
995 | features of the scheme provide for conditional input. First, if a | ||
996 | Python "if" statement appears in place of an input element name, | ||
997 | the set of enclosed input elements apply and should be presented | ||
998 | to the user only if the 'if' statement evaluates to true. The | ||
999 | test in the if statement will always reference another input | ||
1000 | element in the list, which means that the element being tested | ||
1001 | should be presented to the user before the elements enclosed by | ||
1002 | the if block. Secondly, in a similar way, some elements contain | ||
1003 | "depends-on" and depends-on-val" tags, which mean that the | ||
1004 | affected input element should only be presented to the user if the | ||
1005 | element it depends on has already been presented to the user and | ||
1006 | the user has selected the specified value for that element. | ||
1007 | |||
1008 | The second form enumerates all the possible values that exist and | ||
1009 | can be specified for any of the enumerable properties in the | ||
1010 | 'yocto-layer create' command. If the -o option is specified, the | ||
1011 | list of values for the given property, in addition to being | ||
1012 | displayed, will be written to the specified file as a JSON object. | ||
1013 | In this case, the object will consist of the set of name:value | ||
1014 | pairs corresponding to the array of property values associated | ||
1015 | with the property. | ||
1016 | |||
1017 | $ yocto-layer list property layer_priority | ||
1018 | [no output - layer_priority is a text field that has no enumerable values] | ||
1019 | |||
1020 | The second form as well is meant mainly for developers of | ||
1021 | alternative interfaces - it allows the developer to fetch the | ||
1022 | possible values for a given input element on-demand. This | ||
1023 | on-demand capability is especially valuable for elements that | ||
1024 | require relatively expensive remote operations to fulfill, such as | ||
1025 | the example that returns the set of branches available in a remote | ||
1026 | git tree above. | ||
1027 | |||
1028 | """ | ||
1029 | |||
1030 | ## | ||
1031 | # test code | ||
1032 | ## | ||
1033 | |||
1034 | test_bsp_properties = { | ||
1035 | 'smp': 'yes', | ||
1036 | 'touchscreen': 'yes', | ||
1037 | 'keyboard': 'no', | ||
1038 | 'xserver': 'yes', | ||
1039 | 'xserver_choice': 'xserver-i915', | ||
1040 | 'features': ['goodfeature', 'greatfeature'], | ||
1041 | 'tunefile': 'tune-quark', | ||
1042 | } | ||
1043 | |||
diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py new file mode 100644 index 0000000000..ba68b60fcb --- /dev/null +++ b/scripts/lib/bsp/kernel.py | |||
@@ -0,0 +1,1071 @@ | |||
1 | # ex:ts=4:sw=4:sts=4:et | ||
2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | ||
3 | # | ||
4 | # Copyright (c) 2012, Intel Corporation. | ||
5 | # All rights reserved. | ||
6 | # | ||
7 | # This program is free software; you can redistribute it and/or modify | ||
8 | # it under the terms of the GNU General Public License version 2 as | ||
9 | # published by the Free Software Foundation. | ||
10 | # | ||
11 | # This program is distributed in the hope that it will be useful, | ||
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | # GNU General Public License for more details. | ||
15 | # | ||
16 | # You should have received a copy of the GNU General Public License along | ||
17 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | # | ||
20 | # DESCRIPTION | ||
21 | # This module implements the kernel-related functions used by | ||
22 | # 'yocto-kernel' to manage kernel config items and patches for Yocto | ||
23 | # BSPs. | ||
24 | # | ||
25 | # AUTHORS | ||
26 | # Tom Zanussi <tom.zanussi (at] intel.com> | ||
27 | # | ||
28 | |||
29 | import sys | ||
30 | import os | ||
31 | import shutil | ||
32 | from tags import * | ||
33 | import glob | ||
34 | import subprocess | ||
35 | from engine import create_context | ||
36 | |||
37 | |||
38 | def find_bblayers(): | ||
39 | """ | ||
40 | Find and return a sanitized list of the layers found in BBLAYERS. | ||
41 | """ | ||
42 | try: | ||
43 | builddir = os.environ["BUILDDIR"] | ||
44 | except KeyError: | ||
45 | print "BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)" | ||
46 | sys.exit(1) | ||
47 | bblayers_conf = os.path.join(builddir, "conf/bblayers.conf") | ||
48 | |||
49 | layers = [] | ||
50 | |||
51 | bitbake_env_cmd = "bitbake -e" | ||
52 | bitbake_env_lines = subprocess.Popen(bitbake_env_cmd, shell=True, | ||
53 | stdout=subprocess.PIPE).stdout.read() | ||
54 | |||
55 | if not bitbake_env_lines: | ||
56 | print "Couldn't get '%s' output, exiting." % bitbake_env_cmd | ||
57 | sys.exit(1) | ||
58 | |||
59 | for line in bitbake_env_lines.split('\n'): | ||
60 | bblayers = get_line_val(line, "BBLAYERS") | ||
61 | if (bblayers): | ||
62 | break | ||
63 | |||
64 | if not bblayers: | ||
65 | print "Couldn't find BBLAYERS in %s output, exiting." % \ | ||
66 | bitbake_env_cmd | ||
67 | sys.exit(1) | ||
68 | |||
69 | raw_layers = bblayers.split() | ||
70 | |||
71 | for layer in raw_layers: | ||
72 | if layer == 'BBLAYERS' or '=' in layer: | ||
73 | continue | ||
74 | layers.append(layer) | ||
75 | |||
76 | return layers | ||
77 | |||
78 | |||
79 | def get_line_val(line, key): | ||
80 | """ | ||
81 | Extract the value from the VAR="val" string | ||
82 | """ | ||
83 | if line.startswith(key + "="): | ||
84 | stripped_line = line.split('=')[1] | ||
85 | stripped_line = stripped_line.replace('\"', '') | ||
86 | return stripped_line | ||
87 | return None | ||
88 | |||
89 | |||
90 | def find_meta_layer(): | ||
91 | """ | ||
92 | Find and return the meta layer in BBLAYERS. | ||
93 | """ | ||
94 | layers = find_bblayers() | ||
95 | |||
96 | for layer in layers: | ||
97 | if layer.endswith("meta"): | ||
98 | return layer | ||
99 | |||
100 | return None | ||
101 | |||
102 | |||
103 | def find_bsp_layer(machine): | ||
104 | """ | ||
105 | Find and return a machine's BSP layer in BBLAYERS. | ||
106 | """ | ||
107 | layers = find_bblayers() | ||
108 | |||
109 | for layer in layers: | ||
110 | if layer.endswith(machine): | ||
111 | return layer | ||
112 | |||
113 | print "Unable to find the BSP layer for machine %s." % machine | ||
114 | print "Please make sure it is listed in bblayers.conf" | ||
115 | sys.exit(1) | ||
116 | |||
117 | |||
118 | def gen_choices_str(choices): | ||
119 | """ | ||
120 | Generate a numbered list of choices from a list of choices for | ||
121 | display to the user. | ||
122 | """ | ||
123 | choices_str = "" | ||
124 | |||
125 | for i, choice in enumerate(choices): | ||
126 | choices_str += "\t" + str(i + 1) + ") " + choice + "\n" | ||
127 | |||
128 | return choices_str | ||
129 | |||
130 | |||
131 | def open_user_file(scripts_path, machine, userfile, mode): | ||
132 | """ | ||
133 | Find one of the user files (user-config.cfg, user-patches.scc) | ||
134 | associated with the machine (could be in files/, | ||
135 | linux-yocto-custom/, etc). Returns the open file if found, None | ||
136 | otherwise. | ||
137 | |||
138 | The caller is responsible for closing the file returned. | ||
139 | """ | ||
140 | layer = find_bsp_layer(machine) | ||
141 | linuxdir = os.path.join(layer, "recipes-kernel/linux") | ||
142 | linuxdir_list = os.listdir(linuxdir) | ||
143 | for fileobj in linuxdir_list: | ||
144 | fileobj_path = os.path.join(linuxdir, fileobj) | ||
145 | if os.path.isdir(fileobj_path): | ||
146 | userfile_name = os.path.join(fileobj_path, userfile) | ||
147 | try: | ||
148 | f = open(userfile_name, mode) | ||
149 | return f | ||
150 | except IOError: | ||
151 | continue | ||
152 | return None | ||
153 | |||
154 | |||
155 | def read_config_items(scripts_path, machine): | ||
156 | """ | ||
157 | Find and return a list of config items (CONFIG_XXX) in a machine's | ||
158 | user-defined config fragment [${machine}-user-config.cfg]. | ||
159 | """ | ||
160 | config_items = [] | ||
161 | |||
162 | f = open_user_file(scripts_path, machine, machine+"-user-config.cfg", "r") | ||
163 | lines = f.readlines() | ||
164 | for line in lines: | ||
165 | s = line.strip() | ||
166 | if s and not s.startswith("#"): | ||
167 | config_items.append(s) | ||
168 | f.close() | ||
169 | |||
170 | return config_items | ||
171 | |||
172 | |||
173 | def write_config_items(scripts_path, machine, config_items): | ||
174 | """ | ||
175 | Write (replace) the list of config items (CONFIG_XXX) in a | ||
176 | machine's user-defined config fragment [${machine}=user-config.cfg]. | ||
177 | """ | ||
178 | f = open_user_file(scripts_path, machine, machine+"-user-config.cfg", "w") | ||
179 | for item in config_items: | ||
180 | f.write(item + "\n") | ||
181 | f.close() | ||
182 | |||
183 | kernel_contents_changed(scripts_path, machine) | ||
184 | |||
185 | |||
186 | def yocto_kernel_config_list(scripts_path, machine): | ||
187 | """ | ||
188 | Display the list of config items (CONFIG_XXX) in a machine's | ||
189 | user-defined config fragment [${machine}-user-config.cfg]. | ||
190 | """ | ||
191 | config_items = read_config_items(scripts_path, machine) | ||
192 | |||
193 | print "The current set of machine-specific kernel config items for %s is:" % machine | ||
194 | print gen_choices_str(config_items) | ||
195 | |||
196 | |||
197 | def yocto_kernel_config_rm(scripts_path, machine): | ||
198 | """ | ||
199 | Display the list of config items (CONFIG_XXX) in a machine's | ||
200 | user-defined config fragment [${machine}-user-config.cfg], prompt the user | ||
201 | for one or more to remove, and remove them. | ||
202 | """ | ||
203 | config_items = read_config_items(scripts_path, machine) | ||
204 | |||
205 | print "Specify the kernel config items to remove:" | ||
206 | input = raw_input(gen_choices_str(config_items)) | ||
207 | rm_choices = input.split() | ||
208 | rm_choices.sort() | ||
209 | |||
210 | removed = [] | ||
211 | |||
212 | for choice in reversed(rm_choices): | ||
213 | try: | ||
214 | idx = int(choice) - 1 | ||
215 | except ValueError: | ||
216 | print "Invalid choice (%s), exiting" % choice | ||
217 | sys.exit(1) | ||
218 | if idx < 0 or idx >= len(config_items): | ||
219 | print "Invalid choice (%d), exiting" % (idx + 1) | ||
220 | sys.exit(1) | ||
221 | removed.append(config_items.pop(idx)) | ||
222 | |||
223 | write_config_items(scripts_path, machine, config_items) | ||
224 | |||
225 | print "Removed items:" | ||
226 | for r in removed: | ||
227 | print "\t%s" % r | ||
228 | |||
229 | |||
230 | def yocto_kernel_config_add(scripts_path, machine, config_items): | ||
231 | """ | ||
232 | Add one or more config items (CONFIG_XXX) to a machine's | ||
233 | user-defined config fragment [${machine}-user-config.cfg]. | ||
234 | """ | ||
235 | new_items = [] | ||
236 | dup_items = [] | ||
237 | |||
238 | cur_items = read_config_items(scripts_path, machine) | ||
239 | |||
240 | for item in config_items: | ||
241 | if not item.startswith("CONFIG") or (not "=y" in item and not "=m" in item): | ||
242 | print "Invalid config item (%s), exiting" % item | ||
243 | sys.exit(1) | ||
244 | if item not in cur_items and item not in new_items: | ||
245 | new_items.append(item) | ||
246 | else: | ||
247 | dup_items.append(item) | ||
248 | |||
249 | if len(new_items) > 0: | ||
250 | cur_items.extend(new_items) | ||
251 | write_config_items(scripts_path, machine, cur_items) | ||
252 | print "Added item%s:" % ("" if len(new_items)==1 else "s") | ||
253 | for n in new_items: | ||
254 | print "\t%s" % n | ||
255 | |||
256 | if len(dup_items) > 0: | ||
257 | output="The following item%s already exist%s in the current configuration, ignoring %s:" % \ | ||
258 | (("","s", "it") if len(dup_items)==1 else ("s", "", "them" )) | ||
259 | print output | ||
260 | for n in dup_items: | ||
261 | print "\t%s" % n | ||
262 | |||
263 | def find_current_kernel(bsp_layer, machine): | ||
264 | """ | ||
265 | Determine the kernel and version currently being used in the BSP. | ||
266 | """ | ||
267 | machine_conf = os.path.join(bsp_layer, "conf/machine/" + machine + ".conf") | ||
268 | |||
269 | preferred_kernel = preferred_kernel_version = preferred_version_varname = None | ||
270 | |||
271 | f = open(machine_conf, "r") | ||
272 | lines = f.readlines() | ||
273 | for line in lines: | ||
274 | if line.strip().startswith("PREFERRED_PROVIDER_virtual/kernel"): | ||
275 | preferred_kernel = line.split()[-1] | ||
276 | preferred_kernel = preferred_kernel.replace('\"','') | ||
277 | preferred_version_varname = "PREFERRED_VERSION_" + preferred_kernel | ||
278 | if preferred_version_varname and line.strip().startswith(preferred_version_varname): | ||
279 | preferred_kernel_version = line.split()[-1] | ||
280 | preferred_kernel_version = preferred_kernel_version.replace('\"','') | ||
281 | preferred_kernel_version = preferred_kernel_version.replace('%','') | ||
282 | |||
283 | if preferred_kernel and preferred_kernel_version: | ||
284 | return preferred_kernel + "_" + preferred_kernel_version | ||
285 | elif preferred_kernel: | ||
286 | return preferred_kernel | ||
287 | |||
288 | |||
289 | def find_filesdir(scripts_path, machine): | ||
290 | """ | ||
291 | Find the name of the 'files' dir associated with the machine | ||
292 | (could be in files/, linux-yocto-custom/, etc). Returns the name | ||
293 | of the files dir if found, None otherwise. | ||
294 | """ | ||
295 | layer = find_bsp_layer(machine) | ||
296 | filesdir = None | ||
297 | linuxdir = os.path.join(layer, "recipes-kernel/linux") | ||
298 | linuxdir_list = os.listdir(linuxdir) | ||
299 | for fileobj in linuxdir_list: | ||
300 | fileobj_path = os.path.join(linuxdir, fileobj) | ||
301 | if os.path.isdir(fileobj_path): | ||
302 | # this could be files/ or linux-yocto-custom/, we have no way of distinguishing | ||
303 | # so we take the first (and normally only) dir we find as the 'filesdir' | ||
304 | filesdir = fileobj_path | ||
305 | |||
306 | return filesdir | ||
307 | |||
308 | |||
309 | def read_patch_items(scripts_path, machine): | ||
310 | """ | ||
311 | Find and return a list of patch items in a machine's user-defined | ||
312 | patch list [${machine}-user-patches.scc]. | ||
313 | """ | ||
314 | patch_items = [] | ||
315 | |||
316 | f = open_user_file(scripts_path, machine, machine+"-user-patches.scc", "r") | ||
317 | lines = f.readlines() | ||
318 | for line in lines: | ||
319 | s = line.strip() | ||
320 | if s and not s.startswith("#"): | ||
321 | fields = s.split() | ||
322 | if not fields[0] == "patch": | ||
323 | continue | ||
324 | patch_items.append(fields[1]) | ||
325 | f.close() | ||
326 | |||
327 | return patch_items | ||
328 | |||
329 | |||
330 | def write_patch_items(scripts_path, machine, patch_items): | ||
331 | """ | ||
332 | Write (replace) the list of patches in a machine's user-defined | ||
333 | patch list [${machine}-user-patches.scc]. | ||
334 | """ | ||
335 | f = open_user_file(scripts_path, machine, machine+"-user-patches.scc", "w") | ||
336 | for item in patch_items: | ||
337 | f.write("patch " + item + "\n") | ||
338 | f.close() | ||
339 | |||
340 | kernel_contents_changed(scripts_path, machine) | ||
341 | |||
342 | |||
343 | def yocto_kernel_patch_list(scripts_path, machine): | ||
344 | """ | ||
345 | Display the list of patches in a machine's user-defined patch list | ||
346 | [${machine}-user-patches.scc]. | ||
347 | """ | ||
348 | patches = read_patch_items(scripts_path, machine) | ||
349 | |||
350 | print "The current set of machine-specific patches for %s is:" % machine | ||
351 | print gen_choices_str(patches) | ||
352 | |||
353 | |||
354 | def yocto_kernel_patch_rm(scripts_path, machine): | ||
355 | """ | ||
356 | Remove one or more patches from a machine's user-defined patch | ||
357 | list [${machine}-user-patches.scc]. | ||
358 | """ | ||
359 | patches = read_patch_items(scripts_path, machine) | ||
360 | |||
361 | print "Specify the patches to remove:" | ||
362 | input = raw_input(gen_choices_str(patches)) | ||
363 | rm_choices = input.split() | ||
364 | rm_choices.sort() | ||
365 | |||
366 | removed = [] | ||
367 | |||
368 | filesdir = find_filesdir(scripts_path, machine) | ||
369 | if not filesdir: | ||
370 | print "Couldn't rm patch(es) since we couldn't find a 'files' dir" | ||
371 | sys.exit(1) | ||
372 | |||
373 | for choice in reversed(rm_choices): | ||
374 | try: | ||
375 | idx = int(choice) - 1 | ||
376 | except ValueError: | ||
377 | print "Invalid choice (%s), exiting" % choice | ||
378 | sys.exit(1) | ||
379 | if idx < 0 or idx >= len(patches): | ||
380 | print "Invalid choice (%d), exiting" % (idx + 1) | ||
381 | sys.exit(1) | ||
382 | filesdir_patch = os.path.join(filesdir, patches[idx]) | ||
383 | if os.path.isfile(filesdir_patch): | ||
384 | os.remove(filesdir_patch) | ||
385 | removed.append(patches[idx]) | ||
386 | patches.pop(idx) | ||
387 | |||
388 | write_patch_items(scripts_path, machine, patches) | ||
389 | |||
390 | print "Removed patches:" | ||
391 | for r in removed: | ||
392 | print "\t%s" % r | ||
393 | |||
394 | |||
395 | def yocto_kernel_patch_add(scripts_path, machine, patches): | ||
396 | """ | ||
397 | Add one or more patches to a machine's user-defined patch list | ||
398 | [${machine}-user-patches.scc]. | ||
399 | """ | ||
400 | existing_patches = read_patch_items(scripts_path, machine) | ||
401 | |||
402 | for patch in patches: | ||
403 | if os.path.basename(patch) in existing_patches: | ||
404 | print "Couldn't add patch (%s) since it's already been added" % os.path.basename(patch) | ||
405 | sys.exit(1) | ||
406 | |||
407 | filesdir = find_filesdir(scripts_path, machine) | ||
408 | if not filesdir: | ||
409 | print "Couldn't add patch (%s) since we couldn't find a 'files' dir to add it to" % os.path.basename(patch) | ||
410 | sys.exit(1) | ||
411 | |||
412 | new_patches = [] | ||
413 | |||
414 | for patch in patches: | ||
415 | if not os.path.isfile(patch): | ||
416 | print "Couldn't find patch (%s), exiting" % patch | ||
417 | sys.exit(1) | ||
418 | basename = os.path.basename(patch) | ||
419 | filesdir_patch = os.path.join(filesdir, basename) | ||
420 | shutil.copyfile(patch, filesdir_patch) | ||
421 | new_patches.append(basename) | ||
422 | |||
423 | cur_items = read_patch_items(scripts_path, machine) | ||
424 | cur_items.extend(new_patches) | ||
425 | write_patch_items(scripts_path, machine, cur_items) | ||
426 | |||
427 | print "Added patches:" | ||
428 | for n in new_patches: | ||
429 | print "\t%s" % n | ||
430 | |||
431 | |||
432 | def inc_pr(line): | ||
433 | """ | ||
434 | Add 1 to the PR value in the given bbappend PR line. For the PR | ||
435 | lines in kernel .bbappends after modifications. Handles PRs of | ||
436 | the form PR := "${PR}.1" as well as PR = "r0". | ||
437 | """ | ||
438 | idx = line.find("\"") | ||
439 | |||
440 | pr_str = line[idx:] | ||
441 | pr_str = pr_str.replace('\"','') | ||
442 | fields = pr_str.split('.') | ||
443 | if len(fields) > 1: | ||
444 | fields[1] = str(int(fields[1]) + 1) | ||
445 | pr_str = "\"" + '.'.join(fields) + "\"\n" | ||
446 | else: | ||
447 | pr_val = pr_str[1:] | ||
448 | pr_str = "\"" + "r" + str(int(pr_val) + 1) + "\"\n" | ||
449 | idx2 = line.find("\"", idx + 1) | ||
450 | line = line[:idx] + pr_str | ||
451 | |||
452 | return line | ||
453 | |||
454 | |||
455 | def kernel_contents_changed(scripts_path, machine): | ||
456 | """ | ||
457 | Do what we need to do to notify the system that the kernel | ||
458 | recipe's contents have changed. | ||
459 | """ | ||
460 | layer = find_bsp_layer(machine) | ||
461 | |||
462 | kernel = find_current_kernel(layer, machine) | ||
463 | if not kernel: | ||
464 | print "Couldn't determine the kernel for this BSP, exiting." | ||
465 | sys.exit(1) | ||
466 | |||
467 | kernel_bbfile = os.path.join(layer, "recipes-kernel/linux/" + kernel + ".bbappend") | ||
468 | if not os.path.isfile(kernel_bbfile): | ||
469 | kernel_bbfile = os.path.join(layer, "recipes-kernel/linux/" + kernel + ".bb") | ||
470 | if not os.path.isfile(kernel_bbfile): | ||
471 | return | ||
472 | kernel_bbfile_prev = kernel_bbfile + ".prev" | ||
473 | shutil.copyfile(kernel_bbfile, kernel_bbfile_prev) | ||
474 | |||
475 | ifile = open(kernel_bbfile_prev, "r") | ||
476 | ofile = open(kernel_bbfile, "w") | ||
477 | ifile_lines = ifile.readlines() | ||
478 | for ifile_line in ifile_lines: | ||
479 | if ifile_line.strip().startswith("PR"): | ||
480 | ifile_line = inc_pr(ifile_line) | ||
481 | ofile.write(ifile_line) | ||
482 | ofile.close() | ||
483 | ifile.close() | ||
484 | |||
485 | |||
486 | def kernels(context): | ||
487 | """ | ||
488 | Return the list of available kernels in the BSP i.e. corresponding | ||
489 | to the kernel .bbappends found in the layer. | ||
490 | """ | ||
491 | archdir = os.path.join(context["scripts_path"], "lib/bsp/substrate/target/arch/" + context["arch"]) | ||
492 | kerndir = os.path.join(archdir, "recipes-kernel/linux") | ||
493 | bbglob = os.path.join(kerndir, "*.bbappend") | ||
494 | |||
495 | bbappends = glob.glob(bbglob) | ||
496 | |||
497 | kernels = [] | ||
498 | |||
499 | for kernel in bbappends: | ||
500 | filename = os.path.splitext(os.path.basename(kernel))[0] | ||
501 | idx = filename.find(CLOSE_TAG) | ||
502 | if idx != -1: | ||
503 | filename = filename[idx + len(CLOSE_TAG):].strip() | ||
504 | kernels.append(filename) | ||
505 | |||
506 | kernels.append("custom") | ||
507 | |||
508 | return kernels | ||
509 | |||
510 | |||
511 | def extract_giturl(file): | ||
512 | """ | ||
513 | Extract the git url of the kernel repo from the kernel recipe's | ||
514 | SRC_URI. | ||
515 | """ | ||
516 | url = None | ||
517 | f = open(file, "r") | ||
518 | lines = f.readlines() | ||
519 | for line in lines: | ||
520 | line = line.strip() | ||
521 | if line.startswith("SRC_URI"): | ||
522 | line = line[len("SRC_URI"):].strip() | ||
523 | if line.startswith("="): | ||
524 | line = line[1:].strip() | ||
525 | if line.startswith("\""): | ||
526 | line = line[1:].strip() | ||
527 | prot = "git" | ||
528 | for s in line.split(";"): | ||
529 | if s.startswith("git://"): | ||
530 | url = s | ||
531 | if s.startswith("protocol="): | ||
532 | prot = s.split("=")[1] | ||
533 | if url: | ||
534 | url = prot + url[3:] | ||
535 | return url | ||
536 | |||
537 | |||
538 | def find_giturl(context): | ||
539 | """ | ||
540 | Find the git url of the kernel repo from the kernel recipe's | ||
541 | SRC_URI. | ||
542 | """ | ||
543 | name = context["name"] | ||
544 | filebase = context["filename"] | ||
545 | scripts_path = context["scripts_path"] | ||
546 | |||
547 | meta_layer = find_meta_layer() | ||
548 | |||
549 | kerndir = os.path.join(meta_layer, "recipes-kernel/linux") | ||
550 | bbglob = os.path.join(kerndir, "*.bb") | ||
551 | bbs = glob.glob(bbglob) | ||
552 | for kernel in bbs: | ||
553 | filename = os.path.splitext(os.path.basename(kernel))[0] | ||
554 | if filename in filebase: | ||
555 | giturl = extract_giturl(kernel) | ||
556 | return giturl | ||
557 | |||
558 | return None | ||
559 | |||
560 | |||
561 | def read_features(scripts_path, machine): | ||
562 | """ | ||
563 | Find and return a list of features in a machine's user-defined | ||
564 | features fragment [${machine}-user-features.scc]. | ||
565 | """ | ||
566 | features = [] | ||
567 | |||
568 | f = open_user_file(scripts_path, machine, machine+"-user-features.scc", "r") | ||
569 | lines = f.readlines() | ||
570 | for line in lines: | ||
571 | s = line.strip() | ||
572 | if s and not s.startswith("#"): | ||
573 | feature_include = s.split() | ||
574 | features.append(feature_include[1].strip()) | ||
575 | f.close() | ||
576 | |||
577 | return features | ||
578 | |||
579 | |||
580 | def write_features(scripts_path, machine, features): | ||
581 | """ | ||
582 | Write (replace) the list of feature items in a | ||
583 | machine's user-defined features fragment [${machine}=user-features.cfg]. | ||
584 | """ | ||
585 | f = open_user_file(scripts_path, machine, machine+"-user-features.scc", "w") | ||
586 | for item in features: | ||
587 | f.write("include " + item + "\n") | ||
588 | f.close() | ||
589 | |||
590 | kernel_contents_changed(scripts_path, machine) | ||
591 | |||
592 | |||
593 | def yocto_kernel_feature_list(scripts_path, machine): | ||
594 | """ | ||
595 | Display the list of features used in a machine's user-defined | ||
596 | features fragment [${machine}-user-features.scc]. | ||
597 | """ | ||
598 | features = read_features(scripts_path, machine) | ||
599 | |||
600 | print "The current set of machine-specific features for %s is:" % machine | ||
601 | print gen_choices_str(features) | ||
602 | |||
603 | |||
604 | def yocto_kernel_feature_rm(scripts_path, machine): | ||
605 | """ | ||
606 | Display the list of features used in a machine's user-defined | ||
607 | features fragment [${machine}-user-features.scc], prompt the user | ||
608 | for one or more to remove, and remove them. | ||
609 | """ | ||
610 | features = read_features(scripts_path, machine) | ||
611 | |||
612 | print "Specify the features to remove:" | ||
613 | input = raw_input(gen_choices_str(features)) | ||
614 | rm_choices = input.split() | ||
615 | rm_choices.sort() | ||
616 | |||
617 | removed = [] | ||
618 | |||
619 | for choice in reversed(rm_choices): | ||
620 | try: | ||
621 | idx = int(choice) - 1 | ||
622 | except ValueError: | ||
623 | print "Invalid choice (%s), exiting" % choice | ||
624 | sys.exit(1) | ||
625 | if idx < 0 or idx >= len(features): | ||
626 | print "Invalid choice (%d), exiting" % (idx + 1) | ||
627 | sys.exit(1) | ||
628 | removed.append(features.pop(idx)) | ||
629 | |||
630 | write_features(scripts_path, machine, features) | ||
631 | |||
632 | print "Removed features:" | ||
633 | for r in removed: | ||
634 | print "\t%s" % r | ||
635 | |||
636 | |||
637 | def yocto_kernel_feature_add(scripts_path, machine, features): | ||
638 | """ | ||
639 | Add one or more features a machine's user-defined features | ||
640 | fragment [${machine}-user-features.scc]. | ||
641 | """ | ||
642 | new_items = [] | ||
643 | |||
644 | for item in features: | ||
645 | if not item.endswith(".scc"): | ||
646 | print "Invalid feature (%s), exiting" % item | ||
647 | sys.exit(1) | ||
648 | new_items.append(item) | ||
649 | |||
650 | cur_items = read_features(scripts_path, machine) | ||
651 | cur_items.extend(new_items) | ||
652 | |||
653 | write_features(scripts_path, machine, cur_items) | ||
654 | |||
655 | print "Added features:" | ||
656 | for n in new_items: | ||
657 | print "\t%s" % n | ||
658 | |||
659 | |||
660 | def find_feature_url(git_url): | ||
661 | """ | ||
662 | Find the url of the kern-features.rc kernel for the kernel repo | ||
663 | specified from the BSP's kernel recipe SRC_URI. | ||
664 | """ | ||
665 | feature_url = "" | ||
666 | if git_url.startswith("git://"): | ||
667 | git_url = git_url[len("git://"):].strip() | ||
668 | s = git_url.split("/") | ||
669 | if s[1].endswith(".git"): | ||
670 | s[1] = s[1][:len(s[1]) - len(".git")] | ||
671 | feature_url = "http://" + s[0] + "/cgit/cgit.cgi/" + s[1] + \ | ||
672 | "/plain/meta/cfg/kern-features.rc?h=meta" | ||
673 | |||
674 | return feature_url | ||
675 | |||
676 | |||
677 | def find_feature_desc(lines): | ||
678 | """ | ||
679 | Find the feature description and compatibility in the passed-in | ||
680 | set of lines. Returns a string string of the form 'desc | ||
681 | [compat]'. | ||
682 | """ | ||
683 | desc = "no description available" | ||
684 | compat = "unknown" | ||
685 | |||
686 | for line in lines: | ||
687 | idx = line.find("KFEATURE_DESCRIPTION") | ||
688 | if idx != -1: | ||
689 | desc = line[idx + len("KFEATURE_DESCRIPTION"):].strip() | ||
690 | if desc.startswith("\""): | ||
691 | desc = desc[1:] | ||
692 | if desc.endswith("\""): | ||
693 | desc = desc[:-1] | ||
694 | else: | ||
695 | idx = line.find("KFEATURE_COMPATIBILITY") | ||
696 | if idx != -1: | ||
697 | compat = line[idx + len("KFEATURE_COMPATIBILITY"):].strip() | ||
698 | |||
699 | return desc + " [" + compat + "]" | ||
700 | |||
701 | |||
702 | def print_feature_descs(layer, feature_dir): | ||
703 | """ | ||
704 | Print the feature descriptions for the features in feature_dir. | ||
705 | """ | ||
706 | kernel_files_features = os.path.join(layer, "recipes-kernel/linux/files/" + | ||
707 | feature_dir) | ||
708 | for root, dirs, files in os.walk(kernel_files_features): | ||
709 | for file in files: | ||
710 | if file.endswith("~") or file.endswith("#"): | ||
711 | continue | ||
712 | if file.endswith(".scc"): | ||
713 | fullpath = os.path.join(layer, "recipes-kernel/linux/files/" + | ||
714 | feature_dir + "/" + file) | ||
715 | f = open(fullpath) | ||
716 | feature_desc = find_feature_desc(f.readlines()) | ||
717 | print feature_dir + "/" + file + ": " + feature_desc | ||
718 | |||
719 | |||
720 | def yocto_kernel_available_features_list(scripts_path, machine): | ||
721 | """ | ||
722 | Display the list of all the kernel features available for use in | ||
723 | BSPs, as gathered from the set of feature sources. | ||
724 | """ | ||
725 | layer = find_bsp_layer(machine) | ||
726 | kernel = find_current_kernel(layer, machine) | ||
727 | if not kernel: | ||
728 | print "Couldn't determine the kernel for this BSP, exiting." | ||
729 | sys.exit(1) | ||
730 | |||
731 | context = create_context(machine, "arch", scripts_path) | ||
732 | context["name"] = "name" | ||
733 | context["filename"] = kernel | ||
734 | giturl = find_giturl(context) | ||
735 | feature_url = find_feature_url(giturl) | ||
736 | |||
737 | feature_cmd = "wget -q -O - " + feature_url | ||
738 | tmp = subprocess.Popen(feature_cmd, shell=True, stdout=subprocess.PIPE).stdout.read() | ||
739 | |||
740 | print "The current set of kernel features available to %s is:\n" % machine | ||
741 | |||
742 | if tmp: | ||
743 | tmpline = tmp.split("\n") | ||
744 | in_kernel_options = False | ||
745 | for line in tmpline: | ||
746 | if not "=" in line: | ||
747 | if in_kernel_options: | ||
748 | break | ||
749 | if "kernel-options" in line: | ||
750 | in_kernel_options = True | ||
751 | continue | ||
752 | if in_kernel_options: | ||
753 | feature_def = line.split("=") | ||
754 | feature_type = feature_def[0].strip() | ||
755 | feature = feature_def[1].strip() | ||
756 | desc = get_feature_desc(giturl, feature) | ||
757 | print "%s: %s" % (feature, desc) | ||
758 | |||
759 | print "[local]" | ||
760 | |||
761 | print_feature_descs(layer, "cfg") | ||
762 | print_feature_descs(layer, "features") | ||
763 | |||
764 | |||
765 | def find_feature_desc_url(git_url, feature): | ||
766 | """ | ||
767 | Find the url of the kernel feature in the kernel repo specified | ||
768 | from the BSP's kernel recipe SRC_URI. | ||
769 | """ | ||
770 | feature_desc_url = "" | ||
771 | if git_url.startswith("git://"): | ||
772 | git_url = git_url[len("git://"):].strip() | ||
773 | s = git_url.split("/") | ||
774 | if s[1].endswith(".git"): | ||
775 | s[1] = s[1][:len(s[1]) - len(".git")] | ||
776 | feature_desc_url = "http://" + s[0] + "/cgit/cgit.cgi/" + s[1] + \ | ||
777 | "/plain/meta/cfg/kernel-cache/" + feature + "?h=meta" | ||
778 | |||
779 | return feature_desc_url | ||
780 | |||
781 | |||
782 | def get_feature_desc(git_url, feature): | ||
783 | """ | ||
784 | Return a feature description of the form 'description [compatibility] | ||
785 | BSPs, as gathered from the set of feature sources. | ||
786 | """ | ||
787 | feature_desc_url = find_feature_desc_url(git_url, feature) | ||
788 | feature_desc_cmd = "wget -q -O - " + feature_desc_url | ||
789 | tmp = subprocess.Popen(feature_desc_cmd, shell=True, stdout=subprocess.PIPE).stdout.read() | ||
790 | |||
791 | return find_feature_desc(tmp.split("\n")) | ||
792 | |||
793 | |||
794 | def yocto_kernel_feature_describe(scripts_path, machine, feature): | ||
795 | """ | ||
796 | Display the description of a specific kernel feature available for | ||
797 | use in a BSP. | ||
798 | """ | ||
799 | layer = find_bsp_layer(machine) | ||
800 | |||
801 | kernel = find_current_kernel(layer, machine) | ||
802 | if not kernel: | ||
803 | print "Couldn't determine the kernel for this BSP, exiting." | ||
804 | sys.exit(1) | ||
805 | |||
806 | context = create_context(machine, "arch", scripts_path) | ||
807 | context["name"] = "name" | ||
808 | context["filename"] = kernel | ||
809 | giturl = find_giturl(context) | ||
810 | |||
811 | desc = get_feature_desc(giturl, feature) | ||
812 | |||
813 | print desc | ||
814 | |||
815 | |||
816 | def check_feature_name(feature_name): | ||
817 | """ | ||
818 | Sanity-check the feature name for create/destroy. Return False if not OK. | ||
819 | """ | ||
820 | if not feature_name.endswith(".scc"): | ||
821 | print "Invalid feature name (must end with .scc) [%s], exiting" % feature_name | ||
822 | return False | ||
823 | |||
824 | if "/" in feature_name: | ||
825 | print "Invalid feature name (don't specify directory) [%s], exiting" % feature_name | ||
826 | return False | ||
827 | |||
828 | return True | ||
829 | |||
830 | |||
831 | def check_create_input(feature_items): | ||
832 | """ | ||
833 | Sanity-check the create input. Return False if not OK. | ||
834 | """ | ||
835 | if not check_feature_name(feature_items[0]): | ||
836 | return False | ||
837 | |||
838 | if feature_items[1].endswith(".patch") or feature_items[1].startswith("CONFIG_"): | ||
839 | print "Missing description and/or compatibilty [%s], exiting" % feature_items[1] | ||
840 | return False | ||
841 | |||
842 | if feature_items[2].endswith(".patch") or feature_items[2].startswith("CONFIG_"): | ||
843 | print "Missing description and/or compatibility [%s], exiting" % feature_items[1] | ||
844 | return False | ||
845 | |||
846 | return True | ||
847 | |||
848 | |||
849 | def yocto_kernel_feature_create(scripts_path, machine, feature_items): | ||
850 | """ | ||
851 | Create a recipe-space kernel feature in a BSP. | ||
852 | """ | ||
853 | if not check_create_input(feature_items): | ||
854 | sys.exit(1) | ||
855 | |||
856 | feature = feature_items[0] | ||
857 | feature_basename = feature.split(".")[0] | ||
858 | feature_description = feature_items[1] | ||
859 | feature_compat = feature_items[2] | ||
860 | |||
861 | patches = [] | ||
862 | cfg_items = [] | ||
863 | |||
864 | for item in feature_items[3:]: | ||
865 | if item.endswith(".patch"): | ||
866 | patches.append(item) | ||
867 | elif item.startswith("CONFIG"): | ||
868 | if ("=y" in item or "=m" in item): | ||
869 | cfg_items.append(item) | ||
870 | else: | ||
871 | print "Invalid feature item (must be .patch or CONFIG_*) [%s], exiting" % item | ||
872 | sys.exit(1) | ||
873 | |||
874 | feature_dirname = "cfg" | ||
875 | if patches: | ||
876 | feature_dirname = "features" | ||
877 | |||
878 | filesdir = find_filesdir(scripts_path, machine) | ||
879 | if not filesdir: | ||
880 | print "Couldn't add feature (%s), no 'files' dir found" % feature | ||
881 | sys.exit(1) | ||
882 | |||
883 | featdir = os.path.join(filesdir, feature_dirname) | ||
884 | if not os.path.exists(featdir): | ||
885 | os.mkdir(featdir) | ||
886 | |||
887 | for patch in patches: | ||
888 | if not os.path.isfile(patch): | ||
889 | print "Couldn't find patch (%s), exiting" % patch | ||
890 | sys.exit(1) | ||
891 | basename = os.path.basename(patch) | ||
892 | featdir_patch = os.path.join(featdir, basename) | ||
893 | shutil.copyfile(patch, featdir_patch) | ||
894 | |||
895 | new_cfg_filename = os.path.join(featdir, feature_basename + ".cfg") | ||
896 | new_cfg_file = open(new_cfg_filename, "w") | ||
897 | for cfg_item in cfg_items: | ||
898 | new_cfg_file.write(cfg_item + "\n") | ||
899 | new_cfg_file.close() | ||
900 | |||
901 | new_feature_filename = os.path.join(featdir, feature_basename + ".scc") | ||
902 | new_feature_file = open(new_feature_filename, "w") | ||
903 | new_feature_file.write("define KFEATURE_DESCRIPTION \"" + feature_description + "\"\n") | ||
904 | new_feature_file.write("define KFEATURE_COMPATIBILITY " + feature_compat + "\n\n") | ||
905 | |||
906 | for patch in patches: | ||
907 | patch_dir, patch_file = os.path.split(patch) | ||
908 | new_feature_file.write("patch " + patch_file + "\n") | ||
909 | |||
910 | new_feature_file.write("kconf non-hardware " + feature_basename + ".cfg\n") | ||
911 | new_feature_file.close() | ||
912 | |||
913 | print "Added feature:" | ||
914 | print "\t%s" % feature_dirname + "/" + feature | ||
915 | |||
916 | |||
917 | def feature_in_use(scripts_path, machine, feature): | ||
918 | """ | ||
919 | Determine whether the specified feature is in use by the BSP. | ||
920 | Return True if so, False otherwise. | ||
921 | """ | ||
922 | features = read_features(scripts_path, machine) | ||
923 | for f in features: | ||
924 | if f == feature: | ||
925 | return True | ||
926 | return False | ||
927 | |||
928 | |||
929 | def feature_remove(scripts_path, machine, feature): | ||
930 | """ | ||
931 | Remove the specified feature from the available recipe-space | ||
932 | features defined for the BSP. | ||
933 | """ | ||
934 | features = read_features(scripts_path, machine) | ||
935 | new_features = [] | ||
936 | for f in features: | ||
937 | if f == feature: | ||
938 | continue | ||
939 | new_features.append(f) | ||
940 | write_features(scripts_path, machine, new_features) | ||
941 | |||
942 | |||
943 | def yocto_kernel_feature_destroy(scripts_path, machine, feature): | ||
944 | """ | ||
945 | Remove a recipe-space kernel feature from a BSP. | ||
946 | """ | ||
947 | if not check_feature_name(feature): | ||
948 | sys.exit(1) | ||
949 | |||
950 | if feature_in_use(scripts_path, machine, "features/" + feature) or \ | ||
951 | feature_in_use(scripts_path, machine, "cfg/" + feature): | ||
952 | print "Feature %s is in use (use 'feature rm' to un-use it first), exiting" % feature | ||
953 | sys.exit(1) | ||
954 | |||
955 | filesdir = find_filesdir(scripts_path, machine) | ||
956 | if not filesdir: | ||
957 | print "Couldn't destroy feature (%s), no 'files' dir found" % feature | ||
958 | sys.exit(1) | ||
959 | |||
960 | feature_dirname = "features" | ||
961 | featdir = os.path.join(filesdir, feature_dirname) | ||
962 | if not os.path.exists(featdir): | ||
963 | print "Couldn't find feature directory (%s)" % feature_dirname | ||
964 | sys.exit(1) | ||
965 | |||
966 | feature_fqn = os.path.join(featdir, feature) | ||
967 | if not os.path.exists(feature_fqn): | ||
968 | feature_dirname = "cfg" | ||
969 | featdir = os.path.join(filesdir, feature_dirname) | ||
970 | if not os.path.exists(featdir): | ||
971 | print "Couldn't find feature directory (%s)" % feature_dirname | ||
972 | sys.exit(1) | ||
973 | feature_fqn = os.path.join(featdir, feature_filename) | ||
974 | if not os.path.exists(feature_fqn): | ||
975 | print "Couldn't find feature (%s)" % feature | ||
976 | sys.exit(1) | ||
977 | |||
978 | f = open(feature_fqn, "r") | ||
979 | lines = f.readlines() | ||
980 | for line in lines: | ||
981 | s = line.strip() | ||
982 | if s.startswith("patch ") or s.startswith("kconf "): | ||
983 | split_line = s.split() | ||
984 | filename = os.path.join(featdir, split_line[-1]) | ||
985 | if os.path.exists(filename): | ||
986 | os.remove(filename) | ||
987 | f.close() | ||
988 | os.remove(feature_fqn) | ||
989 | |||
990 | feature_remove(scripts_path, machine, feature) | ||
991 | |||
992 | print "Removed feature:" | ||
993 | print "\t%s" % feature_dirname + "/" + feature | ||
994 | |||
995 | |||
996 | def base_branches(context): | ||
997 | """ | ||
998 | Return a list of the base branches found in the kernel git repo. | ||
999 | """ | ||
1000 | giturl = find_giturl(context) | ||
1001 | |||
1002 | print "Getting branches from remote repo %s..." % giturl | ||
1003 | |||
1004 | gitcmd = "git ls-remote %s *heads* 2>&1" % (giturl) | ||
1005 | tmp = subprocess.Popen(gitcmd, shell=True, stdout=subprocess.PIPE).stdout.read() | ||
1006 | |||
1007 | branches = [] | ||
1008 | |||
1009 | if tmp: | ||
1010 | tmpline = tmp.split("\n") | ||
1011 | for line in tmpline: | ||
1012 | if len(line)==0: | ||
1013 | break; | ||
1014 | if not line.endswith("base"): | ||
1015 | continue; | ||
1016 | idx = line.find("refs/heads/") | ||
1017 | kbranch = line[idx + len("refs/heads/"):] | ||
1018 | if kbranch.find("/") == -1 and kbranch.find("base") == -1: | ||
1019 | continue | ||
1020 | idx = kbranch.find("base") | ||
1021 | branches.append(kbranch[:idx - 1]) | ||
1022 | |||
1023 | return branches | ||
1024 | |||
1025 | |||
1026 | def all_branches(context): | ||
1027 | """ | ||
1028 | Return a list of all the branches found in the kernel git repo. | ||
1029 | """ | ||
1030 | giturl = find_giturl(context) | ||
1031 | |||
1032 | print "Getting branches from remote repo %s..." % giturl | ||
1033 | |||
1034 | gitcmd = "git ls-remote %s *heads* 2>&1" % (giturl) | ||
1035 | tmp = subprocess.Popen(gitcmd, shell=True, stdout=subprocess.PIPE).stdout.read() | ||
1036 | |||
1037 | branches = [] | ||
1038 | |||
1039 | base_prefixes = None | ||
1040 | |||
1041 | try: | ||
1042 | branches_base = context["branches_base"] | ||
1043 | if branches_base: | ||
1044 | base_prefixes = branches_base.split(":") | ||
1045 | except KeyError: | ||
1046 | pass | ||
1047 | |||
1048 | arch = context["arch"] | ||
1049 | |||
1050 | if tmp: | ||
1051 | tmpline = tmp.split("\n") | ||
1052 | for line in tmpline: | ||
1053 | if len(line)==0: | ||
1054 | break; | ||
1055 | idx = line.find("refs/heads/") | ||
1056 | kbranch = line[idx + len("refs/heads/"):] | ||
1057 | kbranch_prefix = kbranch.rsplit("/", 1)[0] | ||
1058 | |||
1059 | if base_prefixes: | ||
1060 | for base_prefix in base_prefixes: | ||
1061 | if kbranch_prefix == base_prefix: | ||
1062 | branches.append(kbranch) | ||
1063 | continue | ||
1064 | |||
1065 | if (kbranch.find("/") != -1 and | ||
1066 | (kbranch.find("standard") != -1 or kbranch.find("base") != -1) or | ||
1067 | kbranch == "base"): | ||
1068 | branches.append(kbranch) | ||
1069 | continue | ||
1070 | |||
1071 | return branches | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/.gitignore b/scripts/lib/bsp/substrate/target/arch/arm/.gitignore new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/.gitignore | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall b/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall new file mode 100644 index 0000000000..b442d02d57 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-dirname {{=machine}} | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf b/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf new file mode 100644 index 0000000000..bc52893e2a --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf | |||
@@ -0,0 +1,34 @@ | |||
1 | # yocto-bsp-filename {{ if xserver == "y": }} this | ||
2 | Section "Module" | ||
3 | Load "extmod" | ||
4 | Load "dbe" | ||
5 | Load "glx" | ||
6 | Load "freetype" | ||
7 | Load "type1" | ||
8 | Load "record" | ||
9 | Load "dri" | ||
10 | EndSection | ||
11 | |||
12 | Section "Monitor" | ||
13 | Identifier "Builtin Default Monitor" | ||
14 | EndSection | ||
15 | |||
16 | Section "Device" | ||
17 | Identifier "Builtin Default fbdev Device 0" | ||
18 | Driver "omapfb" | ||
19 | EndSection | ||
20 | |||
21 | Section "Screen" | ||
22 | Identifier "Builtin Default fbdev Screen 0" | ||
23 | Device "Builtin Default fbdev Device 0" | ||
24 | Monitor "Builtin Default Monitor" | ||
25 | EndSection | ||
26 | |||
27 | Section "ServerLayout" | ||
28 | Identifier "Builtin Default Layout" | ||
29 | Screen "Builtin Default fbdev Screen 0" | ||
30 | EndSection | ||
31 | |||
32 | Section "ServerFlags" | ||
33 | Option "DontZap" "0" | ||
34 | EndSection | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend b/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend new file mode 100644 index 0000000000..30830031ed --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend | |||
@@ -0,0 +1,2 @@ | |||
1 | # yocto-bsp-filename {{ if xserver == "y": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files.noinstall b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files.noinstall new file mode 100644 index 0000000000..1e0d92c55c --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files.noinstall | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-non_hardware.cfg b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-non_hardware.cfg new file mode 100644 index 0000000000..9bfc90c6f2 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-non_hardware.cfg | |||
@@ -0,0 +1,31 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-non_hardware.cfg | ||
2 | # | ||
3 | # Miscellaneous filesystems | ||
4 | # | ||
5 | CONFIG_NFS_DEF_FILE_IO_SIZE=1024 | ||
6 | |||
7 | # | ||
8 | # Multiple Device Support | ||
9 | # | ||
10 | # CONFIG_MD is not set | ||
11 | |||
12 | # Kernel Features | ||
13 | # | ||
14 | CONFIG_NO_HZ=y | ||
15 | |||
16 | # | ||
17 | # CPUIdle | ||
18 | # | ||
19 | CONFIG_CPU_IDLE=y | ||
20 | CONFIG_CPU_IDLE_GOV_LADDER=y | ||
21 | CONFIG_CPU_IDLE_GOV_MENU=y | ||
22 | |||
23 | # | ||
24 | # Kernel hacking | ||
25 | # | ||
26 | CONFIG_DEBUG_FS=y | ||
27 | |||
28 | # | ||
29 | # Power management options | ||
30 | # | ||
31 | CONFIG_PM_DEBUG=y | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-preempt-rt.scc b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-preempt-rt.scc new file mode 100644 index 0000000000..ca5f3b5be9 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-preempt-rt.scc | |||
@@ -0,0 +1,14 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-preempt-rt.scc | ||
2 | define KMACHINE {{=machine}} | ||
3 | define KTYPE preempt-rt | ||
4 | define KARCH arm | ||
5 | |||
6 | include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} | ||
7 | {{ if need_new_kbranch == "y": }} | ||
8 | branch {{=machine}} | ||
9 | |||
10 | include {{=machine}}.scc | ||
11 | |||
12 | # default policy for preempt-rt kernels | ||
13 | include features/latencytop/latencytop.scc | ||
14 | include features/profiling/profiling.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-standard.scc b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-standard.scc new file mode 100644 index 0000000000..9014c2c97e --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-standard.scc | |||
@@ -0,0 +1,14 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-standard.scc | ||
2 | define KMACHINE {{=machine}} | ||
3 | define KTYPE standard | ||
4 | define KARCH arm | ||
5 | |||
6 | include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} | ||
7 | {{ if need_new_kbranch == "y": }} | ||
8 | branch {{=machine}} | ||
9 | |||
10 | include {{=machine}}.scc | ||
11 | |||
12 | # default policy for standard kernels | ||
13 | include features/latencytop/latencytop.scc | ||
14 | include features/profiling/profiling.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-tiny.scc b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-tiny.scc new file mode 100644 index 0000000000..3f1c252232 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-tiny.scc | |||
@@ -0,0 +1,10 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-tiny.scc | ||
2 | define KMACHINE {{=machine}} | ||
3 | define KTYPE tiny | ||
4 | define KARCH arm | ||
5 | |||
6 | include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} | ||
7 | {{ if need_new_kbranch == "y": }} | ||
8 | branch {{=machine}} | ||
9 | |||
10 | include {{=machine}}.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-config.cfg new file mode 100644 index 0000000000..47489e44e9 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-config.cfg | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{=machine}}-user-config.cfg | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-features.scc b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-features.scc new file mode 100644 index 0000000000..582759e612 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-features.scc | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{=machine}}-user-features.scc | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-patches.scc new file mode 100644 index 0000000000..97f747fa07 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-patches.scc | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{=machine}}-user-patches.scc | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine.cfg b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine.cfg new file mode 100644 index 0000000000..a2e1ae0f75 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine.cfg | |||
@@ -0,0 +1,321 @@ | |||
1 | # yocto-bsp-filename {{=machine}}.cfg | ||
2 | # | ||
3 | # System Type | ||
4 | # | ||
5 | CONFIG_ARCH_OMAP=y | ||
6 | |||
7 | # | ||
8 | # TI OMAP Implementations | ||
9 | # | ||
10 | # CONFIG_ARCH_OMAP2 is not set | ||
11 | CONFIG_ARCH_OMAP3=y | ||
12 | |||
13 | # | ||
14 | # TI OMAP Common Features | ||
15 | # | ||
16 | CONFIG_ARCH_OMAP2PLUS=y | ||
17 | |||
18 | # | ||
19 | # OMAP Feature Selections | ||
20 | # | ||
21 | CONFIG_OMAP_32K_TIMER=y | ||
22 | CONFIG_OMAP_32K_TIMER_HZ=128 | ||
23 | CONFIG_OMAP_DM_TIMER=y | ||
24 | CONFIG_OMAP_RESET_CLOCKS=y | ||
25 | CONFIG_OMAP_SMARTREFLEX=y | ||
26 | CONFIG_OMAP_SMARTREFLEX_CLASS3=y | ||
27 | CONFIG_OMAP_MBOX_FWK=m | ||
28 | CONFIG_OMAP_MBOX_KFIFO_SIZE=256 | ||
29 | |||
30 | # | ||
31 | # OMAP Board Type | ||
32 | # | ||
33 | CONFIG_MACH_OMAP3_BEAGLE=y | ||
34 | |||
35 | # | ||
36 | # Processor Features | ||
37 | # | ||
38 | CONFIG_ARM_THUMBEE=y | ||
39 | CONFIG_ARM_ERRATA_430973=y | ||
40 | |||
41 | # | ||
42 | # Kernel Features | ||
43 | # | ||
44 | CONFIG_LEDS=y | ||
45 | |||
46 | |||
47 | # | ||
48 | # Serial drivers | ||
49 | # | ||
50 | CONFIG_SERIAL_OMAP=y | ||
51 | CONFIG_SERIAL_OMAP_CONSOLE=y | ||
52 | |||
53 | # | ||
54 | # At least one emulation must be selected | ||
55 | # | ||
56 | CONFIG_VFP=y | ||
57 | CONFIG_NEON=y | ||
58 | |||
59 | # | ||
60 | # Power management options | ||
61 | # | ||
62 | CONFIG_PM=y | ||
63 | CONFIG_PM_RUNTIME=y | ||
64 | |||
65 | # | ||
66 | # Generic Driver Options | ||
67 | # | ||
68 | CONFIG_MTD=y | ||
69 | CONFIG_MTD_CMDLINE_PARTS=y | ||
70 | # | ||
71 | # User Modules And Translation Layers | ||
72 | # | ||
73 | CONFIG_MTD_BLKDEVS=y | ||
74 | CONFIG_MTD_BLOCK=y | ||
75 | |||
76 | # | ||
77 | # RAM/ROM/Flash chip drivers | ||
78 | # | ||
79 | CONFIG_MTD_CFI=y | ||
80 | CONFIG_MTD_CFI_INTELEXT=y | ||
81 | |||
82 | # | ||
83 | # Disk-On-Chip Device Drivers | ||
84 | # | ||
85 | CONFIG_MTD_NAND=y | ||
86 | |||
87 | CONFIG_MTD_NAND_OMAP2=y | ||
88 | |||
89 | CONFIG_MTD_UBI=y | ||
90 | |||
91 | # | ||
92 | # SCSI device support | ||
93 | # | ||
94 | CONFIG_SCSI=y | ||
95 | |||
96 | # | ||
97 | # SCSI support type (disk, tape, CD-ROM) | ||
98 | # | ||
99 | CONFIG_BLK_DEV_SD=y | ||
100 | |||
101 | # | ||
102 | # Ethernet (10 or 100Mbit) | ||
103 | # | ||
104 | CONFIG_SMSC911X=y | ||
105 | CONFIG_USB_NET_SMSC95XX=y | ||
106 | |||
107 | # | ||
108 | # Userland interfaces | ||
109 | # | ||
110 | CONFIG_INPUT_EVDEV=y | ||
111 | |||
112 | # | ||
113 | # Input Device Drivers | ||
114 | # | ||
115 | CONFIG_KEYBOARD_TWL4030=y | ||
116 | CONFIG_INPUT_TOUCHSCREEN=y | ||
117 | CONFIG_TOUCHSCREEN_ADS7846=y | ||
118 | |||
119 | # | ||
120 | # Miscellaneous I2C Chip support | ||
121 | # | ||
122 | CONFIG_I2C=y | ||
123 | CONFIG_I2C_OMAP=y | ||
124 | CONFIG_SPI=y | ||
125 | CONFIG_SPI_MASTER=y | ||
126 | CONFIG_SPI_OMAP24XX=y | ||
127 | |||
128 | # | ||
129 | # I2C GPIO expanders: | ||
130 | # | ||
131 | CONFIG_GPIO_TWL4030=y | ||
132 | |||
133 | # | ||
134 | # SPI GPIO expanders: | ||
135 | # | ||
136 | CONFIG_OMAP_WATCHDOG=y | ||
137 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
138 | |||
139 | # | ||
140 | # Multifunction device drivers | ||
141 | # | ||
142 | CONFIG_TWL4030_CORE=y | ||
143 | CONFIG_REGULATOR=y | ||
144 | CONFIG_REGULATOR_DUMMY=y | ||
145 | CONFIG_REGULATOR_TWL4030=y | ||
146 | |||
147 | # | ||
148 | # Graphics support | ||
149 | # | ||
150 | CONFIG_FB=y | ||
151 | CONFIG_DRM=m | ||
152 | # CONFIG_VGASTATE is not set | ||
153 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | ||
154 | # CONFIG_FIRMWARE_EDID is not set | ||
155 | # CONFIG_FB_DDC is not set | ||
156 | # CONFIG_FB_BOOT_VESA_SUPPORT is not set | ||
157 | CONFIG_FB_CFB_FILLRECT=y | ||
158 | CONFIG_FB_CFB_COPYAREA=y | ||
159 | CONFIG_FB_CFB_IMAGEBLIT=y | ||
160 | # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set | ||
161 | # CONFIG_FB_SYS_FILLRECT is not set | ||
162 | # CONFIG_FB_SYS_COPYAREA is not set | ||
163 | # CONFIG_FB_SYS_IMAGEBLIT is not set | ||
164 | # CONFIG_FB_FOREIGN_ENDIAN is not set | ||
165 | # CONFIG_FB_SYS_FOPS is not set | ||
166 | # CONFIG_FB_SVGALIB is not set | ||
167 | # CONFIG_FB_MACMODES is not set | ||
168 | # CONFIG_FB_BACKLIGHT is not set | ||
169 | CONFIG_FB_MODE_HELPERS=y | ||
170 | # CONFIG_FB_TILEBLITTING is not set | ||
171 | |||
172 | # | ||
173 | # Frame buffer hardware drivers | ||
174 | # | ||
175 | # CONFIG_FB_S1D13XXX is not set | ||
176 | # CONFIG_FB_TMIO is not set | ||
177 | # CONFIG_FB_VIRTUAL is not set | ||
178 | # CONFIG_FB_METRONOME is not set | ||
179 | # CONFIG_FB_MB862XX is not set | ||
180 | # CONFIG_FB_BROADSHEET is not set | ||
181 | # CONFIG_FB_OMAP_BOOTLOADER_INIT is not set | ||
182 | CONFIG_OMAP2_VRAM=y | ||
183 | CONFIG_OMAP2_VRFB=y | ||
184 | CONFIG_OMAP2_DSS=y | ||
185 | CONFIG_OMAP2_VRAM_SIZE=14 | ||
186 | CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y | ||
187 | # CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS is not set | ||
188 | CONFIG_OMAP2_DSS_DPI=y | ||
189 | # CONFIG_OMAP2_DSS_RFBI is not set | ||
190 | CONFIG_OMAP2_DSS_VENC=y | ||
191 | # CONFIG_OMAP2_DSS_SDI is not set | ||
192 | CONFIG_OMAP2_DSS_DSI=y | ||
193 | # CONFIG_OMAP2_DSS_FAKE_VSYNC is not set | ||
194 | CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0 | ||
195 | CONFIG_FB_OMAP2=y | ||
196 | CONFIG_FB_OMAP2_DEBUG_SUPPORT=y | ||
197 | CONFIG_FB_OMAP2_NUM_FBS=2 | ||
198 | |||
199 | # | ||
200 | # OMAP2/3 Display Device Drivers | ||
201 | # | ||
202 | CONFIG_PANEL_GENERIC_DPI=y | ||
203 | CONFIG_PANEL_DVI=y | ||
204 | CONFIG_PANEL_SHARP_LS037V7DW01=y | ||
205 | # CONFIG_PANEL_LGPHILIPS_LB035Q02 is not set | ||
206 | # CONFIG_PANEL_TAAL is not set | ||
207 | CONFIG_PANEL_TPO_TD043MTEA1=m | ||
208 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
209 | CONFIG_BACKLIGHT_CLASS_DEVICE=y | ||
210 | |||
211 | # | ||
212 | # Display device support | ||
213 | # | ||
214 | CONFIG_DISPLAY_SUPPORT=y | ||
215 | CONFIG_DUMMY_CONSOLE=y | ||
216 | # CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set | ||
217 | CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y | ||
218 | # CONFIG_FONTS is not set | ||
219 | CONFIG_FONT_8x8=y | ||
220 | CONFIG_FONT_8x16=y | ||
221 | # CONFIG_LOGO_LINUX_MONO is not set | ||
222 | # CONFIG_LOGO_LINUX_VGA16 is not set | ||
223 | |||
224 | # | ||
225 | # Console display driver support | ||
226 | # | ||
227 | CONFIG_FRAMEBUFFER_CONSOLE=y | ||
228 | CONFIG_LOGO=y | ||
229 | # CONFIG_VGA_CONSOLE is not set | ||
230 | |||
231 | # DMA Devices | ||
232 | CONFIG_DMADEVICES=y | ||
233 | CONFIG_DMA_OMAP=y | ||
234 | CONFIG_DMA_OF=y | ||
235 | |||
236 | CONFIG_SOUND=y | ||
237 | CONFIG_SND=y | ||
238 | CONFIG_SND_SOC=y | ||
239 | CONFIG_SND_OMAP_SOC=y | ||
240 | CONFIG_SND_OMAP_SOC_OMAP_TWL4030=y | ||
241 | |||
242 | # | ||
243 | # USB Input Devices | ||
244 | # | ||
245 | CONFIG_USB=y | ||
246 | CONFIG_USB_SUPPORT=y | ||
247 | |||
248 | # | ||
249 | # Miscellaneous USB options | ||
250 | # | ||
251 | CONFIG_USB_OTG=y | ||
252 | # CONFIG_USB_OTG_WHITELIST is not set | ||
253 | |||
254 | # | ||
255 | # USB Host Controller Drivers | ||
256 | # | ||
257 | CONFIG_USB_EHCI_HCD=y | ||
258 | CONFIG_USB_EHCI_TT_NEWSCHED=y | ||
259 | CONFIG_USB_EHCI_ROOT_HUB_TT=y | ||
260 | CONFIG_USB_MUSB_HDRC=y | ||
261 | CONFIG_USB_MUSB_OMAP2PLUS=y | ||
262 | CONFIG_USB_OMAP=y | ||
263 | |||
264 | # | ||
265 | # OMAP 343x high speed USB support | ||
266 | # | ||
267 | CONFIG_USB_MUSB_OTG=y | ||
268 | CONFIG_USB_GADGET_MUSB_HDRC=y | ||
269 | CONFIG_USB_MUSB_HDRC_HCD=y | ||
270 | CONFIG_USB_INVENTRA_DMA=y | ||
271 | |||
272 | # | ||
273 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' | ||
274 | # | ||
275 | |||
276 | # | ||
277 | # may also be needed; see USB_STORAGE Help for more information | ||
278 | # | ||
279 | CONFIG_USB_STORAGE=y | ||
280 | |||
281 | # | ||
282 | # USB Miscellaneous drivers | ||
283 | # | ||
284 | CONFIG_USB_GADGET=y | ||
285 | CONFIG_USB_GADGET_DUALSPEED=y | ||
286 | CONFIG_USB_OTG_UTILS=y | ||
287 | CONFIG_TWL4030_USB=y | ||
288 | |||
289 | # USB gadget modules | ||
290 | CONFIG_USB_G_NCM=y | ||
291 | CONFIG_USB_MASS_STORAGE=y | ||
292 | |||
293 | CONFIG_MMC=y | ||
294 | |||
295 | # | ||
296 | # MMC/SD Host Controller Drivers | ||
297 | # | ||
298 | CONFIG_MMC_OMAP_HS=y | ||
299 | |||
300 | # | ||
301 | # Real Time Clock | ||
302 | # | ||
303 | CONFIG_RTC_LIB=y | ||
304 | CONFIG_RTC_CLASS=y | ||
305 | CONFIG_RTC_DRV_TWL4030=y | ||
306 | |||
307 | # | ||
308 | # DOS/FAT/NT Filesystems | ||
309 | # | ||
310 | CONFIG_VFAT_FS=y | ||
311 | |||
312 | # | ||
313 | # Multimedia core support | ||
314 | # | ||
315 | |||
316 | # CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set | ||
317 | |||
318 | # | ||
319 | # Advanced Power Management Emulation support | ||
320 | # | ||
321 | CONFIG_APM_EMULATION=y | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine.scc b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine.scc new file mode 100644 index 0000000000..828400df40 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine.scc | |||
@@ -0,0 +1,8 @@ | |||
1 | # yocto-bsp-filename {{=machine}}.scc | ||
2 | kconf hardware {{=machine}}.cfg | ||
3 | kconf non-hardware {{machine}}-non_hardware.cfg | ||
4 | |||
5 | include features/usb-net/usb-net.scc | ||
6 | |||
7 | kconf hardware {{=machine}}-user-config.cfg | ||
8 | include {{=machine}}-user-patches.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall new file mode 100644 index 0000000000..a04e6c7852 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall | |||
@@ -0,0 +1,5 @@ | |||
1 | {{ if kernel_choice != "custom": }} | ||
2 | {{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.14) kernel? (y/n)" default:"y"}} | ||
3 | |||
4 | {{ if kernel_choice != "custom" and use_default_kernel == "n": }} | ||
5 | {{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.14"}} | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-dev.bbappend b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-dev.bbappend new file mode 100644 index 0000000000..2fa6231cbf --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-dev.bbappend | |||
@@ -0,0 +1,26 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
8 | |||
9 | {{ if need_new_kbranch == "y": }} | ||
10 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
11 | |||
12 | {{ if need_new_kbranch == "n": }} | ||
13 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
14 | |||
15 | {{ if need_new_kbranch == "n": }} | ||
16 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
17 | |||
18 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}} | ||
19 | {{ if smp == "y": }} | ||
20 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
21 | |||
22 | SRC_URI += "file://{{=machine}}-standard.scc \ | ||
23 | file://{{=machine}}-user-config.cfg \ | ||
24 | file://{{=machine}}-user-patches.scc \ | ||
25 | file://{{=machine}}-user-features.scc \ | ||
26 | " | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend new file mode 100644 index 0000000000..35b0958582 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.10": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-preempt-rt.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb" | ||
32 | #SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f" | ||
33 | #LINUX_VERSION = "3.10.9" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend new file mode 100644 index 0000000000..f04dd0cce4 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.10": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-tiny.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" | ||
32 | #SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" | ||
33 | #LINUX_VERSION = "3.10.9" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend new file mode 100644 index 0000000000..471ccbcc3e --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.14": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-tiny.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" | ||
32 | #SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" | ||
33 | #LINUX_VERSION = "3.14" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.10.bbappend new file mode 100644 index 0000000000..badb3aa239 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.10.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.10": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-standard.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "19f7e43b54aef08d58135ed2a897d77b624b320a" | ||
32 | #SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "459165c1dd61c4e843c36e6a1abeb30949a20ba7" | ||
33 | #LINUX_VERSION = "3.10.9" \ No newline at end of file | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.14.bbappend new file mode 100644 index 0000000000..1e1cc51315 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.14.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.14": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-standard.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" | ||
32 | #SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" | ||
33 | #LINUX_VERSION = "3.14" \ No newline at end of file | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/common/COPYING.MIT b/scripts/lib/bsp/substrate/target/arch/common/COPYING.MIT new file mode 100644 index 0000000000..fb950dc69f --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/common/COPYING.MIT | |||
@@ -0,0 +1,17 @@ | |||
1 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
2 | of this software and associated documentation files (the "Software"), to deal | ||
3 | in the Software without restriction, including without limitation the rights | ||
4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
5 | copies of the Software, and to permit persons to whom the Software is | ||
6 | furnished to do so, subject to the following conditions: | ||
7 | |||
8 | The above copyright notice and this permission notice shall be included in | ||
9 | all copies or substantial portions of the Software. | ||
10 | |||
11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
17 | THE SOFTWARE. | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/common/README b/scripts/lib/bsp/substrate/target/arch/common/README new file mode 100644 index 0000000000..928659f302 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/common/README | |||
@@ -0,0 +1,118 @@ | |||
1 | This README file contains information on building the meta-{{=machine}} | ||
2 | BSP layer, and booting the images contained in the /binary directory. | ||
3 | Please see the corresponding sections below for details. | ||
4 | |||
5 | |||
6 | Dependencies | ||
7 | ============ | ||
8 | |||
9 | This layer depends on: | ||
10 | |||
11 | URI: git://git.openembedded.org/bitbake | ||
12 | branch: master | ||
13 | |||
14 | URI: git://git.openembedded.org/openembedded-core | ||
15 | layers: meta | ||
16 | branch: master | ||
17 | |||
18 | URI: git://git.yoctoproject.org/xxxx | ||
19 | layers: xxxx | ||
20 | branch: master | ||
21 | |||
22 | |||
23 | Patches | ||
24 | ======= | ||
25 | |||
26 | Please submit any patches against this BSP to the Yocto mailing list | ||
27 | (yocto@yoctoproject.org) and cc: the maintainer: | ||
28 | |||
29 | Maintainer: XXX YYYYYY <xxx.yyyyyy@zzzzz.com> | ||
30 | |||
31 | Please see the meta-xxxx/MAINTAINERS file for more details. | ||
32 | |||
33 | |||
34 | Table of Contents | ||
35 | ================= | ||
36 | |||
37 | I. Building the meta-{{=machine}} BSP layer | ||
38 | II. Booting the images in /binary | ||
39 | |||
40 | |||
41 | I. Building the meta-{{=machine}} BSP layer | ||
42 | ======================================== | ||
43 | |||
44 | --- replace with specific instructions for your layer --- | ||
45 | |||
46 | In order to build an image with BSP support for a given release, you | ||
47 | need to download the corresponding BSP tarball from the 'Board Support | ||
48 | Package (BSP) Downloads' page of the Yocto Project website. | ||
49 | |||
50 | Having done that, and assuming you extracted the BSP tarball contents | ||
51 | at the top-level of your yocto build tree, you can build a | ||
52 | {{=machine}} image by adding the location of the meta-{{=machine}} | ||
53 | layer to bblayers.conf, along with any other layers needed (to access | ||
54 | common metadata shared between BSPs) e.g.: | ||
55 | |||
56 | yocto/meta-xxxx \ | ||
57 | yocto/meta-xxxx/meta-{{=machine}} \ | ||
58 | |||
59 | To enable the {{=machine}} layer, add the {{=machine}} MACHINE to local.conf: | ||
60 | |||
61 | MACHINE ?= "{{=machine}}" | ||
62 | |||
63 | You should then be able to build a {{=machine}} image as such: | ||
64 | |||
65 | $ source oe-init-build-env | ||
66 | $ bitbake core-image-sato | ||
67 | |||
68 | At the end of a successful build, you should have a live image that | ||
69 | you can boot from a USB flash drive (see instructions on how to do | ||
70 | that below, in the section 'Booting the images from /binary'). | ||
71 | |||
72 | As an alternative to downloading the BSP tarball, you can also work | ||
73 | directly from the meta-xxxx git repository. For each BSP in the | ||
74 | 'meta-xxxx' repository, there are multiple branches, one corresponding | ||
75 | to each major release starting with 'laverne' (0.90), in addition to | ||
76 | the latest code which tracks the current master (note that not all | ||
77 | BSPs are present in every release). Instead of extracting a BSP | ||
78 | tarball at the top level of your yocto build tree, you can | ||
79 | equivalently check out the appropriate branch from the meta-xxxx | ||
80 | repository at the same location. | ||
81 | |||
82 | |||
83 | II. Booting the images in /binary | ||
84 | ================================= | ||
85 | |||
86 | --- replace with specific instructions for your platform --- | ||
87 | |||
88 | This BSP contains bootable live images, which can be used to directly | ||
89 | boot Yocto off of a USB flash drive. | ||
90 | |||
91 | Under Linux, insert a USB flash drive. Assuming the USB flash drive | ||
92 | takes device /dev/sdf, use dd to copy the live image to it. For | ||
93 | example: | ||
94 | |||
95 | # dd if=core-image-sato-{{=machine}}-20101207053738.hddimg of=/dev/sdf | ||
96 | # sync | ||
97 | # eject /dev/sdf | ||
98 | |||
99 | This should give you a bootable USB flash device. Insert the device | ||
100 | into a bootable USB socket on the target, and power on. This should | ||
101 | result in a system booted to the Sato graphical desktop. | ||
102 | |||
103 | If you want a terminal, use the arrows at the top of the UI to move to | ||
104 | different pages of available applications, one of which is named | ||
105 | 'Terminal'. Clicking that should give you a root terminal. | ||
106 | |||
107 | If you want to ssh into the system, you can use the root terminal to | ||
108 | ifconfig the IP address and use that to ssh in. The root password is | ||
109 | empty, so to log in type 'root' for the user name and hit 'Enter' at | ||
110 | the Password prompt: and you should be in. | ||
111 | |||
112 | ---- | ||
113 | |||
114 | If you find you're getting corrupt images on the USB (it doesn't show | ||
115 | the syslinux boot: prompt, or the boot: prompt contains strange | ||
116 | characters), try doing this first: | ||
117 | |||
118 | # dd if=/dev/zero of=/dev/sdf bs=1M count=512 | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/common/README.sources b/scripts/lib/bsp/substrate/target/arch/common/README.sources new file mode 100644 index 0000000000..3c4cb7b435 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/common/README.sources | |||
@@ -0,0 +1,17 @@ | |||
1 | The sources for the packages comprising the images shipped with this | ||
2 | BSP can be found at the following location: | ||
3 | |||
4 | http://downloads.yoctoproject.org/mirror/sources/ | ||
5 | |||
6 | The metadata used to generate the images shipped with this BSP, in | ||
7 | addition to the code contained in this BSP, can be found at the | ||
8 | following location: | ||
9 | |||
10 | http://www.yoctoproject.org/downloads/yocto-1.1/poky-edison-6.0.tar.bz2 | ||
11 | |||
12 | The metadata used to generate the images shipped with this BSP, in | ||
13 | addition to the code contained in this BSP, can also be found at the | ||
14 | following locations: | ||
15 | |||
16 | git://git.yoctoproject.org/poky.git | ||
17 | git://git.yoctoproject.org/meta-xxxx | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/common/binary/.gitignore b/scripts/lib/bsp/substrate/target/arch/common/binary/.gitignore new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/common/binary/.gitignore | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/common/conf/layer.conf b/scripts/lib/bsp/substrate/target/arch/common/conf/layer.conf new file mode 100644 index 0000000000..5529f45954 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/common/conf/layer.conf | |||
@@ -0,0 +1,10 @@ | |||
1 | # We have a conf and classes directory, add to BBPATH | ||
2 | BBPATH .= ":${LAYERDIR}" | ||
3 | |||
4 | # We have a recipes-* directories, add to BBFILES | ||
5 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ | ||
6 | ${LAYERDIR}/recipes-*/*/*.bbappend" | ||
7 | |||
8 | BBFILE_COLLECTIONS += "{{=machine}}" | ||
9 | BBFILE_PATTERN_{{=machine}} = "^${LAYERDIR}/" | ||
10 | BBFILE_PRIORITY_{{=machine}} = "6" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/machine.noinstall b/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/machine.noinstall new file mode 100644 index 0000000000..b442d02d57 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/machine.noinstall | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-dirname {{=machine}} | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/machine/machconfig b/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/machine/machconfig new file mode 100644 index 0000000000..3b85d3821f --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/machine/machconfig | |||
@@ -0,0 +1,5 @@ | |||
1 | # Assume a USB mouse and keyboard are connected | ||
2 | {{ input type:"boolean" name:"touchscreen" msg:"Does your BSP have a touchscreen? (y/n)" default:"n" }} | ||
3 | HAVE_TOUCHSCREEN={{=touchscreen}} | ||
4 | {{ input type:"boolean" name:"keyboard" msg:"Does your BSP have a keyboard? (y/n)" default:"y" }} | ||
5 | HAVE_KEYBOARD={{=keyboard}} | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor_0.0.bbappend b/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor_0.0.bbappend new file mode 100644 index 0000000000..6d4804d127 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor_0.0.bbappend | |||
@@ -0,0 +1,2 @@ | |||
1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
2 | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/kernel-list.noinstall new file mode 100644 index 0000000000..03b7d84ec2 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/kernel-list.noinstall | |||
@@ -0,0 +1,26 @@ | |||
1 | {{ if kernel_choice == "custom": }} | ||
2 | {{ input type:"boolean" name:"custom_kernel_remote" prio:"20" msg:"Is the custom kernel you'd like to use in a remote git repo? (y/n)" default:"y"}} | ||
3 | |||
4 | {{ if kernel_choice == "custom" and custom_kernel_remote == "y": }} | ||
5 | {{ input type:"edit-git-repo" name:"custom_kernel_remote_path" prio:"20" msg:"Please enter the full URI to the remote git repo (the default corresponds to linux-stable v3.13.9)" default:"git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git"}} | ||
6 | |||
7 | {{ if kernel_choice == "custom" and custom_kernel_remote == "n": }} | ||
8 | {{ input type:"edit-git-repo" name:"custom_kernel_local_path" prio:"20" msg:"You've indicated that you're not using a remote git repo. Please enter the full path to the local git repo you want to use (the default assumes a local linux-stable v3.13.9)" default:"/home/trz/yocto/kernels/linux-stable.git"}} | ||
9 | |||
10 | {{ if kernel_choice == "custom": }} | ||
11 | {{ input type:"boolean" name:"custom_kernel_need_kbranch" prio:"20" msg:"Do you need to use a specific (non-master) branch? (y/n)" default:"n"}} | ||
12 | |||
13 | {{ if kernel_choice == "custom" and custom_kernel_need_kbranch == "y": }} | ||
14 | {{ input type:"edit" name:"custom_kernel_kbranch" prio:"20" msg:"Please enter the branch you want to use (the default branch corresponds to the linux-stable 'linux-3.13.y' branch):" default:"linux-3.13.y"}} | ||
15 | |||
16 | {{ if kernel_choice == "custom": }} | ||
17 | {{ input type:"edit" name:"custom_kernel_srcrev" prio:"20" msg:"Please enter the SRCREV (commit id) you'd like to use (use '${AUTOREV}' to track the current HEAD):" default:"${AUTOREV}"}} | ||
18 | |||
19 | {{ if kernel_choice == "custom": }} | ||
20 | {{ input type:"edit" name:"custom_kernel_linux_version" prio:"20" msg:"Please enter the Linux version of the kernel you've specified:" default:"3.13.9"}} | ||
21 | |||
22 | {{ if kernel_choice == "custom": }} | ||
23 | {{ input type:"edit" name:"custom_kernel_linux_version_extension" prio:"20" msg:"Please enter a Linux version extension if you want (it will show up at the end of the kernel name shown by uname):" default:"-custom"}} | ||
24 | |||
25 | {{ if kernel_choice == "custom": }} | ||
26 | {{ input type:"edit-file" name:"custom_kernel_defconfig" prio:"20" msg:"It's recommended (but not required) that custom kernels be built using a defconfig. Please enter the full path to the defconfig for your kernel (NOTE: if you don't specify a defconfig the kernel probably won't build or boot):" default:""}} | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom.bb b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom.bb new file mode 100644 index 0000000000..80a52e7cae --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom.bb | |||
@@ -0,0 +1,58 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "custom": }} this | ||
2 | # This file was derived from the linux-yocto-custom.bb recipe in | ||
3 | # oe-core. | ||
4 | # | ||
5 | # linux-yocto-custom.bb: | ||
6 | # | ||
7 | # A yocto-bsp-generated kernel recipe that uses the linux-yocto and | ||
8 | # oe-core kernel classes to apply a subset of yocto kernel | ||
9 | # management to git managed kernel repositories. | ||
10 | # | ||
11 | # Warning: | ||
12 | # | ||
13 | # Building this kernel without providing a defconfig or BSP | ||
14 | # configuration will result in build or boot errors. This is not a | ||
15 | # bug. | ||
16 | # | ||
17 | # Notes: | ||
18 | # | ||
19 | # patches: patches can be merged into to the source git tree itself, | ||
20 | # added via the SRC_URI, or controlled via a BSP | ||
21 | # configuration. | ||
22 | # | ||
23 | # example configuration addition: | ||
24 | # SRC_URI += "file://smp.cfg" | ||
25 | # example patch addition: | ||
26 | # SRC_URI += "file://0001-linux-version-tweak.patch | ||
27 | # example feature addition: | ||
28 | # SRC_URI += "file://feature.scc" | ||
29 | # | ||
30 | |||
31 | inherit kernel | ||
32 | require recipes-kernel/linux/linux-yocto.inc | ||
33 | |||
34 | {{ if kernel_choice == "custom" and custom_kernel_remote == "y": }} | ||
35 | SRC_URI = "{{=custom_kernel_remote_path}};protocol=git;bareclone=1;branch=${KBRANCH}" | ||
36 | {{ if kernel_choice == "custom" and custom_kernel_remote == "n": }} | ||
37 | SRC_URI = "git://{{=custom_kernel_local_path}};protocol=file;bareclone=1;branch=${KBRANCH}" | ||
38 | |||
39 | SRC_URI += "file://defconfig" | ||
40 | |||
41 | SRC_URI += "file://{{=machine}}.scc \ | ||
42 | file://{{=machine}}.cfg \ | ||
43 | file://{{=machine}}-user-config.cfg \ | ||
44 | file://{{=machine}}-user-patches.scc \ | ||
45 | " | ||
46 | |||
47 | {{ if kernel_choice == "custom" and custom_kernel_need_kbranch == "y" and custom_kernel_kbranch and custom_kernel_kbranch != "master": }} | ||
48 | KBRANCH = "{{=custom_kernel_kbranch}}" | ||
49 | |||
50 | LINUX_VERSION ?= "{{=custom_kernel_linux_version}}" | ||
51 | LINUX_VERSION_EXTENSION ?= "{{=custom_kernel_linux_version_extension}}" | ||
52 | |||
53 | SRCREV="{{=custom_kernel_srcrev}}" | ||
54 | |||
55 | PR = "r0" | ||
56 | PV = "${LINUX_VERSION}+git${SRCPV}" | ||
57 | |||
58 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom.noinstall b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom.noinstall new file mode 100644 index 0000000000..017d206c24 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom.noinstall | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-dirname {{ if kernel_choice == "custom": }} linux-yocto-custom | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/defconfig b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/defconfig new file mode 100644 index 0000000000..ceb0ffa30c --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/defconfig | |||
@@ -0,0 +1,5 @@ | |||
1 | # | ||
2 | # Placeholder for custom default kernel configuration. yocto-bsp will | ||
3 | # replace this file with a user-specified defconfig. | ||
4 | # | ||
5 | {{ if custom_kernel_defconfig: replace_file(of, custom_kernel_defconfig) }} | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine-user-config.cfg new file mode 100644 index 0000000000..922309d5ab --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine-user-config.cfg | |||
@@ -0,0 +1,9 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-user-config.cfg | ||
2 | # | ||
3 | # Used by yocto-kernel to manage config options. | ||
4 | # | ||
5 | # yocto-kernel may change the contents of this file in any | ||
6 | # way it sees fit, including removing comments like this, | ||
7 | # so don't manually make any modifications you don't want | ||
8 | # to lose. | ||
9 | # | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine-user-patches.scc new file mode 100644 index 0000000000..6d1138f42a --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine-user-patches.scc | |||
@@ -0,0 +1,9 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-user-patches.scc | ||
2 | # | ||
3 | # Used by yocto-kernel to manage patches. | ||
4 | # | ||
5 | # yocto-kernel may change the contents of this file in any | ||
6 | # way it sees fit, including removing comments like this, | ||
7 | # so don't manually make any modifications you don't want | ||
8 | # to lose. | ||
9 | # | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine.cfg b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine.cfg new file mode 100644 index 0000000000..1ba8201f16 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine.cfg | |||
@@ -0,0 +1,4 @@ | |||
1 | # yocto-bsp-filename {{=machine}}.cfg | ||
2 | # | ||
3 | # A convenient place to add config options, nothing more. | ||
4 | # | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine.scc b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine.scc new file mode 100644 index 0000000000..0b6b413377 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine.scc | |||
@@ -0,0 +1,18 @@ | |||
1 | # yocto-bsp-filename {{=machine}}.scc | ||
2 | # | ||
3 | # The top-level 'feature' for the {{=machine}} custom kernel. | ||
4 | # | ||
5 | # Essentially this is a convenient top-level container or starting | ||
6 | # point for adding lower-level config fragements and features. | ||
7 | # | ||
8 | |||
9 | # {{=machine}}.cfg in the linux-yocto-custom subdir is just a | ||
10 | # convenient place for adding random config fragments. | ||
11 | |||
12 | kconf hardware {{=machine}}.cfg | ||
13 | |||
14 | # These are used by yocto-kernel to add config fragments and features. | ||
15 | # Don't remove if you plan on using yocto-kernel with this BSP. | ||
16 | |||
17 | kconf hardware {{=machine}}-user-config.cfg | ||
18 | include {{=machine}}-user-patches.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/machine.conf b/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/machine.conf new file mode 100644 index 0000000000..43e38d06d0 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/machine.conf | |||
@@ -0,0 +1,67 @@ | |||
1 | # yocto-bsp-filename {{=machine}}.conf | ||
2 | #@TYPE: Machine | ||
3 | #@NAME: {{=machine}} | ||
4 | |||
5 | #@DESCRIPTION: Machine configuration for {{=machine}} systems | ||
6 | |||
7 | {{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }} | ||
8 | {{ if kernel_choice == "linux-yocto-dev": preferred_kernel = "linux-yocto-dev" }} | ||
9 | {{ if kernel_choice == "custom" or kernel_choice == "linux-yocto-dev" : }} | ||
10 | PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}" | ||
11 | |||
12 | {{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel = kernel_choice.split('_')[0] }} | ||
13 | {{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel_version = kernel_choice.split('_')[1] }} | ||
14 | {{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": }} | ||
15 | PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}" | ||
16 | PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%" | ||
17 | |||
18 | {{ input type:"choicelist" name:"tunefile" prio:"40" msg:"Which machine tuning would you like to use?" default:"tune_core2" }} | ||
19 | {{ input type:"choice" val:"tune_i586" msg:"i586 tuning optimizations" }} | ||
20 | {{ input type:"choice" val:"tune_atom" msg:"Atom tuning optimizations" }} | ||
21 | {{ input type:"choice" val:"tune_core2" msg:"Core2 tuning optimizations" }} | ||
22 | {{ if tunefile == "tune_i586": }} | ||
23 | require conf/machine/include/tune-i586.inc | ||
24 | {{ if tunefile == "tune_atom": }} | ||
25 | require conf/machine/include/tune-atom.inc | ||
26 | {{ if tunefile == "tune_core2": }} | ||
27 | DEFAULTTUNE="core2-32" | ||
28 | require conf/machine/include/tune-core2.inc | ||
29 | |||
30 | require conf/machine/include/x86-base.inc | ||
31 | |||
32 | MACHINE_FEATURES += "wifi efi pcbios" | ||
33 | |||
34 | {{ input type:"boolean" name:"xserver" prio:"50" msg:"Do you need support for X? (y/n)" default:"y" }} | ||
35 | |||
36 | {{ if xserver == "y" and (kernel_choice == "linux-yocto_3.14" or kernel_choice == "linux-yocto_3.10"): }} | ||
37 | {{ input type:"choicelist" name:"xserver_choice" prio:"50" msg:"Please select an xserver for this machine:" default:"xserver_i915" }} | ||
38 | {{ input type:"choice" val:"xserver_vesa" msg:"VESA xserver support" }} | ||
39 | {{ input type:"choice" val:"xserver_i915" msg:"i915 xserver support" }} | ||
40 | {{ input type:"choice" val:"xserver_i965" msg:"i965 xserver support" }} | ||
41 | |||
42 | {{ if xserver == "y" and kernel_choice == "custom": }} | ||
43 | {{ input type:"choicelist" name:"xserver_choice" prio:"50" msg:"Please select an xserver for this machine:" default:"xserver_i915" }} | ||
44 | {{ input type:"choice" val:"xserver_vesa" msg:"VESA xserver support" }} | ||
45 | {{ input type:"choice" val:"xserver_i915" msg:"i915 xserver support" }} | ||
46 | {{ input type:"choice" val:"xserver_i965" msg:"i965 xserver support" }} | ||
47 | |||
48 | {{ if xserver == "y" and kernel_choice != "linux-yocto_3.14" and kernel_choice != "linux-yocto_3.10" and kernel_choice != "custom": xserver_choice = "xserver_i915" }} | ||
49 | |||
50 | {{ if xserver == "y": }} | ||
51 | XSERVER ?= "${XSERVER_X86_BASE} \ | ||
52 | ${XSERVER_X86_EXT} \ | ||
53 | {{ if xserver == "y" and xserver_choice == "xserver_vesa": }} | ||
54 | ${XSERVER_X86_VESA} \ | ||
55 | {{ if xserver == "y" and xserver_choice == "xserver_i915": }} | ||
56 | ${XSERVER_X86_I915} \ | ||
57 | {{ if xserver == "y" and xserver_choice == "xserver_i965": }} | ||
58 | ${XSERVER_X86_I965} \ | ||
59 | {{ if xserver == "y": }} | ||
60 | " | ||
61 | |||
62 | MACHINE_EXTRA_RRECOMMENDS += "linux-firmware v86d" | ||
63 | |||
64 | EXTRA_OECONF_append_pn-matchbox-panel-2 = " --with-battery=acpi" | ||
65 | |||
66 | {{ if xserver == "y" and xserver_choice == "xserver_vesa": }} | ||
67 | APPEND += "video=vesafb vga=0x318" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall new file mode 100644 index 0000000000..b442d02d57 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-dirname {{=machine}} | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf new file mode 100644 index 0000000000..ac9a0f1bb0 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{ if xserver == "y": }} this | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend new file mode 100644 index 0000000000..30830031ed --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend | |||
@@ -0,0 +1,2 @@ | |||
1 | # yocto-bsp-filename {{ if xserver == "y": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files.noinstall b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files.noinstall new file mode 100644 index 0000000000..1e0d92c55c --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files.noinstall | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-preempt-rt.scc b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-preempt-rt.scc new file mode 100644 index 0000000000..619ee3f367 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-preempt-rt.scc | |||
@@ -0,0 +1,16 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-preempt-rt.scc | ||
2 | define KMACHINE {{=machine}} | ||
3 | define KTYPE preempt-rt | ||
4 | define KARCH i386 | ||
5 | |||
6 | include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} | ||
7 | {{ if need_new_kbranch == "y": }} | ||
8 | branch {{=machine}} | ||
9 | |||
10 | include {{=machine}}.scc | ||
11 | |||
12 | # default policy for preempt-rt kernels | ||
13 | include cfg/usb-mass-storage.scc | ||
14 | include cfg/boot-live.scc | ||
15 | include features/latencytop/latencytop.scc | ||
16 | include features/profiling/profiling.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-standard.scc b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-standard.scc new file mode 100644 index 0000000000..682012fafc --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-standard.scc | |||
@@ -0,0 +1,16 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-standard.scc | ||
2 | define KMACHINE {{=machine}} | ||
3 | define KTYPE standard | ||
4 | define KARCH i386 | ||
5 | |||
6 | include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} | ||
7 | {{ if need_new_kbranch == "y": }} | ||
8 | branch {{=machine}} | ||
9 | |||
10 | include {{=machine}}.scc | ||
11 | |||
12 | # default policy for standard kernels | ||
13 | include cfg/usb-mass-storage.scc | ||
14 | include cfg/boot-live.scc | ||
15 | include features/latencytop/latencytop.scc | ||
16 | include features/profiling/profiling.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-tiny.scc b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-tiny.scc new file mode 100644 index 0000000000..cc7519699a --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-tiny.scc | |||
@@ -0,0 +1,10 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-tiny.scc | ||
2 | define KMACHINE {{=machine}} | ||
3 | define KTYPE tiny | ||
4 | define KARCH i386 | ||
5 | |||
6 | include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} | ||
7 | {{ if need_new_kbranch == "y": }} | ||
8 | branch {{=machine}} | ||
9 | |||
10 | include {{=machine}}.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-config.cfg new file mode 100644 index 0000000000..69efdcc759 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-config.cfg | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{=machine}}-user-config.cfg \ No newline at end of file | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-features.scc b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-features.scc new file mode 100644 index 0000000000..85be26de97 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-features.scc | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{=machine}}-user-features.scc \ No newline at end of file | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-patches.scc new file mode 100644 index 0000000000..4c59daac46 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-patches.scc | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{=machine}}-user-patches.scc \ No newline at end of file | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.cfg b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.cfg new file mode 100644 index 0000000000..3b168b7e36 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.cfg | |||
@@ -0,0 +1,55 @@ | |||
1 | # yocto-bsp-filename {{=machine}}.cfg | ||
2 | CONFIG_X86_32=y | ||
3 | CONFIG_MATOM=y | ||
4 | CONFIG_PRINTK=y | ||
5 | |||
6 | # Basic hardware support for the box - network, USB, PCI, sound | ||
7 | CONFIG_NETDEVICES=y | ||
8 | CONFIG_ATA=y | ||
9 | CONFIG_ATA_GENERIC=y | ||
10 | CONFIG_ATA_SFF=y | ||
11 | CONFIG_PCI=y | ||
12 | CONFIG_MMC=y | ||
13 | CONFIG_MMC_SDHCI=y | ||
14 | CONFIG_USB_SUPPORT=y | ||
15 | CONFIG_USB=y | ||
16 | CONFIG_USB_ARCH_HAS_EHCI=y | ||
17 | CONFIG_R8169=y | ||
18 | CONFIG_PATA_SCH=y | ||
19 | CONFIG_MMC_SDHCI_PCI=y | ||
20 | CONFIG_USB_EHCI_HCD=y | ||
21 | CONFIG_PCIEPORTBUS=y | ||
22 | CONFIG_NET=y | ||
23 | CONFIG_USB_UHCI_HCD=y | ||
24 | CONFIG_USB_OHCI_HCD=y | ||
25 | CONFIG_BLK_DEV_SD=y | ||
26 | CONFIG_CHR_DEV_SG=y | ||
27 | CONFIG_SOUND=y | ||
28 | CONFIG_SND=y | ||
29 | CONFIG_SND_HDA_INTEL=y | ||
30 | CONFIG_SATA_AHCI=y | ||
31 | CONFIG_AGP=y | ||
32 | CONFIG_PM=y | ||
33 | CONFIG_ACPI=y | ||
34 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | ||
35 | CONFIG_BACKLIGHT_CLASS_DEVICE=y | ||
36 | CONFIG_INPUT=y | ||
37 | |||
38 | # Make sure these are on, otherwise the bootup won't be fun | ||
39 | CONFIG_EXT3_FS=y | ||
40 | CONFIG_UNIX=y | ||
41 | CONFIG_INET=y | ||
42 | CONFIG_MODULES=y | ||
43 | CONFIG_SHMEM=y | ||
44 | CONFIG_TMPFS=y | ||
45 | CONFIG_PACKET=y | ||
46 | |||
47 | # Needed for booting (and using) USB memory sticks | ||
48 | CONFIG_BLK_DEV_LOOP=y | ||
49 | CONFIG_NLS_CODEPAGE_437=y | ||
50 | CONFIG_NLS_ISO8859_1=y | ||
51 | |||
52 | CONFIG_RD_GZIP=y | ||
53 | |||
54 | # Needed for booting (and using) CD images | ||
55 | CONFIG_BLK_DEV_SR=y | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.scc b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.scc new file mode 100644 index 0000000000..3d32f111b0 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.scc | |||
@@ -0,0 +1,21 @@ | |||
1 | # yocto-bsp-filename {{=machine}}.scc | ||
2 | kconf hardware {{=machine}}.cfg | ||
3 | |||
4 | include features/intel-e1xxxx/intel-e100.scc | ||
5 | include features/intel-e1xxxx/intel-e1xxxx.scc | ||
6 | |||
7 | {{ if xserver == "y" and xserver_choice == "xserver_i915" or xserver_choice == "xserver_i965": }} | ||
8 | include features/i915/i915.scc | ||
9 | |||
10 | include features/serial/8250.scc | ||
11 | include features/ericsson-3g/f5521gw.scc | ||
12 | |||
13 | {{ if xserver == "y" and xserver_choice == "xserver_vesa": }} | ||
14 | include cfg/vesafb.scc | ||
15 | |||
16 | include cfg/usb-mass-storage.scc | ||
17 | include cfg/boot-live.scc | ||
18 | include features/power/intel.scc | ||
19 | |||
20 | kconf hardware {{=machine}}-user-config.cfg | ||
21 | include {{=machine}}-user-patches.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall new file mode 100644 index 0000000000..a04e6c7852 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall | |||
@@ -0,0 +1,5 @@ | |||
1 | {{ if kernel_choice != "custom": }} | ||
2 | {{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.14) kernel? (y/n)" default:"y"}} | ||
3 | |||
4 | {{ if kernel_choice != "custom" and use_default_kernel == "n": }} | ||
5 | {{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.14"}} | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-dev.bbappend b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-dev.bbappend new file mode 100644 index 0000000000..2fa6231cbf --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-dev.bbappend | |||
@@ -0,0 +1,26 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
8 | |||
9 | {{ if need_new_kbranch == "y": }} | ||
10 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
11 | |||
12 | {{ if need_new_kbranch == "n": }} | ||
13 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
14 | |||
15 | {{ if need_new_kbranch == "n": }} | ||
16 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
17 | |||
18 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}} | ||
19 | {{ if smp == "y": }} | ||
20 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
21 | |||
22 | SRC_URI += "file://{{=machine}}-standard.scc \ | ||
23 | file://{{=machine}}-user-config.cfg \ | ||
24 | file://{{=machine}}-user-patches.scc \ | ||
25 | file://{{=machine}}-user-features.scc \ | ||
26 | " | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend new file mode 100644 index 0000000000..35b0958582 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.10": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-preempt-rt.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb" | ||
32 | #SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f" | ||
33 | #LINUX_VERSION = "3.10.9" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend new file mode 100644 index 0000000000..f04dd0cce4 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.10": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-tiny.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" | ||
32 | #SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" | ||
33 | #LINUX_VERSION = "3.10.9" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend new file mode 100644 index 0000000000..471ccbcc3e --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.14": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-tiny.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" | ||
32 | #SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" | ||
33 | #LINUX_VERSION = "3.14" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.10.bbappend new file mode 100644 index 0000000000..1cfc611949 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.10.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.10": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-standard.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "19f7e43b54aef08d58135ed2a897d77b624b320a" | ||
32 | #SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "459165c1dd61c4e843c36e6a1abeb30949a20ba7" | ||
33 | #LINUX_VERSION = "3.10.9" \ No newline at end of file | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.14.bbappend new file mode 100644 index 0000000000..fbb49edb26 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.14.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.14": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-standard.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" | ||
32 | #SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" | ||
33 | #LINUX_VERSION = "3.14" \ No newline at end of file | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/layer/COPYING.MIT b/scripts/lib/bsp/substrate/target/arch/layer/COPYING.MIT new file mode 100644 index 0000000000..89de354795 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/layer/COPYING.MIT | |||
@@ -0,0 +1,17 @@ | |||
1 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
2 | of this software and associated documentation files (the "Software"), to deal | ||
3 | in the Software without restriction, including without limitation the rights | ||
4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
5 | copies of the Software, and to permit persons to whom the Software is | ||
6 | furnished to do so, subject to the following conditions: | ||
7 | |||
8 | The above copyright notice and this permission notice shall be included in | ||
9 | all copies or substantial portions of the Software. | ||
10 | |||
11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
17 | THE SOFTWARE. | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/layer/README b/scripts/lib/bsp/substrate/target/arch/layer/README new file mode 100644 index 0000000000..943dfc4412 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/layer/README | |||
@@ -0,0 +1,64 @@ | |||
1 | This README file contains information on the contents of the | ||
2 | {{=layer_name}} layer. | ||
3 | |||
4 | Please see the corresponding sections below for details. | ||
5 | |||
6 | |||
7 | Dependencies | ||
8 | ============ | ||
9 | |||
10 | This layer depends on: | ||
11 | |||
12 | URI: git://git.openembedded.org/bitbake | ||
13 | branch: master | ||
14 | |||
15 | URI: git://git.openembedded.org/openembedded-core | ||
16 | layers: meta | ||
17 | branch: master | ||
18 | |||
19 | URI: git://git.yoctoproject.org/xxxx | ||
20 | layers: xxxx | ||
21 | branch: master | ||
22 | |||
23 | |||
24 | Patches | ||
25 | ======= | ||
26 | |||
27 | Please submit any patches against the {{=layer_name}} layer to the | ||
28 | xxxx mailing list (xxxx@zzzz.org) and cc: the maintainer: | ||
29 | |||
30 | Maintainer: XXX YYYYYY <xxx.yyyyyy@zzzzz.com> | ||
31 | |||
32 | |||
33 | Table of Contents | ||
34 | ================= | ||
35 | |||
36 | I. Adding the {{=layer_name}} layer to your build | ||
37 | II. Misc | ||
38 | |||
39 | |||
40 | I. Adding the {{=layer_name}} layer to your build | ||
41 | ================================================= | ||
42 | |||
43 | --- replace with specific instructions for the {{=layer_name}} layer --- | ||
44 | |||
45 | In order to use this layer, you need to make the build system aware of | ||
46 | it. | ||
47 | |||
48 | Assuming the {{=layer_name}} layer exists at the top-level of your | ||
49 | yocto build tree, you can add it to the build system by adding the | ||
50 | location of the {{=layer_name}} layer to bblayers.conf, along with any | ||
51 | other layers needed. e.g.: | ||
52 | |||
53 | BBLAYERS ?= " \ | ||
54 | /path/to/yocto/meta \ | ||
55 | /path/to/yocto/meta-yocto \ | ||
56 | /path/to/yocto/meta-yocto-bsp \ | ||
57 | /path/to/yocto/meta-{{=layer_name}} \ | ||
58 | " | ||
59 | |||
60 | |||
61 | II. Misc | ||
62 | ======== | ||
63 | |||
64 | --- replace with specific information about the {{=layer_name}} layer --- | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/layer/conf/layer.conf b/scripts/lib/bsp/substrate/target/arch/layer/conf/layer.conf new file mode 100644 index 0000000000..bdffe17195 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/layer/conf/layer.conf | |||
@@ -0,0 +1,10 @@ | |||
1 | # We have a conf and classes directory, add to BBPATH | ||
2 | BBPATH .= ":${LAYERDIR}" | ||
3 | |||
4 | # We have recipes-* directories, add to BBFILES | ||
5 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ | ||
6 | ${LAYERDIR}/recipes-*/*/*.bbappend" | ||
7 | |||
8 | BBFILE_COLLECTIONS += "{{=layer_name}}" | ||
9 | BBFILE_PATTERN_{{=layer_name}} = "^${LAYERDIR}/" | ||
10 | BBFILE_PRIORITY_{{=layer_name}} = "{{=layer_priority}}" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall b/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall new file mode 100644 index 0000000000..e2a89c3b5d --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall | |||
@@ -0,0 +1,14 @@ | |||
1 | {{ input type:"edit" name:"layer_priority" prio:"20" msg:"Please enter the layer priority you'd like to use for the layer:" default:"6"}} | ||
2 | |||
3 | {{ input type:"boolean" name:"create_example_recipe" prio:"20" msg:"Would you like to have an example recipe created? (y/n)" default:"n"}} | ||
4 | |||
5 | {{ if create_example_recipe == "y": }} | ||
6 | {{ input type:"edit" name:"example_recipe_name" prio:"20" msg:"Please enter the name you'd like to use for your example recipe:" default:"example"}} | ||
7 | |||
8 | {{ input type:"boolean" name:"create_example_bbappend" prio:"20" msg:"Would you like to have an example bbappend file created? (y/n)" default:"n"}} | ||
9 | |||
10 | {{ if create_example_bbappend == "y": }} | ||
11 | {{ input type:"edit" name:"example_bbappend_name" prio:"20" msg:"Please enter the name you'd like to use for your bbappend file:" default:"example"}} | ||
12 | |||
13 | {{ if create_example_bbappend == "y": }} | ||
14 | {{ input type:"edit" name:"example_bbappend_version" prio:"20" msg:"Please enter the version number you'd like to use for your bbappend file (this should match the recipe you're appending to):" default:"0.1"}} | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend.noinstall b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend.noinstall new file mode 100644 index 0000000000..3594e6583c --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend.noinstall | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-dirname {{ if create_example_bbappend == "y": }} recipes-example-bbappend | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version.bbappend b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version.bbappend new file mode 100644 index 0000000000..353133080a --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version.bbappend | |||
@@ -0,0 +1,9 @@ | |||
1 | # yocto-bsp-filename {{=example_bbappend_name}}_{{=example_bbappend_version}}.bbappend | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" | ||
3 | |||
4 | # | ||
5 | # This .bbappend doesn't yet do anything - replace this text with | ||
6 | # modifications to the example_0.1.bb recipe, or whatever recipe it is | ||
7 | # that you want to modify with this .bbappend (make sure you change | ||
8 | # the recipe name (PN) and version (PV) to match). | ||
9 | # | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version.noinstall b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version.noinstall new file mode 100644 index 0000000000..46df8a8e04 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version.noinstall | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-dirname {{=example_bbappend_name}}-{{=example_bbappend_version}} | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version/example.patch b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version/example.patch new file mode 100644 index 0000000000..2000a34da5 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version/example.patch | |||
@@ -0,0 +1,12 @@ | |||
1 | # | ||
2 | # This is a non-functional placeholder file, here for example purposes | ||
3 | # only. | ||
4 | # | ||
5 | # If you had a patch for your recipe, you'd put it in this directory | ||
6 | # and reference it from your recipe's SRC_URI: | ||
7 | # | ||
8 | # SRC_URI += "file://example.patch" | ||
9 | # | ||
10 | # Note that you could also rename the directory containing this patch | ||
11 | # to remove the version number or simply rename it 'files'. Doing so | ||
12 | # allows you to use the same directory for multiple recipes. | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/layer/recipes-example.noinstall b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example.noinstall new file mode 100644 index 0000000000..b0069b1a5a --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example.noinstall | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-dirname {{ if create_example_recipe == "y": }} recipes-example | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.bb b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.bb new file mode 100644 index 0000000000..ba1ccb16c6 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.bb | |||
@@ -0,0 +1,24 @@ | |||
1 | # yocto-bsp-filename {{=example_recipe_name}}_0.1.bb | ||
2 | # | ||
3 | # This file was derived from the 'Hello World!' example recipe in the | ||
4 | # Yocto Project Development Manual. | ||
5 | # | ||
6 | |||
7 | DESCRIPTION = "Simple helloworld application" | ||
8 | SECTION = "examples" | ||
9 | LICENSE = "MIT" | ||
10 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
11 | PR = "r0" | ||
12 | |||
13 | SRC_URI = "file://helloworld.c" | ||
14 | |||
15 | S = "${WORKDIR}" | ||
16 | |||
17 | do_compile() { | ||
18 | ${CC} helloworld.c -o helloworld | ||
19 | } | ||
20 | |||
21 | do_install() { | ||
22 | install -d ${D}${bindir} | ||
23 | install -m 0755 helloworld ${D}${bindir} | ||
24 | } | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.noinstall b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.noinstall new file mode 100644 index 0000000000..c319c19c57 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.noinstall | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-dirname {{=example_recipe_name}}-0.1 | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1/example.patch b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1/example.patch new file mode 100644 index 0000000000..2000a34da5 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1/example.patch | |||
@@ -0,0 +1,12 @@ | |||
1 | # | ||
2 | # This is a non-functional placeholder file, here for example purposes | ||
3 | # only. | ||
4 | # | ||
5 | # If you had a patch for your recipe, you'd put it in this directory | ||
6 | # and reference it from your recipe's SRC_URI: | ||
7 | # | ||
8 | # SRC_URI += "file://example.patch" | ||
9 | # | ||
10 | # Note that you could also rename the directory containing this patch | ||
11 | # to remove the version number or simply rename it 'files'. Doing so | ||
12 | # allows you to use the same directory for multiple recipes. | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1/helloworld.c b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1/helloworld.c new file mode 100644 index 0000000000..71f2e46b4e --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1/helloworld.c | |||
@@ -0,0 +1,8 @@ | |||
1 | #include <stdio.h> | ||
2 | |||
3 | int main(int argc, char **argv) | ||
4 | { | ||
5 | printf("Hello World!\n"); | ||
6 | |||
7 | return 0; | ||
8 | } | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/.gitignore b/scripts/lib/bsp/substrate/target/arch/mips/.gitignore new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/.gitignore | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/machine.conf b/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/machine.conf new file mode 100644 index 0000000000..b319d626f4 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/machine.conf | |||
@@ -0,0 +1,39 @@ | |||
1 | # yocto-bsp-filename {{=machine}}.conf | ||
2 | #@TYPE: Machine | ||
3 | #@NAME: {{=machine}} | ||
4 | |||
5 | #@DESCRIPTION: Machine configuration for {{=machine}} systems | ||
6 | |||
7 | require conf/machine/include/tune-mips32.inc | ||
8 | |||
9 | MACHINE_FEATURES = "screen keyboard pci usbhost ext2 ext3 serial" | ||
10 | |||
11 | KERNEL_IMAGETYPE = "vmlinux" | ||
12 | KERNEL_ALT_IMAGETYPE = "vmlinux.bin" | ||
13 | KERNEL_IMAGE_STRIP_EXTRA_SECTIONS = ".comment" | ||
14 | |||
15 | {{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }} | ||
16 | {{ if kernel_choice == "linux-yocto-dev": preferred_kernel = "linux-yocto-dev" }} | ||
17 | {{ if kernel_choice == "custom" or kernel_choice == "linux-yocto-dev" : }} | ||
18 | PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}" | ||
19 | |||
20 | {{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel = kernel_choice.split('_')[0] }} | ||
21 | {{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel_version = kernel_choice.split('_')[1] }} | ||
22 | {{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": }} | ||
23 | PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}" | ||
24 | PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%" | ||
25 | |||
26 | {{ input type:"boolean" name:"xserver" prio:"50" msg:"Do you need support for X? (y/n)" default:"y" }} | ||
27 | {{ if xserver == "y": }} | ||
28 | PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg" | ||
29 | XSERVER ?= "xserver-xorg \ | ||
30 | xf86-input-evdev \ | ||
31 | xf86-video-fbdev" | ||
32 | |||
33 | SERIAL_CONSOLE = "115200 ttyS0" | ||
34 | USE_VT ?= "0" | ||
35 | |||
36 | MACHINE_EXTRA_RRECOMMENDS = " kernel-modules" | ||
37 | |||
38 | IMAGE_FSTYPES ?= "jffs2 tar.bz2" | ||
39 | JFFS2_ERASEBLOCK = "0x10000" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files.noinstall b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files.noinstall new file mode 100644 index 0000000000..1e0d92c55c --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files.noinstall | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-preempt-rt.scc b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-preempt-rt.scc new file mode 100644 index 0000000000..176190cd2e --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-preempt-rt.scc | |||
@@ -0,0 +1,10 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-preempt-rt.scc | ||
2 | define KMACHINE {{=machine}} | ||
3 | define KTYPE preempt-rt | ||
4 | define KARCH mips | ||
5 | |||
6 | include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} | ||
7 | {{ if need_new_kbranch == "y": }} | ||
8 | branch {{=machine}} | ||
9 | |||
10 | include {{=machine}}.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-standard.scc b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-standard.scc new file mode 100644 index 0000000000..f05dd851d2 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-standard.scc | |||
@@ -0,0 +1,10 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-standard.scc | ||
2 | define KMACHINE {{=machine}} | ||
3 | define KTYPE standard | ||
4 | define KARCH mips | ||
5 | |||
6 | include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} | ||
7 | {{ if need_new_kbranch == "y": }} | ||
8 | branch {{=machine}} | ||
9 | |||
10 | include {{=machine}}.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-tiny.scc b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-tiny.scc new file mode 100644 index 0000000000..f71c775397 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-tiny.scc | |||
@@ -0,0 +1,10 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-tiny.scc | ||
2 | define KMACHINE {{=machine}} | ||
3 | define KTYPE tiny | ||
4 | define KARCH mips | ||
5 | |||
6 | include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} | ||
7 | {{ if need_new_kbranch == "y": }} | ||
8 | branch {{=machine}} | ||
9 | |||
10 | include {{=machine}}.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-config.cfg new file mode 100644 index 0000000000..47489e44e9 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-config.cfg | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{=machine}}-user-config.cfg | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-features.scc b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-features.scc new file mode 100644 index 0000000000..85be26de97 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-features.scc | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{=machine}}-user-features.scc \ No newline at end of file | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-patches.scc new file mode 100644 index 0000000000..97f747fa07 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-patches.scc | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{=machine}}-user-patches.scc | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine.cfg b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine.cfg new file mode 100644 index 0000000000..2fe476691c --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine.cfg | |||
@@ -0,0 +1,2 @@ | |||
1 | # yocto-bsp-filename {{=machine}}.cfg | ||
2 | CONFIG_MIPS=y | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine.scc b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine.scc new file mode 100644 index 0000000000..f39dc3edf1 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine.scc | |||
@@ -0,0 +1,8 @@ | |||
1 | # yocto-bsp-filename {{=machine}}.scc | ||
2 | kconf hardware {{=machine}}.cfg | ||
3 | |||
4 | include cfg/usb-mass-storage.scc | ||
5 | include cfg/fs/vfat.scc | ||
6 | |||
7 | kconf hardware {{=machine}}-user-config.cfg | ||
8 | include {{=machine}}-user-patches.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall new file mode 100644 index 0000000000..a04e6c7852 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall | |||
@@ -0,0 +1,5 @@ | |||
1 | {{ if kernel_choice != "custom": }} | ||
2 | {{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.14) kernel? (y/n)" default:"y"}} | ||
3 | |||
4 | {{ if kernel_choice != "custom" and use_default_kernel == "n": }} | ||
5 | {{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.14"}} | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-dev.bbappend b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-dev.bbappend new file mode 100644 index 0000000000..2fa6231cbf --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-dev.bbappend | |||
@@ -0,0 +1,26 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
8 | |||
9 | {{ if need_new_kbranch == "y": }} | ||
10 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
11 | |||
12 | {{ if need_new_kbranch == "n": }} | ||
13 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
14 | |||
15 | {{ if need_new_kbranch == "n": }} | ||
16 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
17 | |||
18 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}} | ||
19 | {{ if smp == "y": }} | ||
20 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
21 | |||
22 | SRC_URI += "file://{{=machine}}-standard.scc \ | ||
23 | file://{{=machine}}-user-config.cfg \ | ||
24 | file://{{=machine}}-user-patches.scc \ | ||
25 | file://{{=machine}}-user-features.scc \ | ||
26 | " | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend new file mode 100644 index 0000000000..35b0958582 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.10": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-preempt-rt.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb" | ||
32 | #SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f" | ||
33 | #LINUX_VERSION = "3.10.9" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend new file mode 100644 index 0000000000..f04dd0cce4 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.10": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-tiny.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" | ||
32 | #SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" | ||
33 | #LINUX_VERSION = "3.10.9" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend new file mode 100644 index 0000000000..c7e7989821 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.14": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-tiny.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" | ||
32 | #SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" | ||
33 | #LINUX_VERSION = "3.14" \ No newline at end of file | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.10.bbappend new file mode 100644 index 0000000000..badb3aa239 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.10.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.10": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-standard.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "19f7e43b54aef08d58135ed2a897d77b624b320a" | ||
32 | #SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "459165c1dd61c4e843c36e6a1abeb30949a20ba7" | ||
33 | #LINUX_VERSION = "3.10.9" \ No newline at end of file | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.14.bbappend new file mode 100644 index 0000000000..1e1cc51315 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.14.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.14": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-standard.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" | ||
32 | #SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" | ||
33 | #LINUX_VERSION = "3.14" \ No newline at end of file | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/.gitignore b/scripts/lib/bsp/substrate/target/arch/powerpc/.gitignore new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/.gitignore | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/machine.conf b/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/machine.conf new file mode 100644 index 0000000000..bee0ec3772 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/machine.conf | |||
@@ -0,0 +1,75 @@ | |||
1 | # yocto-bsp-filename {{=machine}}.conf | ||
2 | #@TYPE: Machine | ||
3 | #@NAME: {{=machine}} | ||
4 | |||
5 | #@DESCRIPTION: Machine configuration for {{=machine}} systems | ||
6 | |||
7 | TARGET_FPU = "" | ||
8 | |||
9 | {{ input type:"choicelist" name:"tunefile" prio:"40" msg:"Which machine tuning would you like to use?" default:"tune_ppce300c3" }} | ||
10 | {{ input type:"choice" val:"tune_ppc476" msg:"ppc476 tuning optimizations" }} | ||
11 | {{ input type:"choice" val:"tune_ppc603e" msg:"ppc603e tuning optimizations" }} | ||
12 | {{ input type:"choice" val:"tune_ppc7400" msg:"ppc7400 tuning optimizations" }} | ||
13 | {{ input type:"choice" val:"tune_ppce300c2" msg:"ppce300c2 tuning optimizations" }} | ||
14 | {{ input type:"choice" val:"tune_ppce300c3" msg:"ppce300c3 tuning optimizations" }} | ||
15 | {{ input type:"choice" val:"tune_ppce500" msg:"ppce500 tuning optimizations" }} | ||
16 | {{ input type:"choice" val:"tune_ppce500mc" msg:"ppce500mc tuning optimizations" }} | ||
17 | {{ input type:"choice" val:"tune_ppce500v2" msg:"ppce500v2 tuning optimizations" }} | ||
18 | {{ input type:"choice" val:"tune_ppce5500" msg:"ppce5500 tuning optimizations" }} | ||
19 | {{ input type:"choice" val:"tune_ppce6500" msg:"ppce6500 tuning optimizations" }} | ||
20 | {{ if tunefile == "tune_ppc476": }} | ||
21 | include conf/machine/include/tune-ppc476.inc | ||
22 | {{ if tunefile == "tune_ppc603e": }} | ||
23 | include conf/machine/include/tune-ppc603e.inc | ||
24 | {{ if tunefile == "tune_ppc7400": }} | ||
25 | include conf/machine/include/tune-ppc7400.inc | ||
26 | {{ if tunefile == "tune_ppce300c2": }} | ||
27 | include conf/machine/include/tune-ppce300c2.inc | ||
28 | {{ if tunefile == "tune_ppce300c3": }} | ||
29 | include conf/machine/include/tune-ppce300c3.inc | ||
30 | {{ if tunefile == "tune_ppce500": }} | ||
31 | include conf/machine/include/tune-ppce500.inc | ||
32 | {{ if tunefile == "tune_ppce500mc": }} | ||
33 | include conf/machine/include/tune-ppce500mc.inc | ||
34 | {{ if tunefile == "tune_ppce500v2": }} | ||
35 | include conf/machine/include/tune-ppce500v2.inc | ||
36 | {{ if tunefile == "tune_ppce5500": }} | ||
37 | include conf/machine/include/tune-ppce5500.inc | ||
38 | {{ if tunefile == "tune_ppce6500": }} | ||
39 | include conf/machine/include/tune-ppce6500.inc | ||
40 | |||
41 | KERNEL_IMAGETYPE = "uImage" | ||
42 | |||
43 | EXTRA_IMAGEDEPENDS += "u-boot" | ||
44 | UBOOT_MACHINE_{{=machine}} = "MPC8315ERDB_config" | ||
45 | |||
46 | SERIAL_CONSOLE = "115200 ttyS0" | ||
47 | |||
48 | MACHINE_FEATURES = "keyboard pci ext2 ext3 serial" | ||
49 | |||
50 | {{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }} | ||
51 | {{ if kernel_choice == "linux-yocto-dev": preferred_kernel = "linux-yocto-dev" }} | ||
52 | {{ if kernel_choice == "custom" or kernel_choice == "linux-yocto-dev" : }} | ||
53 | PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}" | ||
54 | |||
55 | {{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel = kernel_choice.split('_')[0] }} | ||
56 | {{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel_version = kernel_choice.split('_')[1] }} | ||
57 | {{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": }} | ||
58 | PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}" | ||
59 | PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%" | ||
60 | |||
61 | {{ input type:"boolean" name:"xserver" prio:"50" msg:"Do you need support for X? (y/n)" default:"y" }} | ||
62 | {{ if xserver == "y": }} | ||
63 | PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg" | ||
64 | XSERVER ?= "xserver-xorg \ | ||
65 | xf86-input-evdev \ | ||
66 | xf86-video-fbdev" | ||
67 | |||
68 | PREFERRED_VERSION_u-boot ?= "v2013.07%" | ||
69 | {{ input type:"edit" name:"uboot_entrypoint" prio:"40" msg:"Please specify a value for UBOOT_ENTRYPOINT:" default:"0x00000000" }} | ||
70 | UBOOT_ENTRYPOINT = "{{=uboot_entrypoint}}" | ||
71 | |||
72 | {{ input type:"edit" name:"kernel_devicetree" prio:"40" msg:"Please specify a [arch/powerpc/boot/dts/xxx] value for KERNEL_DEVICETREE:" default:"mpc8315erdb.dts" }} | ||
73 | KERNEL_DEVICETREE = "${S}/arch/powerpc/boot/dts/{{=kernel_devicetree}}" | ||
74 | |||
75 | MACHINE_EXTRA_RRECOMMENDS = " kernel-modules" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files.noinstall b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files.noinstall new file mode 100644 index 0000000000..1e0d92c55c --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files.noinstall | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-preempt-rt.scc b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-preempt-rt.scc new file mode 100644 index 0000000000..40c9267831 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-preempt-rt.scc | |||
@@ -0,0 +1,10 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-preempt-rt.scc | ||
2 | define KMACHINE {{=machine}} | ||
3 | define KTYPE preempt-rt | ||
4 | define KARCH powerpc | ||
5 | |||
6 | include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} | ||
7 | {{ if need_new_kbranch == "y": }} | ||
8 | branch {{=machine}} | ||
9 | |||
10 | include {{=machine}}.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-standard.scc b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-standard.scc new file mode 100644 index 0000000000..7a1d35be1e --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-standard.scc | |||
@@ -0,0 +1,10 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-standard.scc | ||
2 | define KMACHINE {{=machine}} | ||
3 | define KTYPE standard | ||
4 | define KARCH powerpc | ||
5 | |||
6 | include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} | ||
7 | {{ if need_new_kbranch == "y": }} | ||
8 | branch {{=machine}} | ||
9 | |||
10 | include {{=machine}}.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-tiny.scc b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-tiny.scc new file mode 100644 index 0000000000..1bf94b2d05 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-tiny.scc | |||
@@ -0,0 +1,10 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-tiny.scc | ||
2 | define KMACHINE {{=machine}} | ||
3 | define KTYPE tiny | ||
4 | define KARCH powerpc | ||
5 | |||
6 | include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} | ||
7 | {{ if need_new_kbranch == "y": }} | ||
8 | branch {{=machine}} | ||
9 | |||
10 | include {{=machine}}.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-config.cfg new file mode 100644 index 0000000000..47489e44e9 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-config.cfg | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{=machine}}-user-config.cfg | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-features.scc b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-features.scc new file mode 100644 index 0000000000..582759e612 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-features.scc | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{=machine}}-user-features.scc | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-patches.scc new file mode 100644 index 0000000000..97f747fa07 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-patches.scc | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{=machine}}-user-patches.scc | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine.cfg b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine.cfg new file mode 100644 index 0000000000..5bfe1fe4b0 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine.cfg | |||
@@ -0,0 +1,164 @@ | |||
1 | # yocto-bsp-filename {{=machine}}.cfg | ||
2 | .......................................................................... | ||
3 | . WARNING | ||
4 | . | ||
5 | . This file is a kernel configuration fragment, and not a full kernel | ||
6 | . configuration file. The final kernel configuration is made up of | ||
7 | . an assembly of processed fragments, each of which is designed to | ||
8 | . capture a specific part of the final configuration (e.g. platform | ||
9 | . configuration, feature configuration, and board specific hardware | ||
10 | . configuration). For more information on kernel configuration, please | ||
11 | . consult the product documentation. | ||
12 | . | ||
13 | .......................................................................... | ||
14 | CONFIG_PPC32=y | ||
15 | CONFIG_PPC_OF=y | ||
16 | CONFIG_PPC_UDBG_16550=y | ||
17 | |||
18 | # | ||
19 | # Processor support | ||
20 | # | ||
21 | CONFIG_PPC_83xx=y | ||
22 | |||
23 | # | ||
24 | # Platform support | ||
25 | # | ||
26 | CONFIG_MPC831x_RDB=y | ||
27 | # CONFIG_PPC_CHRP is not set | ||
28 | # CONFIG_PPC_PMAC is not set | ||
29 | |||
30 | # | ||
31 | # Bus options | ||
32 | # | ||
33 | CONFIG_PCI=y | ||
34 | |||
35 | # | ||
36 | # Memory Technology Devices (MTD) | ||
37 | # | ||
38 | CONFIG_MTD=y | ||
39 | CONFIG_MTD_PARTITIONS=y | ||
40 | CONFIG_MTD_CMDLINE_PARTS=y | ||
41 | CONFIG_MTD_OF_PARTS=y | ||
42 | |||
43 | # | ||
44 | # User Modules And Translation Layers | ||
45 | # | ||
46 | CONFIG_MTD_CHAR=y | ||
47 | CONFIG_MTD_BLOCK=y | ||
48 | |||
49 | # | ||
50 | # RAM/ROM/Flash chip drivers | ||
51 | # | ||
52 | CONFIG_MTD_CFI=y | ||
53 | CONFIG_MTD_CFI_AMDSTD=y | ||
54 | |||
55 | # | ||
56 | # Mapping drivers for chip access | ||
57 | # | ||
58 | CONFIG_MTD_PHYSMAP_OF=y | ||
59 | |||
60 | # | ||
61 | # NAND Flash Device Drivers | ||
62 | # | ||
63 | CONFIG_MTD_NAND=y | ||
64 | |||
65 | # | ||
66 | # Ethernet (1000 Mbit) | ||
67 | # | ||
68 | CONFIG_GIANFAR=y | ||
69 | |||
70 | # | ||
71 | # Serial drivers | ||
72 | # | ||
73 | CONFIG_SERIAL_8250=y | ||
74 | CONFIG_SERIAL_8250_CONSOLE=y | ||
75 | CONFIG_SERIAL_8250_NR_UARTS=2 | ||
76 | |||
77 | # | ||
78 | # Watchdog Device Drivers | ||
79 | # | ||
80 | CONFIG_8xxx_WDT=y | ||
81 | |||
82 | # | ||
83 | # I2C support | ||
84 | # | ||
85 | CONFIG_I2C=y | ||
86 | CONFIG_I2C_CHARDEV=y | ||
87 | |||
88 | # | ||
89 | # I2C Hardware Bus support | ||
90 | # | ||
91 | CONFIG_I2C_MPC=y | ||
92 | |||
93 | CONFIG_SENSORS_LM75=y | ||
94 | |||
95 | CONFIG_MISC_DEVICES=y | ||
96 | |||
97 | # | ||
98 | # Miscellaneous I2C Chip support | ||
99 | # | ||
100 | CONFIG_EEPROM_AT24=y | ||
101 | |||
102 | # | ||
103 | # SPI support | ||
104 | # | ||
105 | CONFIG_SPI=y | ||
106 | # CONFIG_SPI_DEBUG is not set | ||
107 | CONFIG_SPI_MASTER=y | ||
108 | |||
109 | # | ||
110 | # SPI Master Controller Drivers | ||
111 | # | ||
112 | CONFIG_SPI_MPC8xxx=y | ||
113 | |||
114 | # | ||
115 | # SPI Protocol Masters | ||
116 | # | ||
117 | CONFIG_HWMON=y | ||
118 | |||
119 | # | ||
120 | # SCSI device support | ||
121 | # | ||
122 | CONFIG_SCSI=y | ||
123 | CONFIG_BLK_DEV_SD=y | ||
124 | CONFIG_CHR_DEV_SG=y | ||
125 | CONFIG_SCSI_LOGGING=y | ||
126 | |||
127 | CONFIG_ATA=y | ||
128 | CONFIG_ATA_VERBOSE_ERROR=y | ||
129 | CONFIG_SATA_FSL=y | ||
130 | CONFIG_ATA_SFF=y | ||
131 | |||
132 | # | ||
133 | # USB support | ||
134 | # | ||
135 | CONFIG_USB=m | ||
136 | CONFIG_USB_DEVICEFS=y | ||
137 | |||
138 | # | ||
139 | # USB Host Controller Drivers | ||
140 | # | ||
141 | CONFIG_USB_EHCI_HCD=m | ||
142 | CONFIG_USB_EHCI_FSL=y | ||
143 | CONFIG_USB_STORAGE=m | ||
144 | |||
145 | # | ||
146 | # Real Time Clock | ||
147 | # | ||
148 | CONFIG_RTC_CLASS=y | ||
149 | |||
150 | # | ||
151 | # I2C RTC drivers | ||
152 | # | ||
153 | CONFIG_RTC_DRV_DS1307=y | ||
154 | |||
155 | CONFIG_KGDB_8250=m | ||
156 | |||
157 | CONFIG_CRYPTO_DEV_TALITOS=m | ||
158 | |||
159 | CONFIG_FSL_DMA=y | ||
160 | |||
161 | CONFIG_MMC=y | ||
162 | CONFIG_MMC_SPI=m | ||
163 | |||
164 | CONFIG_USB_FSL_MPH_DR_OF=y | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine.scc b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine.scc new file mode 100644 index 0000000000..7aac8b0801 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine.scc | |||
@@ -0,0 +1,10 @@ | |||
1 | # yocto-bsp-filename {{=machine}}.scc | ||
2 | kconf hardware {{=machine}}.cfg | ||
3 | |||
4 | include cfg/usb-mass-storage.scc | ||
5 | include cfg/fs/vfat.scc | ||
6 | |||
7 | include cfg/dmaengine.scc | ||
8 | |||
9 | kconf hardware {{=machine}}-user-config.cfg | ||
10 | include {{=machine}}-user-patches.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall new file mode 100644 index 0000000000..a04e6c7852 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall | |||
@@ -0,0 +1,5 @@ | |||
1 | {{ if kernel_choice != "custom": }} | ||
2 | {{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.14) kernel? (y/n)" default:"y"}} | ||
3 | |||
4 | {{ if kernel_choice != "custom" and use_default_kernel == "n": }} | ||
5 | {{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.14"}} | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-dev.bbappend b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-dev.bbappend new file mode 100644 index 0000000000..2fa6231cbf --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-dev.bbappend | |||
@@ -0,0 +1,26 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
8 | |||
9 | {{ if need_new_kbranch == "y": }} | ||
10 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
11 | |||
12 | {{ if need_new_kbranch == "n": }} | ||
13 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
14 | |||
15 | {{ if need_new_kbranch == "n": }} | ||
16 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
17 | |||
18 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}} | ||
19 | {{ if smp == "y": }} | ||
20 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
21 | |||
22 | SRC_URI += "file://{{=machine}}-standard.scc \ | ||
23 | file://{{=machine}}-user-config.cfg \ | ||
24 | file://{{=machine}}-user-patches.scc \ | ||
25 | file://{{=machine}}-user-features.scc \ | ||
26 | " | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend new file mode 100644 index 0000000000..7a2544617f --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.14": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-preempt-rt.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb" | ||
32 | #SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f" | ||
33 | #LINUX_VERSION = "3.14" \ No newline at end of file | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend new file mode 100644 index 0000000000..f04dd0cce4 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.10": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-tiny.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" | ||
32 | #SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" | ||
33 | #LINUX_VERSION = "3.10.9" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend new file mode 100644 index 0000000000..471ccbcc3e --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.14": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-tiny.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" | ||
32 | #SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" | ||
33 | #LINUX_VERSION = "3.14" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.10.bbappend new file mode 100644 index 0000000000..15b4b973c9 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.10.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.10": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-standard.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "19f7e43b54aef08d58135ed2a897d77b624b320a" | ||
32 | #SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "459165c1dd61c4e843c36e6a1abeb30949a20ba7" | ||
33 | #LINUX_VERSION = "3.10.9" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.14.bbappend new file mode 100644 index 0000000000..e688384020 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.14.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.14": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-standard.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" | ||
32 | #SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" | ||
33 | #LINUX_VERSION = "3.14" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/machine.conf b/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/machine.conf new file mode 100644 index 0000000000..52f1866b5b --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/machine.conf | |||
@@ -0,0 +1,70 @@ | |||
1 | # yocto-bsp-filename {{=machine}}.conf | ||
2 | #@TYPE: Machine | ||
3 | #@NAME: {{=machine}} | ||
4 | |||
5 | #@DESCRIPTION: Machine configuration for {{=machine}} systems | ||
6 | |||
7 | {{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }} | ||
8 | {{ if kernel_choice == "linux-yocto-dev": preferred_kernel = "linux-yocto-dev" }} | ||
9 | {{ if kernel_choice == "custom" or kernel_choice == "linux-yocto-dev" : }} | ||
10 | PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}" | ||
11 | |||
12 | {{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel = kernel_choice.split('_')[0] }} | ||
13 | {{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel_version = kernel_choice.split('_')[1] }} | ||
14 | {{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": }} | ||
15 | PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}" | ||
16 | PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%" | ||
17 | |||
18 | {{ if qemuarch == "i386" or qemuarch == "x86_64": }} | ||
19 | PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg" | ||
20 | PREFERRED_PROVIDER_virtual/libgl ?= "mesa" | ||
21 | PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa" | ||
22 | PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa" | ||
23 | |||
24 | {{ input type:"choicelist" name:"qemuarch" prio:"5" msg:"Which qemu architecture would you like to use?" default:"i386" }} | ||
25 | {{ input type:"choice" val:"i386" msg:"i386 (32-bit)" }} | ||
26 | {{ input type:"choice" val:"x86_64" msg:"x86_64 (64-bit)" }} | ||
27 | {{ input type:"choice" val:"arm" msg:"ARM (32-bit)" }} | ||
28 | {{ input type:"choice" val:"powerpc" msg:"PowerPC (32-bit)" }} | ||
29 | {{ input type:"choice" val:"mips" msg:"MIPS (32-bit)" }} | ||
30 | {{ if qemuarch == "i386": }} | ||
31 | require conf/machine/include/qemu.inc | ||
32 | require conf/machine/include/tune-i586.inc | ||
33 | {{ if qemuarch == "x86_64": }} | ||
34 | require conf/machine/include/qemu.inc | ||
35 | DEFAULTTUNE ?= "core2-64" | ||
36 | require conf/machine/include/tune-core2.inc | ||
37 | {{ if qemuarch == "arm": }} | ||
38 | require conf/machine/include/qemu.inc | ||
39 | require conf/machine/include/tune-arm926ejs.inc | ||
40 | {{ if qemuarch == "powerpc": }} | ||
41 | require conf/machine/include/qemu.inc | ||
42 | require conf/machine/include/tune-ppc7400.inc | ||
43 | {{ if qemuarch == "mips": }} | ||
44 | require conf/machine/include/qemu.inc | ||
45 | require conf/machine/include/tune-mips32.inc | ||
46 | |||
47 | {{ if qemuarch == "i386" or qemuarch == "x86_64": }} | ||
48 | MACHINE_FEATURES += "x86" | ||
49 | KERNEL_IMAGETYPE = "bzImage" | ||
50 | SERIAL_CONSOLE = "115200 ttyS0" | ||
51 | XSERVER = "xserver-xorg \ | ||
52 | ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-swrast', '', d)} \ | ||
53 | xf86-input-vmmouse \ | ||
54 | xf86-input-keyboard \ | ||
55 | xf86-input-evdev \ | ||
56 | xf86-video-vmware" | ||
57 | |||
58 | {{ if qemuarch == "arm": }} | ||
59 | KERNEL_IMAGETYPE = "zImage" | ||
60 | SERIAL_CONSOLE = "115200 ttyAMA0" | ||
61 | |||
62 | {{ if qemuarch == "powerpc": }} | ||
63 | KERNEL_IMAGETYPE = "vmlinux" | ||
64 | SERIAL_CONSOLE = "115200 ttyS0" | ||
65 | |||
66 | {{ if qemuarch == "mips": }} | ||
67 | KERNEL_IMAGETYPE = "vmlinux" | ||
68 | KERNEL_ALT_IMAGETYPE = "vmlinux.bin" | ||
69 | SERIAL_CONSOLE = "115200 ttyS0" | ||
70 | MACHINE_EXTRA_RRECOMMENDS = " kernel-modules" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/machine.noinstall b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/machine.noinstall new file mode 100644 index 0000000000..b442d02d57 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/machine.noinstall | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-dirname {{=machine}} | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/machine/interfaces b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/machine/interfaces new file mode 100644 index 0000000000..16967763e5 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/machine/interfaces | |||
@@ -0,0 +1,5 @@ | |||
1 | # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) | ||
2 | |||
3 | # The loopback interface | ||
4 | auto lo | ||
5 | iface lo inet loopback | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend new file mode 100644 index 0000000000..72d991c7e5 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend | |||
@@ -0,0 +1 @@ | |||
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall new file mode 100644 index 0000000000..b442d02d57 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-dirname {{=machine}} | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf new file mode 100644 index 0000000000..13519804bc --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf | |||
@@ -0,0 +1,77 @@ | |||
1 | |||
2 | Section "Files" | ||
3 | EndSection | ||
4 | |||
5 | Section "InputDevice" | ||
6 | Identifier "Generic Keyboard" | ||
7 | Driver "evdev" | ||
8 | Option "CoreKeyboard" | ||
9 | Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd" | ||
10 | Option "XkbRules" "xorg" | ||
11 | Option "XkbModel" "evdev" | ||
12 | Option "XkbLayout" "us" | ||
13 | EndSection | ||
14 | |||
15 | Section "InputDevice" | ||
16 | Identifier "Configured Mouse" | ||
17 | {{ if qemuarch == "arm" or qemuarch == "powerpc" or qemuarch == "mips": }} | ||
18 | Driver "mouse" | ||
19 | {{ if qemuarch == "i386" or qemuarch == "x86_64": }} | ||
20 | Driver "vmmouse" | ||
21 | |||
22 | Option "CorePointer" | ||
23 | Option "Device" "/dev/input/mice" | ||
24 | Option "Protocol" "ImPS/2" | ||
25 | Option "ZAxisMapping" "4 5" | ||
26 | Option "Emulate3Buttons" "true" | ||
27 | EndSection | ||
28 | |||
29 | Section "InputDevice" | ||
30 | Identifier "Qemu Tablet" | ||
31 | Driver "evdev" | ||
32 | Option "CorePointer" | ||
33 | Option "Device" "/dev/input/touchscreen0" | ||
34 | Option "USB" "on" | ||
35 | EndSection | ||
36 | |||
37 | Section "Device" | ||
38 | Identifier "Graphics Controller" | ||
39 | {{ if qemuarch == "arm" or qemuarch == "powerpc" or qemuarch == "mips": }} | ||
40 | Driver "fbdev" | ||
41 | {{ if qemuarch == "i386" or qemuarch == "x86_64": }} | ||
42 | Driver "vmware" | ||
43 | |||
44 | EndSection | ||
45 | |||
46 | Section "Monitor" | ||
47 | Identifier "Generic Monitor" | ||
48 | Option "DPMS" | ||
49 | # 1024x600 59.85 Hz (CVT) hsync: 37.35 kHz; pclk: 49.00 MHz | ||
50 | Modeline "1024x600_60.00" 49.00 1024 1072 1168 1312 600 603 613 624 -hsync +vsync | ||
51 | # 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz | ||
52 | ModeLine "640x480" 25.2 640 656 752 800 480 490 492 525 -hsync -vsync | ||
53 | # 640x480 @ 72Hz (VESA) hsync: 37.9kHz | ||
54 | ModeLine "640x480" 31.5 640 664 704 832 480 489 491 520 -hsync -vsync | ||
55 | # 640x480 @ 75Hz (VESA) hsync: 37.5kHz | ||
56 | ModeLine "640x480" 31.5 640 656 720 840 480 481 484 500 -hsync -vsync | ||
57 | # 640x480 @ 85Hz (VESA) hsync: 43.3kHz | ||
58 | ModeLine "640x480" 36.0 640 696 752 832 480 481 484 509 -hsync -vsync | ||
59 | EndSection | ||
60 | |||
61 | Section "Screen" | ||
62 | Identifier "Default Screen" | ||
63 | Device "Graphics Controller" | ||
64 | Monitor "Generic Monitor" | ||
65 | SubSection "Display" | ||
66 | Modes "640x480" | ||
67 | EndSubSection | ||
68 | EndSection | ||
69 | |||
70 | Section "ServerLayout" | ||
71 | Identifier "Default Layout" | ||
72 | Screen "Default Screen" | ||
73 | InputDevice "Generic Keyboard" | ||
74 | # InputDevice "Configured Mouse" | ||
75 | InputDevice "QEMU Tablet" | ||
76 | Option "AllowEmptyInput" "no" | ||
77 | EndSection | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend new file mode 100644 index 0000000000..72d991c7e5 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend | |||
@@ -0,0 +1 @@ | |||
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files.noinstall b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files.noinstall new file mode 100644 index 0000000000..0fb5283a8d --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files.noinstall | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files \ No newline at end of file | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-preempt-rt.scc b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-preempt-rt.scc new file mode 100644 index 0000000000..6aaffb8184 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-preempt-rt.scc | |||
@@ -0,0 +1,10 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-preempt-rt.scc | ||
2 | define KMACHINE {{=machine}} | ||
3 | define KTYPE preempt-rt | ||
4 | define KARCH {{=qemuarch}} | ||
5 | |||
6 | include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} | ||
7 | {{ if need_new_kbranch == "y": }} | ||
8 | branch {{=machine}} | ||
9 | |||
10 | include {{=machine}}.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-standard.scc b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-standard.scc new file mode 100644 index 0000000000..695f488064 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-standard.scc | |||
@@ -0,0 +1,17 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-standard.scc | ||
2 | define KMACHINE {{=machine}} | ||
3 | define KTYPE standard | ||
4 | define KARCH {{=qemuarch}} | ||
5 | |||
6 | {{ if qemuarch == "i386" or qemuarch == "x86_64": }} | ||
7 | include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} | ||
8 | {{ if qemuarch == "arm": }} | ||
9 | include bsp/arm-versatile-926ejs/arm-versatile-926ejs-standard | ||
10 | {{ if qemuarch == "powerpc": }} | ||
11 | include bsp/qemu-ppc32/qemu-ppc32-standard | ||
12 | {{ if qemuarch == "mips": }} | ||
13 | include bsp/mti-malta32/mti-malta32-be-standard | ||
14 | {{ if need_new_kbranch == "y": }} | ||
15 | branch {{=machine}} | ||
16 | |||
17 | include {{=machine}}.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-tiny.scc b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-tiny.scc new file mode 100644 index 0000000000..6c098fed21 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-tiny.scc | |||
@@ -0,0 +1,10 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-tiny.scc | ||
2 | define KMACHINE {{=machine}} | ||
3 | define KTYPE tiny | ||
4 | define KARCH {{=qemuarch}} | ||
5 | |||
6 | include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} | ||
7 | {{ if need_new_kbranch == "y": }} | ||
8 | branch {{=machine}} | ||
9 | |||
10 | include {{=machine}}.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-config.cfg new file mode 100644 index 0000000000..69efdcc759 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-config.cfg | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{=machine}}-user-config.cfg \ No newline at end of file | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-features.scc b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-features.scc new file mode 100644 index 0000000000..582759e612 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-features.scc | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{=machine}}-user-features.scc | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-patches.scc new file mode 100644 index 0000000000..4c59daac46 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-patches.scc | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{=machine}}-user-patches.scc \ No newline at end of file | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine.cfg b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine.cfg new file mode 100644 index 0000000000..d560784b56 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine.cfg | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{=machine}}.cfg \ No newline at end of file | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine.scc b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine.scc new file mode 100644 index 0000000000..8301e05f7d --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine.scc | |||
@@ -0,0 +1,5 @@ | |||
1 | # yocto-bsp-filename {{=machine}}.scc | ||
2 | kconf hardware {{=machine}}.cfg | ||
3 | |||
4 | kconf hardware {{=machine}}-user-config.cfg | ||
5 | include {{=machine}}-user-patches.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall new file mode 100644 index 0000000000..a04e6c7852 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall | |||
@@ -0,0 +1,5 @@ | |||
1 | {{ if kernel_choice != "custom": }} | ||
2 | {{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.14) kernel? (y/n)" default:"y"}} | ||
3 | |||
4 | {{ if kernel_choice != "custom" and use_default_kernel == "n": }} | ||
5 | {{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.14"}} | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-dev.bbappend b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-dev.bbappend new file mode 100644 index 0000000000..a2b86d2568 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-dev.bbappend | |||
@@ -0,0 +1,50 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
8 | |||
9 | {{ if need_new_kbranch == "y" and qemuarch == "arm": }} | ||
10 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base your new BSP branch on:" default:"standard/base" }} | ||
11 | |||
12 | {{ if need_new_kbranch == "n" and qemuarch == "arm": }} | ||
13 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose an existing machine branch to use for this BSP:" default:"standard/arm-versatile-926ejs" }} | ||
14 | |||
15 | {{ if need_new_kbranch == "y" and qemuarch == "powerpc": }} | ||
16 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
17 | |||
18 | {{ if need_new_kbranch == "n" and qemuarch == "powerpc": }} | ||
19 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/qemuppc" }} | ||
20 | |||
21 | {{ if need_new_kbranch == "y" and qemuarch == "i386": }} | ||
22 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc/base" }} | ||
23 | |||
24 | {{ if need_new_kbranch == "n" and qemuarch == "i386": }} | ||
25 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc/base" }} | ||
26 | |||
27 | {{ if need_new_kbranch == "y" and qemuarch == "x86_64": }} | ||
28 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }} | ||
29 | |||
30 | {{ if need_new_kbranch == "n" and qemuarch == "x86_64": }} | ||
31 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }} | ||
32 | |||
33 | {{ if need_new_kbranch == "y" and qemuarch == "mips": }} | ||
34 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
35 | |||
36 | {{ if need_new_kbranch == "n" and qemuarch == "mips": }} | ||
37 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta32" }} | ||
38 | |||
39 | {{ if need_new_kbranch == "n": }} | ||
40 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
41 | |||
42 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}} | ||
43 | {{ if smp == "y": }} | ||
44 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
45 | |||
46 | SRC_URI += "file://{{=machine}}-standard.scc \ | ||
47 | file://{{=machine}}-user-config.cfg \ | ||
48 | file://{{=machine}}-user-patches.scc \ | ||
49 | file://{{=machine}}-user-features.scc \ | ||
50 | " | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend new file mode 100644 index 0000000000..aa87c28ff8 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend | |||
@@ -0,0 +1,56 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.10": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
8 | |||
9 | {{ if need_new_kbranch == "y" and qemuarch == "arm": }} | ||
10 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"arm" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} | ||
11 | |||
12 | {{ if need_new_kbranch == "n" and qemuarch == "arm": }} | ||
13 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"arm" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} | ||
14 | |||
15 | {{ if need_new_kbranch == "y" and qemuarch == "powerpc": }} | ||
16 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} | ||
17 | |||
18 | {{ if need_new_kbranch == "n" and qemuarch == "powerpc": }} | ||
19 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/qemuppc" }} | ||
20 | |||
21 | {{ if need_new_kbranch == "y" and qemuarch == "i386": }} | ||
22 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} | ||
23 | |||
24 | {{ if need_new_kbranch == "n" and qemuarch == "i386": }} | ||
25 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} | ||
26 | |||
27 | {{ if need_new_kbranch == "y" and qemuarch == "x86_64": }} | ||
28 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} | ||
29 | |||
30 | {{ if need_new_kbranch == "n" and qemuarch == "x86_64": }} | ||
31 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} | ||
32 | |||
33 | {{ if need_new_kbranch == "y" and qemuarch == "mips": }} | ||
34 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} | ||
35 | |||
36 | {{ if need_new_kbranch == "n" and qemuarch == "mips": }} | ||
37 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} | ||
38 | |||
39 | {{ if need_new_kbranch == "n": }} | ||
40 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
41 | |||
42 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
43 | {{ if smp == "y": }} | ||
44 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
45 | |||
46 | SRC_URI += "file://{{=machine}}-preempt-rt.scc \ | ||
47 | file://{{=machine}}-user-config.cfg \ | ||
48 | file://{{=machine}}-user-patches.scc \ | ||
49 | file://{{=machine}}-user-features.scc \ | ||
50 | " | ||
51 | |||
52 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
53 | # the appropriate changes committed to the upstream linux-yocto repo | ||
54 | #SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb" | ||
55 | #SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f" | ||
56 | #LINUX_VERSION = "3.10.35" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend new file mode 100644 index 0000000000..001317ac92 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend | |||
@@ -0,0 +1,56 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.10": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
8 | |||
9 | {{ if need_new_kbranch == "y" and qemuarch == "arm": }} | ||
10 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"arm" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
11 | |||
12 | {{ if need_new_kbranch == "n" and qemuarch == "arm": }} | ||
13 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"arm" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
14 | |||
15 | {{ if need_new_kbranch == "y" and qemuarch == "powerpc": }} | ||
16 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
17 | |||
18 | {{ if need_new_kbranch == "n" and qemuarch == "powerpc": }} | ||
19 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
20 | |||
21 | {{ if need_new_kbranch == "y" and qemuarch == "i386": }} | ||
22 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
23 | |||
24 | {{ if need_new_kbranch == "n" and qemuarch == "i386": }} | ||
25 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/common-pc" }} | ||
26 | |||
27 | {{ if need_new_kbranch == "y" and qemuarch == "x86_64": }} | ||
28 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
29 | |||
30 | {{ if need_new_kbranch == "n" and qemuarch == "x86_64": }} | ||
31 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
32 | |||
33 | {{ if need_new_kbranch == "y" and qemuarch == "mips": }} | ||
34 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
35 | |||
36 | {{ if need_new_kbranch == "n" and qemuarch == "mips": }} | ||
37 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
38 | |||
39 | {{ if need_new_kbranch == "n": }} | ||
40 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
41 | |||
42 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
43 | {{ if smp == "y": }} | ||
44 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
45 | |||
46 | SRC_URI += "file://{{=machine}}-tiny.scc \ | ||
47 | file://{{=machine}}-user-config.cfg \ | ||
48 | file://{{=machine}}-user-patches.scc \ | ||
49 | file://{{=machine}}-user-features.scc \ | ||
50 | " | ||
51 | |||
52 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
53 | # the appropriate changes committed to the upstream linux-yocto repo | ||
54 | #SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" | ||
55 | #SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" | ||
56 | #LINUX_VERSION = "3.10.35" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.4.bbappend b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.4.bbappend new file mode 100644 index 0000000000..32c96c9df8 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.4.bbappend | |||
@@ -0,0 +1,56 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.4": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
8 | |||
9 | {{ if need_new_kbranch == "y" and qemuarch == "arm": }} | ||
10 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"arm" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
11 | |||
12 | {{ if need_new_kbranch == "n" and qemuarch == "arm": }} | ||
13 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"arm" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
14 | |||
15 | {{ if need_new_kbranch == "y" and qemuarch == "powerpc": }} | ||
16 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
17 | |||
18 | {{ if need_new_kbranch == "n" and qemuarch == "powerpc": }} | ||
19 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
20 | |||
21 | {{ if need_new_kbranch == "y" and qemuarch == "i386": }} | ||
22 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
23 | |||
24 | {{ if need_new_kbranch == "n" and qemuarch == "i386": }} | ||
25 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/common-pc" }} | ||
26 | |||
27 | {{ if need_new_kbranch == "y" and qemuarch == "x86_64": }} | ||
28 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
29 | |||
30 | {{ if need_new_kbranch == "n" and qemuarch == "x86_64": }} | ||
31 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
32 | |||
33 | {{ if need_new_kbranch == "y" and qemuarch == "mips": }} | ||
34 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
35 | |||
36 | {{ if need_new_kbranch == "n" and qemuarch == "mips": }} | ||
37 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
38 | |||
39 | {{ if need_new_kbranch == "n": }} | ||
40 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
41 | |||
42 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
43 | {{ if smp == "y": }} | ||
44 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
45 | |||
46 | SRC_URI += "file://{{=machine}}-tiny.scc \ | ||
47 | file://{{=machine}}-user-config.cfg \ | ||
48 | file://{{=machine}}-user-patches.scc \ | ||
49 | file://{{=machine}}-user-features.scc \ | ||
50 | " | ||
51 | |||
52 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
53 | # the appropriate changes committed to the upstream linux-yocto repo | ||
54 | #SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "0143c6ebb4a2d63b241df5f608b19f483f7eb9e0" | ||
55 | #SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "8f55bee2403176a50cc0dd41811aa60fcf07243c" | ||
56 | #LINUX_VERSION = "3.14" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.10.bbappend new file mode 100644 index 0000000000..9e3b7fb683 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.10.bbappend | |||
@@ -0,0 +1,56 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.10": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
8 | |||
9 | {{ if need_new_kbranch == "y" and qemuarch == "arm": }} | ||
10 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base your new BSP branch on:" default:"standard/base" }} | ||
11 | |||
12 | {{ if need_new_kbranch == "n" and qemuarch == "arm": }} | ||
13 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose an existing machine branch to use for this BSP:" default:"standard/arm-versatile-926ejs" }} | ||
14 | |||
15 | {{ if need_new_kbranch == "y" and qemuarch == "powerpc": }} | ||
16 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
17 | |||
18 | {{ if need_new_kbranch == "n" and qemuarch == "powerpc": }} | ||
19 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/qemuppc" }} | ||
20 | |||
21 | {{ if need_new_kbranch == "y" and qemuarch == "i386": }} | ||
22 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc/base" }} | ||
23 | |||
24 | {{ if need_new_kbranch == "n" and qemuarch == "i386": }} | ||
25 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc/base" }} | ||
26 | |||
27 | {{ if need_new_kbranch == "y" and qemuarch == "x86_64": }} | ||
28 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }} | ||
29 | |||
30 | {{ if need_new_kbranch == "n" and qemuarch == "x86_64": }} | ||
31 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }} | ||
32 | |||
33 | {{ if need_new_kbranch == "y" and qemuarch == "mips": }} | ||
34 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
35 | |||
36 | {{ if need_new_kbranch == "n" and qemuarch == "mips": }} | ||
37 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta32" }} | ||
38 | |||
39 | {{ if need_new_kbranch == "n": }} | ||
40 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
41 | |||
42 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}} | ||
43 | {{ if smp == "y": }} | ||
44 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
45 | |||
46 | SRC_URI += "file://{{=machine}}-standard.scc \ | ||
47 | file://{{=machine}}-user-config.cfg \ | ||
48 | file://{{=machine}}-user-patches.scc \ | ||
49 | file://{{=machine}}-user-features.scc \ | ||
50 | " | ||
51 | |||
52 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
53 | # the appropriate changes committed to the upstream linux-yocto repo | ||
54 | #SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "b170394a475b96ecc92cbc9e4b002bed0a9f69c5" | ||
55 | #SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "c2ed0f16fdec628242a682897d5d86df4547cf24" | ||
56 | #LINUX_VERSION = "3.10.35" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.14.bbappend new file mode 100644 index 0000000000..e63c897f60 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.14.bbappend | |||
@@ -0,0 +1,56 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.14": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
8 | |||
9 | {{ if need_new_kbranch == "y" and qemuarch == "arm": }} | ||
10 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base your new BSP branch on:" default:"standard/base" }} | ||
11 | |||
12 | {{ if need_new_kbranch == "n" and qemuarch == "arm": }} | ||
13 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose an existing machine branch to use for this BSP:" default:"standard/arm-versatile-926ejs" }} | ||
14 | |||
15 | {{ if need_new_kbranch == "y" and qemuarch == "powerpc": }} | ||
16 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
17 | |||
18 | {{ if need_new_kbranch == "n" and qemuarch == "powerpc": }} | ||
19 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/qemuppc" }} | ||
20 | |||
21 | {{ if need_new_kbranch == "y" and qemuarch == "i386": }} | ||
22 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc/base" }} | ||
23 | |||
24 | {{ if need_new_kbranch == "n" and qemuarch == "i386": }} | ||
25 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc/base" }} | ||
26 | |||
27 | {{ if need_new_kbranch == "y" and qemuarch == "x86_64": }} | ||
28 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }} | ||
29 | |||
30 | {{ if need_new_kbranch == "n" and qemuarch == "x86_64": }} | ||
31 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }} | ||
32 | |||
33 | {{ if need_new_kbranch == "y" and qemuarch == "mips": }} | ||
34 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
35 | |||
36 | {{ if need_new_kbranch == "n" and qemuarch == "mips": }} | ||
37 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta32" }} | ||
38 | |||
39 | {{ if need_new_kbranch == "n": }} | ||
40 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
41 | |||
42 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}} | ||
43 | {{ if smp == "y": }} | ||
44 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
45 | |||
46 | SRC_URI += "file://{{=machine}}-standard.scc \ | ||
47 | file://{{=machine}}-user-config.cfg \ | ||
48 | file://{{=machine}}-user-patches.scc \ | ||
49 | file://{{=machine}}-user-features.scc \ | ||
50 | " | ||
51 | |||
52 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
53 | # the appropriate changes committed to the upstream linux-yocto repo | ||
54 | #SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "0143c6ebb4a2d63b241df5f608b19f483f7eb9e0" | ||
55 | #SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "8f55bee2403176a50cc0dd41811aa60fcf07243c" | ||
56 | #LINUX_VERSION = "3.14" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/.gitignore b/scripts/lib/bsp/substrate/target/arch/x86_64/.gitignore new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/.gitignore | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/machine.conf b/scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/machine.conf new file mode 100644 index 0000000000..79b38e6b35 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/machine.conf | |||
@@ -0,0 +1,57 @@ | |||
1 | # yocto-bsp-filename {{=machine}}.conf | ||
2 | #@TYPE: Machine | ||
3 | #@NAME: {{=machine}} | ||
4 | |||
5 | #@DESCRIPTION: Machine configuration for {{=machine}} systems | ||
6 | |||
7 | {{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }} | ||
8 | {{ if kernel_choice == "linux-yocto-dev": preferred_kernel = "linux-yocto-dev" }} | ||
9 | {{ if kernel_choice == "custom" or kernel_choice == "linux-yocto-dev" : }} | ||
10 | PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}" | ||
11 | |||
12 | {{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel = kernel_choice.split('_')[0] }} | ||
13 | {{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel_version = kernel_choice.split('_')[1] }} | ||
14 | {{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": }} | ||
15 | PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}" | ||
16 | PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%" | ||
17 | |||
18 | {{ input type:"choicelist" name:"tunefile" prio:"40" msg:"Which machine tuning would you like to use?" default:"tune_core2" }} | ||
19 | {{ input type:"choice" val:"tune_core2" msg:"Core2 tuning optimizations" }} | ||
20 | {{ input type:"choice" val:"tune_corei7" msg:"Corei7 tuning optimizations" }} | ||
21 | {{ if tunefile == "tune_core2": }} | ||
22 | DEFAULTTUNE ?= "core2-64" | ||
23 | require conf/machine/include/tune-core2.inc | ||
24 | {{ if tunefile == "tune_corei7": }} | ||
25 | DEFAULTTUNE ?= "corei7-64" | ||
26 | require conf/machine/include/tune-corei7.inc | ||
27 | |||
28 | require conf/machine/include/x86-base.inc | ||
29 | |||
30 | MACHINE_FEATURES += "wifi efi pcbios" | ||
31 | |||
32 | {{ input type:"boolean" name:"xserver" prio:"50" msg:"Do you need support for X? (y/n)" default:"y" }} | ||
33 | |||
34 | {{ if xserver == "y": }} | ||
35 | {{ input type:"choicelist" name:"xserver_choice" prio:"50" msg:"Please select an xserver for this machine:" default:"xserver_i915" }} | ||
36 | |||
37 | {{ input type:"choice" val:"xserver_vesa" msg:"VESA xserver support" }} | ||
38 | {{ input type:"choice" val:"xserver_i915" msg:"i915 xserver support" }} | ||
39 | {{ input type:"choice" val:"xserver_i965" msg:"i965 xserver support" }} | ||
40 | {{ if xserver == "y": }} | ||
41 | XSERVER ?= "${XSERVER_X86_BASE} \ | ||
42 | ${XSERVER_X86_EXT} \ | ||
43 | {{ if xserver == "y" and xserver_choice == "xserver_vesa": }} | ||
44 | ${XSERVER_X86_VESA} \ | ||
45 | {{ if xserver == "y" and xserver_choice == "xserver_i915": }} | ||
46 | ${XSERVER_X86_I915} \ | ||
47 | {{ if xserver == "y" and xserver_choice == "xserver_i965": }} | ||
48 | ${XSERVER_X86_I965} \ | ||
49 | {{ if xserver == "y": }} | ||
50 | " | ||
51 | |||
52 | MACHINE_EXTRA_RRECOMMENDS += "linux-firmware v86d" | ||
53 | |||
54 | EXTRA_OECONF_append_pn-matchbox-panel-2 = " --with-battery=acpi" | ||
55 | |||
56 | {{ if xserver == "y" and xserver_choice == "xserver_vesa": }} | ||
57 | APPEND += "video=vesafb vga=0x318" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall new file mode 100644 index 0000000000..b442d02d57 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-dirname {{=machine}} | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf new file mode 100644 index 0000000000..ac9a0f1bb0 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{ if xserver == "y": }} this | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend new file mode 100644 index 0000000000..30830031ed --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend | |||
@@ -0,0 +1,2 @@ | |||
1 | # yocto-bsp-filename {{ if xserver == "y": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files.noinstall b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files.noinstall new file mode 100644 index 0000000000..1e0d92c55c --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files.noinstall | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-preempt-rt.scc b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-preempt-rt.scc new file mode 100644 index 0000000000..fd5320ba1e --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-preempt-rt.scc | |||
@@ -0,0 +1,16 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-preempt-rt.scc | ||
2 | define KMACHINE {{=machine}} | ||
3 | define KTYPE preempt-rt | ||
4 | define KARCH x86_64 | ||
5 | |||
6 | include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} | ||
7 | {{ if need_new_kbranch == "y": }} | ||
8 | branch {{=machine}} | ||
9 | |||
10 | include {{=machine}}.scc | ||
11 | |||
12 | # default policy for preempt-rt kernels | ||
13 | include cfg/usb-mass-storage.scc | ||
14 | include cfg/boot-live.scc | ||
15 | include features/latencytop/latencytop.scc | ||
16 | include features/profiling/profiling.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-standard.scc b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-standard.scc new file mode 100644 index 0000000000..569f967c6a --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-standard.scc | |||
@@ -0,0 +1,16 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-standard.scc | ||
2 | define KMACHINE {{=machine}} | ||
3 | define KTYPE standard | ||
4 | define KARCH x86_64 | ||
5 | |||
6 | include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} | ||
7 | {{ if need_new_kbranch == "y": }} | ||
8 | branch {{=machine}} | ||
9 | |||
10 | include {{=machine}}.scc | ||
11 | |||
12 | # default policy for standard kernels | ||
13 | include cfg/usb-mass-storage.scc | ||
14 | include cfg/boot-live.scc | ||
15 | include features/latencytop/latencytop.scc | ||
16 | include features/profiling/profiling.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-tiny.scc b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-tiny.scc new file mode 100644 index 0000000000..fb21432a4f --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-tiny.scc | |||
@@ -0,0 +1,10 @@ | |||
1 | # yocto-bsp-filename {{=machine}}-tiny.scc | ||
2 | define KMACHINE {{=machine}} | ||
3 | define KTYPE tiny | ||
4 | define KARCH x86_64 | ||
5 | |||
6 | include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} | ||
7 | {{ if need_new_kbranch == "y": }} | ||
8 | branch {{=machine}} | ||
9 | |||
10 | include {{=machine}}.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-config.cfg new file mode 100644 index 0000000000..47489e44e9 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-config.cfg | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{=machine}}-user-config.cfg | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-features.scc b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-features.scc new file mode 100644 index 0000000000..582759e612 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-features.scc | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{=machine}}-user-features.scc | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-patches.scc new file mode 100644 index 0000000000..97f747fa07 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-patches.scc | |||
@@ -0,0 +1 @@ | |||
# yocto-bsp-filename {{=machine}}-user-patches.scc | |||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine.cfg b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine.cfg new file mode 100644 index 0000000000..3290ddefe7 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine.cfg | |||
@@ -0,0 +1,48 @@ | |||
1 | # yocto-bsp-filename {{=machine}}.cfg | ||
2 | CONFIG_PRINTK=y | ||
3 | |||
4 | # Basic hardware support for the box - network, USB, PCI, sound | ||
5 | CONFIG_NETDEVICES=y | ||
6 | CONFIG_ATA=y | ||
7 | CONFIG_ATA_GENERIC=y | ||
8 | CONFIG_ATA_SFF=y | ||
9 | CONFIG_PCI=y | ||
10 | CONFIG_MMC=y | ||
11 | CONFIG_MMC_SDHCI=y | ||
12 | CONFIG_USB_SUPPORT=y | ||
13 | CONFIG_USB=y | ||
14 | CONFIG_USB_ARCH_HAS_EHCI=y | ||
15 | CONFIG_R8169=y | ||
16 | CONFIG_PATA_SCH=y | ||
17 | CONFIG_MMC_SDHCI_PCI=y | ||
18 | CONFIG_USB_EHCI_HCD=y | ||
19 | CONFIG_PCIEPORTBUS=y | ||
20 | CONFIG_NET=y | ||
21 | CONFIG_USB_UHCI_HCD=y | ||
22 | CONFIG_BLK_DEV_SD=y | ||
23 | CONFIG_CHR_DEV_SG=y | ||
24 | CONFIG_SOUND=y | ||
25 | CONFIG_SND=y | ||
26 | CONFIG_SND_HDA_INTEL=y | ||
27 | |||
28 | # Make sure these are on, otherwise the bootup won't be fun | ||
29 | CONFIG_EXT3_FS=y | ||
30 | CONFIG_UNIX=y | ||
31 | CONFIG_INET=y | ||
32 | CONFIG_MODULES=y | ||
33 | CONFIG_SHMEM=y | ||
34 | CONFIG_TMPFS=y | ||
35 | CONFIG_PACKET=y | ||
36 | |||
37 | CONFIG_I2C=y | ||
38 | CONFIG_AGP=y | ||
39 | CONFIG_PM=y | ||
40 | CONFIG_ACPI=y | ||
41 | CONFIG_INPUT=y | ||
42 | |||
43 | # Needed for booting (and using) USB memory sticks | ||
44 | CONFIG_BLK_DEV_LOOP=y | ||
45 | CONFIG_NLS_CODEPAGE_437=y | ||
46 | CONFIG_NLS_ISO8859_1=y | ||
47 | |||
48 | CONFIG_RD_GZIP=y | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine.scc b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine.scc new file mode 100644 index 0000000000..9b7c291a8f --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine.scc | |||
@@ -0,0 +1,14 @@ | |||
1 | # yocto-bsp-filename {{=machine}}.scc | ||
2 | kconf hardware {{=machine}}.cfg | ||
3 | |||
4 | include features/serial/8250.scc | ||
5 | {{ if xserver == "y" and xserver_choice == "xserver_vesa": }} | ||
6 | include cfg/vesafb.scc | ||
7 | {{ if xserver == "y" and xserver_choice == "xserver_i915" or xserver_choice == "xserver_i965": }} | ||
8 | include features/i915/i915.scc | ||
9 | |||
10 | include cfg/usb-mass-storage.scc | ||
11 | include features/power/intel.scc | ||
12 | |||
13 | kconf hardware {{=machine}}-user-config.cfg | ||
14 | include {{=machine}}-user-patches.scc | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall new file mode 100644 index 0000000000..a04e6c7852 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall | |||
@@ -0,0 +1,5 @@ | |||
1 | {{ if kernel_choice != "custom": }} | ||
2 | {{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.14) kernel? (y/n)" default:"y"}} | ||
3 | |||
4 | {{ if kernel_choice != "custom" and use_default_kernel == "n": }} | ||
5 | {{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.14"}} | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-dev.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-dev.bbappend new file mode 100644 index 0000000000..2fa6231cbf --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-dev.bbappend | |||
@@ -0,0 +1,26 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
8 | |||
9 | {{ if need_new_kbranch == "y": }} | ||
10 | {{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
11 | |||
12 | {{ if need_new_kbranch == "n": }} | ||
13 | {{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} | ||
14 | |||
15 | {{ if need_new_kbranch == "n": }} | ||
16 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
17 | |||
18 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}} | ||
19 | {{ if smp == "y": }} | ||
20 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
21 | |||
22 | SRC_URI += "file://{{=machine}}-standard.scc \ | ||
23 | file://{{=machine}}-user-config.cfg \ | ||
24 | file://{{=machine}}-user-patches.scc \ | ||
25 | file://{{=machine}}-user-features.scc \ | ||
26 | " | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend new file mode 100644 index 0000000000..39bc72d9c4 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.10": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-preempt-rt.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb" | ||
32 | #SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f" | ||
33 | #LINUX_VERSION = "3.10.9" \ No newline at end of file | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend new file mode 100644 index 0000000000..f04dd0cce4 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.10": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-tiny.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" | ||
32 | #SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" | ||
33 | #LINUX_VERSION = "3.10.9" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend new file mode 100644 index 0000000000..471ccbcc3e --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.14": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-tiny.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" | ||
32 | #SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" | ||
33 | #LINUX_VERSION = "3.14" | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.10.bbappend new file mode 100644 index 0000000000..e21a333fa4 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.10.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.10": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-standard.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "b170394a475b96ecc92cbc9e4b002bed0a9f69c5" | ||
32 | #SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "c2ed0f16fdec628242a682897d5d86df4547cf24" | ||
33 | #LINUX_VERSION = "3.10.9" \ No newline at end of file | ||
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.14.bbappend new file mode 100644 index 0000000000..ca0b497ff4 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.14.bbappend | |||
@@ -0,0 +1,33 @@ | |||
1 | # yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.14": }} this | ||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | PR := "${PR}.1" | ||
5 | |||
6 | COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" | ||
7 | |||
8 | {{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} | ||
9 | |||
10 | {{ if need_new_kbranch == "y": }} | ||
11 | {{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }} | ||
12 | |||
13 | {{ if need_new_kbranch == "n": }} | ||
14 | {{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }} | ||
15 | |||
16 | {{ if need_new_kbranch == "n": }} | ||
17 | KBRANCH_{{=machine}} = "{{=existing_kbranch}}" | ||
18 | |||
19 | {{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} | ||
20 | {{ if smp == "y": }} | ||
21 | KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" | ||
22 | |||
23 | SRC_URI += "file://{{=machine}}-standard.scc \ | ||
24 | file://{{=machine}}-user-config.cfg \ | ||
25 | file://{{=machine}}-user-patches.scc \ | ||
26 | file://{{=machine}}-user-features.scc \ | ||
27 | " | ||
28 | |||
29 | # uncomment and replace these SRCREVs with the real commit ids once you've had | ||
30 | # the appropriate changes committed to the upstream linux-yocto repo | ||
31 | #SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" | ||
32 | #SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" | ||
33 | #LINUX_VERSION = "3.14" | ||
diff --git a/scripts/lib/bsp/tags.py b/scripts/lib/bsp/tags.py new file mode 100644 index 0000000000..3719427884 --- /dev/null +++ b/scripts/lib/bsp/tags.py | |||
@@ -0,0 +1,49 @@ | |||
1 | # ex:ts=4:sw=4:sts=4:et | ||
2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | ||
3 | # | ||
4 | # Copyright (c) 2012, Intel Corporation. | ||
5 | # All rights reserved. | ||
6 | # | ||
7 | # This program is free software; you can redistribute it and/or modify | ||
8 | # it under the terms of the GNU General Public License version 2 as | ||
9 | # published by the Free Software Foundation. | ||
10 | # | ||
11 | # This program is distributed in the hope that it will be useful, | ||
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | # GNU General Public License for more details. | ||
15 | # | ||
16 | # You should have received a copy of the GNU General Public License along | ||
17 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | # | ||
20 | # DESCRIPTION | ||
21 | # This module provides a place to define common constants for the | ||
22 | # Yocto BSP Tools. | ||
23 | # | ||
24 | # AUTHORS | ||
25 | # Tom Zanussi <tom.zanussi (at] intel.com> | ||
26 | # | ||
27 | |||
28 | OPEN_TAG = "{{" | ||
29 | CLOSE_TAG = "}}" | ||
30 | ASSIGN_TAG = "{{=" | ||
31 | INPUT_TAG = "input" | ||
32 | IF_TAG = "if" | ||
33 | FILENAME_TAG = "yocto-bsp-filename" | ||
34 | DIRNAME_TAG = "yocto-bsp-dirname" | ||
35 | |||
36 | INDENT_STR = " " | ||
37 | |||
38 | BLANKLINE_STR = "of.write(\"\\n\")" | ||
39 | NORMAL_START = "of.write" | ||
40 | OPEN_START = "current_file =" | ||
41 | |||
42 | INPUT_TYPE_PROPERTY = "type" | ||
43 | |||
44 | SRC_URI_FILE = "file://" | ||
45 | |||
46 | GIT_CHECK_URI = "git://git.yoctoproject.org/linux-yocto-dev.git" | ||
47 | |||
48 | |||
49 | |||