blob: 328e4f4d127d65071bbd86235df1ec1c96a90cf7 [file] [log] [blame]
Eric Park5e3a1012019-08-12 13:17:03 +08001
2
3
4
5<!doctype html>
6<html lang="en" class="no-js">
7 <head>
8
9 <meta charset="utf-8">
10 <meta name="viewport" content="width=device-width,initial-scale=1">
11 <meta http-equiv="x-ua-compatible" content="ie=edge">
12
13
14
15
16 <meta name="lang:clipboard.copy" content="Copy to clipboard">
17
18 <meta name="lang:clipboard.copied" content="Copied to clipboard">
19
20 <meta name="lang:search.language" content="en">
21
22 <meta name="lang:search.pipeline.stopwords" content="True">
23
24 <meta name="lang:search.pipeline.trimmer" content="True">
25
26 <meta name="lang:search.result.none" content="No matching documents">
27
28 <meta name="lang:search.result.one" content="1 matching document">
29
30 <meta name="lang:search.result.other" content="# matching documents">
31
32 <meta name="lang:search.tokenizer" content="[\s\-]+">
33
34 <link rel="shortcut icon" href="../../assets/images/favicon.png">
Eric Park45174ca2019-10-21 01:38:33 +080035 <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3">
Eric Park5e3a1012019-08-12 13:17:03 +080036
37
38
39 <title>Build Guide - Team Bliss</title>
40
41
42
Eric Park45174ca2019-10-21 01:38:33 +080043 <link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css">
Eric Park5e3a1012019-08-12 13:17:03 +080044
45
46
47
48 <script src="../../assets/javascripts/modernizr.74668098.js"></script>
49
50
51
52 <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
53 <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback">
54 <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
55
56
57 <link rel="stylesheet" href="../../assets/fonts/material-icons.css">
58
59
60
61
62
63
64 </head>
65
66 <body dir="ltr">
67
68 <svg class="md-svg">
69 <defs>
70
71
72 </defs>
73 </svg>
74 <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
75 <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
76 <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
77
78 <a href="#build-guide" tabindex="1" class="md-skip">
79 Skip to content
80 </a>
81
82
83 <header class="md-header" data-md-component="header">
84 <nav class="md-header-nav md-grid">
85 <div class="md-flex">
86 <div class="md-flex__cell md-flex__cell--shrink">
87 <a href="../.." title="Team Bliss" class="md-header-nav__button md-logo">
88
89 <i class="md-icon"></i>
90
91 </a>
92 </div>
93 <div class="md-flex__cell md-flex__cell--shrink">
94 <label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
95 </div>
96 <div class="md-flex__cell md-flex__cell--stretch">
97 <div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
98
99 <span class="md-header-nav__topic">
100 Team Bliss
101 </span>
102 <span class="md-header-nav__topic">
103
104 Build Guide
105
106 </span>
107
108 </div>
109 </div>
110 <div class="md-flex__cell md-flex__cell--shrink">
111
112 <label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
113
114<div class="md-search" data-md-component="search" role="dialog">
115 <label class="md-search__overlay" for="__search"></label>
116 <div class="md-search__inner" role="search">
117 <form class="md-search__form" name="search">
118 <input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
119 <label class="md-icon md-search__icon" for="__search"></label>
120 <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
121 &#xE5CD;
122 </button>
123 </form>
124 <div class="md-search__output">
125 <div class="md-search__scrollwrap" data-md-scrollfix>
126 <div class="md-search-result" data-md-component="result">
127 <div class="md-search-result__meta">
128 Type to start searching
129 </div>
130 <ol class="md-search-result__list"></ol>
131 </div>
132 </div>
133 </div>
134 </div>
135</div>
136
137 </div>
138
139 </div>
140 </nav>
141</header>
142
143 <div class="md-container">
144
145
146
147
Eric Park45174ca2019-10-21 01:38:33 +0800148 <main class="md-main" role="main">
Eric Park5e3a1012019-08-12 13:17:03 +0800149 <div class="md-main__inner md-grid" data-md-component="container">
150
151
152 <div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
153 <div class="md-sidebar__scrollwrap">
154 <div class="md-sidebar__inner">
155 <nav class="md-nav md-nav--primary" data-md-level="0">
156 <label class="md-nav__title md-nav__title--site" for="__drawer">
157 <a href="../.." title="Team Bliss" class="md-nav__button md-logo">
158
159 <i class="md-icon"></i>
160
161 </a>
162 Team Bliss
163 </label>
164
165 <ul class="md-nav__list" data-md-scrollfix>
166
167
168
169
170
171
172 <li class="md-nav__item">
173 <a href="../.." title="Home" class="md-nav__link">
174 Home
175 </a>
176 </li>
177
178
179
180
181
182
183
184
185
186 <li class="md-nav__item md-nav__item--active md-nav__item--nested">
187
188 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-2" type="checkbox" id="nav-2" checked>
189
190 <label class="md-nav__link" for="nav-2">
191 Bliss OS
192 </label>
193 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
194 <label class="md-nav__title" for="nav-2">
195 Bliss OS
196 </label>
197 <ul class="md-nav__list" data-md-scrollfix>
198
199
200
201
202
203
204
205 <li class="md-nav__item">
206 <a href="../" title="Index" class="md-nav__link">
207 Index
208 </a>
209 </li>
210
211
212
213
214
215
216
217
218
219 <li class="md-nav__item md-nav__item--active">
220
221 <input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
222
223
224
225
226 <label class="md-nav__link md-nav__link--active" for="__toc">
227 Build Guide
228 </label>
229
230 <a href="./" title="Build Guide" class="md-nav__link md-nav__link--active">
231 Build Guide
232 </a>
233
234
235<nav class="md-nav md-nav--secondary">
236
237
238
239
240
241 <label class="md-nav__title" for="__toc">Table of contents</label>
242 <ul class="md-nav__list" data-md-scrollfix>
243
244 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800245 <a href="#introduction" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800246 Introduction
247 </a>
248
249</li>
250
251 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800252 <a href="#preparation" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800253 Preparation
254 </a>
255
256</li>
257
258 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800259 <a href="#install-the-jdk" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800260 Install the JDK
261 </a>
262
263</li>
264
265 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800266 <a href="#install-build-tools" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800267 Install build tools
268 </a>
269
270</li>
271
272 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800273 <a href="#install-source-code-tools" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800274 Install source code tools
275 </a>
276
277 <nav class="md-nav">
278 <ul class="md-nav__list">
279
280 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800281 <a href="#what-is-source" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800282 What is source?
283 </a>
284
285</li>
286
287 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800288 <a href="#what-if-i-need-repo-globally" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800289 What if I need repo globally?
290 </a>
291
292</li>
293
294 </ul>
295 </nav>
296
297</li>
298
299 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800300 <a href="#download" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800301 Download
302 </a>
303
304 <nav class="md-nav">
305 <ul class="md-nav__list">
306
307 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800308 <a href="#i-still-dont-know-how-much-cpu-threads-i-have-how-do-i-check" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800309 I still don't know how much CPU threads I have. How do I check?
310 </a>
311
312</li>
313
314 </ul>
315 </nav>
316
317</li>
318
319 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800320 <a href="#easy-build-instructions" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800321 Easy Build Instructions
322 </a>
323
324</li>
325
326 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800327 <a href="#advanced-build-instructions" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800328 Advanced Build Instructions
329 </a>
330
331 <nav class="md-nav">
332 <ul class="md-nav__list">
333
334 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800335 <a href="#my-device-isnt-booting-and-userdebug-wont-print-any-adb-logcats-what-gives" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800336 My device isn't booting, and userdebug won't print any adb logcats. What gives?
337 </a>
338
339</li>
340
341 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800342 <a href="#why-mka-and-not-make" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800343 Why mka and not make?
344 </a>
345
346</li>
347
348 </ul>
349 </nav>
350
351</li>
352
353 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800354 <a href="#after-building" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800355 After building
356 </a>
357
358</li>
359
360 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800361 <a href="#changing-the-target-kernel-branch" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800362 Changing the target kernel branch
363 </a>
364
365 <nav class="md-nav">
366 <ul class="md-nav__list">
367
368 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800369 <a href="#switching-the-kernel-branch" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800370 Switching the kernel branch
371 </a>
372
373</li>
374
375 </ul>
376 </nav>
377
378</li>
379
380 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800381 <a href="#using-the-patch-system-for-testing" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800382 Using the patch system for testing
383 </a>
384
385</li>
386
387 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800388 <a href="#troubleshooting" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800389 Troubleshooting
390 </a>
391
392</li>
393
394 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800395 <a href="#conclusion" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800396 Conclusion
397 </a>
398
399</li>
400
401
402
403
404
405 </ul>
406
407</nav>
408
409 </li>
410
411
412
413
414
415
416
417 <li class="md-nav__item">
418 <a href="../extras/" title="Extras" class="md-nav__link">
419 Extras
420 </a>
421 </li>
422
423
424
425
426
427
428
429 <li class="md-nav__item">
430 <a href="../installation-guide/" title="Installation Guide" class="md-nav__link">
431 Installation Guide
432 </a>
433 </li>
434
435
436
437
438
439
440
441 <li class="md-nav__item">
442 <a href="../troubleshooting/" title="Troubleshooting" class="md-nav__link">
443 Troubleshooting
444 </a>
445 </li>
446
447
448 </ul>
449 </nav>
450 </li>
451
452
453
454
455
456
457
458 <li class="md-nav__item md-nav__item--nested">
459
460 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3">
461
462 <label class="md-nav__link" for="nav-3">
463 BlissRoms
464 </label>
465 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
466 <label class="md-nav__title" for="nav-3">
467 BlissRoms
468 </label>
469 <ul class="md-nav__list" data-md-scrollfix>
470
471
472
473
474
475
476
477 <li class="md-nav__item">
478 <a href="../../BlissRoms/" title="Index" class="md-nav__link">
479 Index
480 </a>
481 </li>
482
483
484
485
486
487
488
489 <li class="md-nav__item">
490 <a href="../../BlissRoms/build-guide/" title="Build Guide" class="md-nav__link">
491 Build Guide
492 </a>
493 </li>
494
495
496
497
498
499
500
501 <li class="md-nav__item">
502 <a href="../../BlissRoms/build-tips/" title="Build Tips" class="md-nav__link">
503 Build Tips
504 </a>
505 </li>
506
507
508 </ul>
509 </nav>
510 </li>
511
512
513
514
515
516
517
518 <li class="md-nav__item md-nav__item--nested">
519
520 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4">
521
522 <label class="md-nav__link" for="nav-4">
523 Common
524 </label>
525 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
526 <label class="md-nav__title" for="nav-4">
527 Common
528 </label>
529 <ul class="md-nav__list" data-md-scrollfix>
530
531
532
533
534
535
536
537 <li class="md-nav__item">
538 <a href="../../common/" title="Index" class="md-nav__link">
539 Index
540 </a>
541 </li>
542
543
544
545
546
547
548
549 <li class="md-nav__item">
550 <a href="../../common/git-started/" title="Git Started" class="md-nav__link">
551 Git Started
552 </a>
553 </li>
554
555
556
557
558
559
560
561 <li class="md-nav__item">
Eric Park8584eda2019-09-02 09:45:55 +0800562 <a href="../../common/maintaining-proper-authorship/" title="Maintaining proper authorship" class="md-nav__link">
563 Maintaining proper authorship
564 </a>
565 </li>
566
567
568
569
570
571
572
573 <li class="md-nav__item">
Eric Park5e3a1012019-08-12 13:17:03 +0800574 <a href="../../common/using-dippy-bird/" title="Using `dippy-bird`" class="md-nav__link">
575 Using `dippy-bird`
576 </a>
577 </li>
578
579
580 </ul>
581 </nav>
582 </li>
583
584
585
586
587
588
589
590 <li class="md-nav__item md-nav__item--nested">
591
592 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
593
594 <label class="md-nav__link" for="nav-5">
595 Infrastructure
596 </label>
597 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
598 <label class="md-nav__title" for="nav-5">
599 Infrastructure
600 </label>
601 <ul class="md-nav__list" data-md-scrollfix>
602
603
604
605
606
607
608
609 <li class="md-nav__item">
610 <a href="../../infrastructure/" title="Index" class="md-nav__link">
611 Index
612 </a>
613 </li>
614
615
616 </ul>
617 </nav>
618 </li>
619
620
621 </ul>
622</nav>
623 </div>
624 </div>
625 </div>
626
627
628 <div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
629 <div class="md-sidebar__scrollwrap">
630 <div class="md-sidebar__inner">
631
632<nav class="md-nav md-nav--secondary">
633
634
635
636
637
638 <label class="md-nav__title" for="__toc">Table of contents</label>
639 <ul class="md-nav__list" data-md-scrollfix>
640
641 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800642 <a href="#introduction" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800643 Introduction
644 </a>
645
646</li>
647
648 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800649 <a href="#preparation" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800650 Preparation
651 </a>
652
653</li>
654
655 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800656 <a href="#install-the-jdk" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800657 Install the JDK
658 </a>
659
660</li>
661
662 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800663 <a href="#install-build-tools" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800664 Install build tools
665 </a>
666
667</li>
668
669 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800670 <a href="#install-source-code-tools" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800671 Install source code tools
672 </a>
673
674 <nav class="md-nav">
675 <ul class="md-nav__list">
676
677 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800678 <a href="#what-is-source" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800679 What is source?
680 </a>
681
682</li>
683
684 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800685 <a href="#what-if-i-need-repo-globally" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800686 What if I need repo globally?
687 </a>
688
689</li>
690
691 </ul>
692 </nav>
693
694</li>
695
696 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800697 <a href="#download" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800698 Download
699 </a>
700
701 <nav class="md-nav">
702 <ul class="md-nav__list">
703
704 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800705 <a href="#i-still-dont-know-how-much-cpu-threads-i-have-how-do-i-check" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800706 I still don't know how much CPU threads I have. How do I check?
707 </a>
708
709</li>
710
711 </ul>
712 </nav>
713
714</li>
715
716 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800717 <a href="#easy-build-instructions" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800718 Easy Build Instructions
719 </a>
720
721</li>
722
723 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800724 <a href="#advanced-build-instructions" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800725 Advanced Build Instructions
726 </a>
727
728 <nav class="md-nav">
729 <ul class="md-nav__list">
730
731 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800732 <a href="#my-device-isnt-booting-and-userdebug-wont-print-any-adb-logcats-what-gives" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800733 My device isn't booting, and userdebug won't print any adb logcats. What gives?
734 </a>
735
736</li>
737
738 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800739 <a href="#why-mka-and-not-make" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800740 Why mka and not make?
741 </a>
742
743</li>
744
745 </ul>
746 </nav>
747
748</li>
749
750 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800751 <a href="#after-building" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800752 After building
753 </a>
754
755</li>
756
757 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800758 <a href="#changing-the-target-kernel-branch" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800759 Changing the target kernel branch
760 </a>
761
762 <nav class="md-nav">
763 <ul class="md-nav__list">
764
765 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800766 <a href="#switching-the-kernel-branch" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800767 Switching the kernel branch
768 </a>
769
770</li>
771
772 </ul>
773 </nav>
774
775</li>
776
777 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800778 <a href="#using-the-patch-system-for-testing" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800779 Using the patch system for testing
780 </a>
781
782</li>
783
784 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800785 <a href="#troubleshooting" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800786 Troubleshooting
787 </a>
788
789</li>
790
791 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800792 <a href="#conclusion" class="md-nav__link">
Eric Park5e3a1012019-08-12 13:17:03 +0800793 Conclusion
794 </a>
795
796</li>
797
798
799
800
801
802 </ul>
803
804</nav>
805 </div>
806 </div>
807 </div>
808
809
810 <div class="md-content">
811 <article class="md-content__inner md-typeset">
812
813
814
815 <h1 id="build-guide">Build Guide</h1>
816<h2 id="introduction">Introduction</h2>
817<p>This is the official guide to build Bliss OS for PCs. In this guide, we will only cover building for x86 &amp; x86_64 devices. We will also go over the details of using the patch system for testing and recompiling a build with a different kernel branch.</p>
818<p>The golden rule to building is patience. If something breaks, pay attention to the console output or take logs of the issue and ask for guidance in our build support chat.</p>
819<p>Let’s get started.</p>
820<h2 id="preparation">Preparation</h2>
821<p>To get started, you need a computer with Ubuntu 18.04 (LTS), at least 200GB space of HDD, and at least 8GB RAM. A decent CPU (or CPUs if you have a server motherboard) is recommended. Other distros can work but is not officially supported in this guide.</p>
822<p>Underpowered machines may crash during compilation. If that happens, you may try and restart the build as most crashes are caused by lack of memory. If your storage space has run out, then you will need to build on a different hard drive.</p>
823<h2 id="install-the-jdk">Install the JDK</h2>
824<p>Install OpenJDK:</p>
825<pre><code>sudo apt install openjdk-8-jdk
826</code></pre>
827<h2 id="install-build-tools">Install build tools</h2>
828<p>To install the required build tools, run the following command:</p>
829<pre><code>sudo apt-get install git-core gnupg flex bison maven gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip squashfs-tools python-mako libssl-dev ninja-build lunzip syslinux syslinux-utils gettext genisoimage gettext bc xorriso libncurses5
830</code></pre>
831<h2 id="install-source-code-tools">Install source code tools</h2>
832<p>Now we need to get the source code via a program named <code>repo</code>, made by Google. The primary function of <code>repo</code> is to read a manifest file located in Bliss OS's GitHub organization, and find what repositories you need to actually build Android.</p>
833<p>Create a <code>~/bin</code> directory for <code>repo</code>:</p>
834<pre><code>mkdir -p ~/bin
835</code></pre>
836<p>The <code>-p</code> flag instructs <code>mkdir</code> to <em>only</em> create the directory if it does not exist in the first place. Now download the <code>repo</code> tool into <code>~/bin</code>:</p>
837<pre><code>curl https://storage.googleapis.com/git-repo-downloads/repo &gt; ~/bin/repo
838</code></pre>
839<p>Make <code>repo</code> executable:</p>
840<pre><code>chmod a+x ~/bin/repo
841</code></pre>
842<p>And add it to PATH:</p>
843<pre><code>nano .bashrc
844</code></pre>
845<p>Scroll to the end of the file and type these lines:</p>
846<pre><code># Export ~/bin
847export PATH=~/bin:$PATH
848</code></pre>
849<p>Ctrl-O and enter to save, then Ctrl-X to exit nano. Now either logout and login again (or reboot), or <code>source</code> the file:</p>
850<pre><code>source .bashrc
851</code></pre>
852<p>Which can be shortened to:</p>
853<pre><code>. .bashrc
854</code></pre>
855<h3 id="what-is-source">What is <code>source</code>?</h3>
856<p><code>source</code> is a <code>bash</code> command to read aliases, functions, and commands from the specified file. Typically, you'll supply <code>bash</code> with a configuration file such as <code>.bashrc</code> or <code>.bash_profile</code>, or an initialization file such as <code>envsetup.sh</code>. The difference is that while the configuration file lists configuration and user-defined aliases and functions, initialization files typically hold build commands such as <code>breakfast</code>, <code>brunch</code>, and <code>lunch</code>. Without those commands building would be significantly harder as you would have to memorize the long command to invoke a build manually!</p>
857<p>But why do you need to run it after modifying a file? Well, <code>bash</code> cannot automatically detect changes in our files. To solve this, we either <code>source</code> it or log out and log back in, forcing <code>bash</code> to reload configuration files. Keep this in mind, because unlike configuration files, if you forget to <code>source</code> initialization files, build commands will not function!</p>
858<h3 id="what-if-i-need-repo-globally">What if I need <code>repo</code> globally?</h3>
859<p>If you need the <code>repo</code> tool to be available anywhere, you will need to first download <code>repo</code> to your home directory, move it with <code>sudo</code> and give it executable permissions. The exact commands are as follows:</p>
860<pre><code>curl https://storage.googleapis.com/git-repo-downloads/repo &gt; ~/repo
861sudo mv ~/repo /usr/bin/
862chmod a+x /usr/bin/repo
863</code></pre>
864<p><code>repo</code> will now work anywhere, without any <code>.bashrc</code> modifications. However, these steps aren’t recommended as <code>repo</code> might become a security risk if a vulnerability is found.</p>
865<p>Now we’re ready to download the source code.</p>
866<h2 id="download">Download</h2>
867<p>Create a directory for the source:</p>
868<pre><code>mkdir -p ~/blissos/p9.0
869cd ~/blissos/p9.0
870</code></pre>
871<p>Before we download, we need to tell <code>repo</code> and <code>git</code> who we are. Run the following commands, substituting your information:</p>
872<pre><code>git config --global user.email “randy.mcrandyface@hotmail.net”
873git config --global user.name “Randy McRandyface”
874</code></pre>
875<p>Now, we’re ready to initialize. We need to tell <code>repo</code> which manifest to read:</p>
876<pre><code>repo init -u https://github.com/BlissRoms-x86/manifest.git -b p9.0-x86
877</code></pre>
878<p><code>-b</code> is for the branch, and we’re on <code>p9.0-x86</code>, Android Pie. It’ll take a couple of seconds. You may need to type <code>y</code> for the color prompt.</p>
879<p>Sync repo :</p>
880<pre><code>repo sync -j24 -c --no-tags --no-clone-bundle
881</code></pre>
882<p>Problems syncing? :</p>
883<pre><code>repo sync -j4 -c --no-tags --no-clone-bundle --force-sync
884</code></pre>
885<p><code>-j</code> is for threads. Typically, your CPU core count is your thread count, unless you’re using an older Intel CPU with hyperthreading. In that case, the thread count is double the count of your CPU cores. Newer CPUs have dropped hyperthreading unless you have the i9, so check how many threads you have. If you have four threads, you would run:</p>
886<pre><code>repo sync -j4 -c
887</code></pre>
888<p><code>-c</code> is for pulling in only the current branch, instead of the entire history. This is useful if you need the downloads fast and don’t want the entire history to be downloaded. This is used by default unless specified otherwise.</p>
889<h3 id="i-still-dont-know-how-much-cpu-threads-i-have-how-do-i-check">I still don't know how much CPU threads I have. How do I check?</h3>
890<p>Run <code>nproc</code>. The output should be something like this:</p>
891<pre><code>mybuildbox@test:~$ nproc
89224
893</code></pre>
894<p>This means that there are 24 threads in your machine.</p>
895<p><code>repo</code> will start downloading all the code. That’s going to be slow, even on a fiber network. Expect downloads to take more than a couple hours.</p>
896<h2 id="easy-build-instructions">Easy Build Instructions</h2>
897<p>This will build an x86 based .ISO for PCs.</p>
898<p>Usage: <code>$ bash build-x86.sh options buildVariants blissBranch extraOptions</code>
899Options:</p>
900<pre><code>-c | --clean : Does make clean &amp;&amp; make clobber and resets the efi device tree
901-s | --sync: Repo syncs the rom (clears out patches), then reapplies patches to needed repos
902-p | --patch: Just applies patches to needed repos
903-r | --proprietary: build needed items from proprietary vendor (non-public)
904</code></pre>
905<p>BuildVariants:</p>
906<pre><code>android_x86-user : Make user build
907android_x86-userdebug |: Make userdebug build
908android_x86-eng : Make eng build
909android_x86_64-user : Make user build
910android_x86_64-userdebug |: Make userdebug build
911android_x86_64-eng : Make eng build
912</code></pre>
913<p>BlissBranch:</p>
914<pre><code>select which bliss branch to sync, default is p9.0
915</code></pre>
916<p>ExtraOptions:</p>
917<pre><code>foss : packages microG &amp; FDroid with the build
918go : packages Gapps Go with the build
919gapps : packages OpenGapps with the build
920gms : packages GMS with the build (requires private repo access)
921none : force all extraOption flags to false.
922</code></pre>
923<p>To start, you must first use the -s (--sync) flag, then on following builds, it is not needed. Initial generation of the proprietary files from ChromeOS are also needed on the first build. We are able to use the -r (--proprietary) flag for that.
924<strong>This step needs to be on its own because the mounting process requires root permissions, so keep a look out for it asking for your root password</strong>.</p>
925<p>First you must sync with the new manifest changes:</p>
926<pre><code>bash build-x86.sh -p
927</code></pre>
928<p>This will do initial patching. Some of the patches will show as <code>already applied</code> or <code>conflict</code>. This is normal behavior and will not effect the build process if you continue to the next step without addressing any of the conflicts.</p>
929<p><strong>The only times you should worry about the conflicts is when you are adding or changing patches in <code>vendor/x86</code></strong>.</p>
930<p>Next step is to download the proprietary files from ChromeOS:</p>
931<pre><code>mkdir vendor/bliss_priv/proprietary
932mkdir vendor/bliss_priv/source
933bash build-x86.sh -r android_x86_64-userdebug
934</code></pre>
935<p>After that, you can build your release file:</p>
936<pre><code>bash build-x86.sh android_x86_64-userdebug (to build the userdebug version for x86_64 CPUs)
937</code></pre>
938<h2 id="advanced-build-instructions">Advanced Build Instructions</h2>
939<p>Set up the build environment:</p>
940<pre><code>. build/envsetup.sh
941</code></pre>
942<p>This is the initialization file we talked about earlier up top. This "initializes" the environment, and imports a bunch of useful build commands required to build your device. Again, you need to remember to <code>source</code> this file every time you log out and log back in, or launch a new <code>bash</code>/Terminal instance.</p>
943<p>Define what device you’re going to build. For example, the Nexus 5X, has a codename of <code>bullhead</code>. You can check your specific device's codename on GitHub or on Google. Execute:</p>
944<p>For 32 bit devices:</p>
945<pre><code>lunch android_x86-userdebug
946</code></pre>
947<p>For 64 bit devices:</p>
948<pre><code>lunch android_x86_64-userdebug
949</code></pre>
950<p>Let's break down the command. <code>lunch</code> initializes the proper environmental variables required for the build tools to build your specific device. Things like <code>BLISS_DEVICE</code> and other variables are set in this stage, and the changed variables will be shown as output. <code>x86</code> or <code>x86_64</code> is the specific device we are building. Finally, <code>userdebug</code> means that we will build a user-debuggable variant. This is usually what most ROMs use for publishing their builds. Manufacturers typically use <code>user</code> which disables most of the useful Android Logcats.</p>
951<h3 id="my-device-isnt-booting-and-userdebug-wont-print-any-adb-logcats-what-gives">My device isn't booting, and <code>userdebug</code> won't print any <code>adb logcat</code>s. What gives?</h3>
952<p>There is a third build variant called <code>eng</code>, short for engineering builds. These builds will activate <code>adb logcat</code> during boot, and will show you exactly what is going wrong, where, and why. However, these builds are <strong>NOT</strong> recommended for normal usage as they are not securely hardened, have log spam that will slow down your device, and other unexpected problems like userspace utilities crashing during runtime. If you want to submit your device for mainline, do <strong>NOT</strong> submit an <code>eng</code> build!</p>
953<p>If this is the first time you're running the build, you're going to want to run the proprietary build command first from the easy build instructions. Alternatively, you could also run those commands manually.</p>
954<pre><code>mkdir vendor/bliss_priv/proprietary &amp;&amp; mkdir vendor/bliss_priv/source
955</code></pre>
956<p>Then:</p>
957<pre><code>lunch android_x86_64-userdebug
958mka update_engine_applier
959mka proprietary
960</code></pre>
961<p>After that is complete, we can start the main building process. Run:</p>
962<p><code>mka iso_img</code></p>
963<p>And the build should start. The build process will take a long time. Prepare to wait a few hours, even on a decent machine.</p>
964<h3 id="why-mka-and-not-make">Why <code>mka</code> and not <code>make</code>?</h3>
965<p><code>make</code> only runs with 1 thread. <code>mka</code> is properly aliased to use all of your threads by checking <code>nproc</code>.</p>
966<p>If you want to customize your thread count (maybe you're building with a fan-screaming laptop in a quiet coffee shop), use <code>make -j#</code>, replacing the hash with the number of threads (example of <code>make -j4</code>).</p>
967<h2 id="after-building">After building</h2>
968<p>There are two outcomes to a build - either it fails and you get a red error message from <code>make</code>, or it succeeds and you see the Bliss logo in ASCII. If you encounter the former, you need to go back and fix whatever it's complaining about. Typically, 90% of the time the problem will be in your device tree. For the other 10%, submit a bug report to the ROM developers. Be sure to include the full log of your build to help diagnose the problem, and your device tree.</p>
969<p>If you face the latter, congratulations! You've successfully built BlissRoms for your device. Grab the artifacts for your device:</p>
970<pre><code>cd out/target/product/x86_64/
971</code></pre>
972<p>In here, you’ll find an <code>.iso</code> that goes along the lines of <code>Bliss-v11.9--OFFICIAL-20190801-1619_x86_64_k-k4.9.153_m-18.3.5-pie-x86-llvm80_f-dev-kernel.org.iso</code>.</p>
973<h2 id="changing-the-target-kernel-branch">Changing the target kernel branch</h2>
974<p>Sometimes, you might be working on a device that requires a different kernel branch. In order to switch kernels effectively on Bliss OS, they need to be compiled with the OS at build time.</p>
975<h3 id="switching-the-kernel-branch">Switching the kernel branch</h3>
976<p>Start off by entering the kernel folder</p>
977<pre><code>cd kernel
978</code></pre>
979<p>Then pull all the available kernel branched from your target repo. In this case, we are using the default <code>BR-x86</code> repo</p>
980<pre><code>git fetch BR-x86
981</code></pre>
982<p>Then after that is finished, we need to checkout our target branch, and in this example we are choosing our <code>k4.19.50-ax86-ga</code> branch, which has added commits from the GalliumOS project for Chromebooks</p>
983<pre><code>git checkout BR-x86/k4.19.50-ax86-ga
984</code></pre>
985<p>Next step is to clean out any configs or generated files from the previously checked out kernel. To do this, run these commands</p>
986<pre><code>make clean
987make mrproper
988</code></pre>
989<p>Once that is done, we can <code>cd</code> back to our main project folder</p>
990<pre><code>cd ..
991</code></pre>
992<p>And run our build command again to generate the <code>.iso</code> with the target kernel we selected</p>
993<pre><code>rm -rf out/target/product/x86_64/kernel
994mka iso_img
995</code></pre>
996<h2 id="using-the-patch-system-for-testing">Using the patch system for testing</h2>
997<p>We use a patching method we adapted for Bliss from Intel's Project Celadon &amp; phh-treble. This patching system allows us to bring in a good number of commits to add to the OS, and test how they apply or if there are any conflicts.</p>
998<p>Our intention was to make a system that can add all the needed x86/x86_64 commits to BlissROM, as well as other ROMs too.</p>
999<p>The majority of this system is found in <code>vendor/x86/utils</code>.</p>
1000<p>From here, you simply generate the <code>.patch</code> files from your additions, and add them to the mix.
1001In the following example, we are going to generate patches from <code>packages/apps/Settings</code> and add them to the proper folder for live testing.</p>
1002<p>From your Project folder:</p>
1003<pre><code>cd packages/apps/Settings
1004</code></pre>
1005<p>And generate your <code>.patch</code> files. For this example, we've added four commits on top of what was there after sync</p>
1006<pre><code>git format-patch -4
1007</code></pre>
1008<p>Then copy those files to the proper folder in <code>vendor/x86</code>. In this case, you will find it here:</p>
1009<pre><code>vendor/x86/utils/android_p/google_diff/x86
1010</code></pre>
1011<p>After that is complete, you can <code>make clean</code> and run the patch system from your main project folder.</p>
1012<pre><code>make clean
1013bash build-x86.sh -p
1014</code></pre>
1015<p>This should start patching all the source files. Once that is complete, you can rebuild.</p>
1016<h2 id="troubleshooting">Troubleshooting</h2>
1017<p>If your build failed, there are a couple things you can try.</p>
1018<ul>
1019<li>Try a fresh <code>repo sync</code> to make your repository up to date. Sometimes, the Internet connection between you and GitHub can be flaky. In rare cases a commit merge might be ongoing, and you might've grabbed an incomplete merge. Mostly, this should fix the issue 70% of the time.</li>
1020<li>Make sure your dependencies are installed correctly. Error messages help out a lot here! Often it will say <code>shared/linked library not found</code> or something along those lines.</li>
1021<li>Make sure you sourced <code>build/envsetup.sh</code>. This is especially common and worth suspecting if none of the build commands like <code>breakfast</code> and <code>lunch</code> work. If you have <code>repo sync</code>ed do this again.</li>
1022<li>Make sure you’re at the root of the build tree. Again, to quickly jump there, use <code>croot</code>.</li>
1023<li>Make sure your computer itself isn’t faulty. HDDs usually die first, followed by RAM. SSDs rarely die but failure is not unheard of. In extremely rare cases, your CPU may have a defect. If you're unsure, run a stress test using a program like Prime95.</li>
1024</ul>
1025<p>If something goes wrong and you've tried everything above, first use Google to look up your error! Most of the errors you encounter is due to misconfiguration and wrong commands entered. More often than not, Google will have the answer you are looking for. If you're still stuck and nothing fixes the problem, then ask us via our Telegram Build Support chat.</p>
1026<h2 id="conclusion">Conclusion</h2>
1027<p>Building a ROM is very hard and tedious and the results are very rewarding! If you managed to follow along, congratulations!</p>
1028<p>After you finish building, you can try out the Git Started guide. Make changes, commit, and send them off to our GitHub for Bliss OS repos &amp; our Gerrit for review on BlissROMs repos! Or better yet, download experimental commits not ready for the mainline repositories and review them! Again, ROM building is a fun project you can work with. I hope this guide was a lot of fun to run through!</p>
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038 </article>
1039 </div>
1040 </div>
1041 </main>
1042
1043
1044<footer class="md-footer">
1045
1046 <div class="md-footer-nav">
1047 <nav class="md-footer-nav__inner md-grid">
1048
1049 <a href="../" title="Index" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
1050 <div class="md-flex__cell md-flex__cell--shrink">
1051 <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
1052 </div>
1053 <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
1054 <span class="md-flex__ellipsis">
1055 <span class="md-footer-nav__direction">
1056 Previous
1057 </span>
1058 Index
1059 </span>
1060 </div>
1061 </a>
1062
1063
1064 <a href="../extras/" title="Extras" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
1065 <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
1066 <span class="md-flex__ellipsis">
1067 <span class="md-footer-nav__direction">
1068 Next
1069 </span>
1070 Extras
1071 </span>
1072 </div>
1073 <div class="md-flex__cell md-flex__cell--shrink">
1074 <i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
1075 </div>
1076 </a>
1077
1078 </nav>
1079 </div>
1080
1081 <div class="md-footer-meta md-typeset">
1082 <div class="md-footer-meta__inner md-grid">
1083 <div class="md-footer-copyright">
1084
1085 powered by
1086 <a href="https://www.mkdocs.org">MkDocs</a>
1087 and
1088 <a href="https://squidfunk.github.io/mkdocs-material/">
1089 Material for MkDocs</a>
1090 </div>
1091
1092 </div>
1093 </div>
1094</footer>
1095
1096 </div>
1097
Eric Park45174ca2019-10-21 01:38:33 +08001098 <script src="../../assets/javascripts/application.ac79c3b0.js"></script>
Eric Park5e3a1012019-08-12 13:17:03 +08001099
1100 <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>
1101
1102
1103 </body>
1104</html>