Eric Park | c993199 | 2019-07-29 13:10:53 +0900 | [diff] [blame] | 1 | |
| 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"> |
| 35 | <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.0"> |
| 36 | |
| 37 | |
| 38 | |
| 39 | <title>Build Tips - Team Bliss</title> |
| 40 | |
| 41 | |
| 42 | |
| 43 | <link rel="stylesheet" href="../../assets/stylesheets/application.0284f74d.css"> |
| 44 | |
| 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-tips" 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 Tips |
| 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 |  |
| 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 | |
| 148 | <main class="md-main"> |
| 149 | <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"> |
Eric Park | 35d8ee3 | 2019-08-11 01:34:35 +0800 | [diff] [blame] | 173 | <a href="../.." title="Index" class="md-nav__link"> |
| 174 | Index |
Eric Park | c993199 | 2019-07-29 13:10:53 +0900 | [diff] [blame] | 175 | </a> |
| 176 | </li> |
| 177 | |
| 178 | |
| 179 | |
| 180 | |
| 181 | |
| 182 | |
| 183 | |
| 184 | <li class="md-nav__item md-nav__item--nested"> |
| 185 | |
| 186 | <input class="md-toggle md-nav__toggle" data-md-toggle="nav-2" type="checkbox" id="nav-2"> |
| 187 | |
| 188 | <label class="md-nav__link" for="nav-2"> |
| 189 | Bliss OS |
| 190 | </label> |
| 191 | <nav class="md-nav" data-md-component="collapsible" data-md-level="1"> |
| 192 | <label class="md-nav__title" for="nav-2"> |
| 193 | Bliss OS |
| 194 | </label> |
| 195 | <ul class="md-nav__list" data-md-scrollfix> |
| 196 | |
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | |
| 203 | <li class="md-nav__item"> |
| 204 | <a href="../../Bliss OS/" title="Index" class="md-nav__link"> |
| 205 | Index |
| 206 | </a> |
| 207 | </li> |
| 208 | |
| 209 | |
Eric Park | 608ce5a | 2019-08-07 21:27:46 +0800 | [diff] [blame] | 210 | |
| 211 | |
| 212 | |
| 213 | |
| 214 | |
| 215 | <li class="md-nav__item"> |
| 216 | <a href="../../Bliss OS/extras/" title="Extras" class="md-nav__link"> |
| 217 | Extras |
| 218 | </a> |
| 219 | </li> |
| 220 | |
| 221 | |
| 222 | |
| 223 | |
| 224 | |
| 225 | |
| 226 | |
| 227 | <li class="md-nav__item"> |
| 228 | <a href="../../Bliss OS/installation-guide/" title="Installation Guide" class="md-nav__link"> |
| 229 | Installation Guide |
| 230 | </a> |
| 231 | </li> |
| 232 | |
| 233 | |
| 234 | |
| 235 | |
| 236 | |
| 237 | |
| 238 | |
| 239 | <li class="md-nav__item"> |
| 240 | <a href="../../Bliss OS/troubleshooting/" title="Troubleshooting" class="md-nav__link"> |
| 241 | Troubleshooting |
| 242 | </a> |
| 243 | </li> |
| 244 | |
| 245 | |
Eric Park | c993199 | 2019-07-29 13:10:53 +0900 | [diff] [blame] | 246 | </ul> |
| 247 | </nav> |
| 248 | </li> |
| 249 | |
| 250 | |
| 251 | |
| 252 | |
| 253 | |
| 254 | |
| 255 | |
| 256 | |
| 257 | |
| 258 | <li class="md-nav__item md-nav__item--active md-nav__item--nested"> |
| 259 | |
| 260 | <input class="md-toggle md-nav__toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3" checked> |
| 261 | |
| 262 | <label class="md-nav__link" for="nav-3"> |
| 263 | BlissRoms |
| 264 | </label> |
| 265 | <nav class="md-nav" data-md-component="collapsible" data-md-level="1"> |
| 266 | <label class="md-nav__title" for="nav-3"> |
| 267 | BlissRoms |
| 268 | </label> |
| 269 | <ul class="md-nav__list" data-md-scrollfix> |
| 270 | |
| 271 | |
| 272 | |
| 273 | |
| 274 | |
| 275 | |
| 276 | |
| 277 | <li class="md-nav__item"> |
| 278 | <a href="../" title="Index" class="md-nav__link"> |
| 279 | Index |
| 280 | </a> |
| 281 | </li> |
| 282 | |
| 283 | |
| 284 | |
| 285 | |
| 286 | |
| 287 | |
| 288 | |
| 289 | <li class="md-nav__item"> |
Eric Park | 608ce5a | 2019-08-07 21:27:46 +0800 | [diff] [blame] | 290 | <a href="../build-guide/" title="Build Guide" class="md-nav__link"> |
| 291 | Build Guide |
Eric Park | c993199 | 2019-07-29 13:10:53 +0900 | [diff] [blame] | 292 | </a> |
| 293 | </li> |
| 294 | |
| 295 | |
| 296 | |
| 297 | |
| 298 | |
| 299 | |
| 300 | |
| 301 | |
| 302 | |
| 303 | <li class="md-nav__item md-nav__item--active"> |
| 304 | |
| 305 | <input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc"> |
| 306 | |
| 307 | |
| 308 | |
| 309 | |
| 310 | <label class="md-nav__link md-nav__link--active" for="__toc"> |
| 311 | Build Tips |
| 312 | </label> |
| 313 | |
| 314 | <a href="./" title="Build Tips" class="md-nav__link md-nav__link--active"> |
| 315 | Build Tips |
| 316 | </a> |
| 317 | |
| 318 | |
| 319 | <nav class="md-nav md-nav--secondary"> |
| 320 | |
| 321 | |
| 322 | |
| 323 | |
| 324 | |
| 325 | <label class="md-nav__title" for="__toc">Table of contents</label> |
| 326 | <ul class="md-nav__list" data-md-scrollfix> |
| 327 | |
| 328 | <li class="md-nav__item"> |
| 329 | <a href="#repo-optimization-tips" title="repo optimization tips" class="md-nav__link"> |
| 330 | repo optimization tips |
| 331 | </a> |
| 332 | |
| 333 | <nav class="md-nav"> |
| 334 | <ul class="md-nav__list"> |
| 335 | |
| 336 | <li class="md-nav__item"> |
| 337 | <a href="#threads" title="Threads" class="md-nav__link"> |
| 338 | Threads |
| 339 | </a> |
| 340 | |
| 341 | </li> |
| 342 | |
| 343 | <li class="md-nav__item"> |
| 344 | <a href="#current-history-only" title="Current history only" class="md-nav__link"> |
| 345 | Current history only |
| 346 | </a> |
| 347 | |
| 348 | </li> |
| 349 | |
| 350 | <li class="md-nav__item"> |
| 351 | <a href="#force" title="Force" class="md-nav__link"> |
| 352 | Force |
| 353 | </a> |
| 354 | |
| 355 | </li> |
| 356 | |
| 357 | <li class="md-nav__item"> |
| 358 | <a href="#minimal-fetch" title="Minimal fetch" class="md-nav__link"> |
| 359 | Minimal fetch |
| 360 | </a> |
| 361 | |
| 362 | </li> |
| 363 | |
| 364 | <li class="md-nav__item"> |
| 365 | <a href="#putting-it-all-together" title="Putting it all together" class="md-nav__link"> |
| 366 | Putting it all together |
| 367 | </a> |
| 368 | |
| 369 | </li> |
| 370 | |
| 371 | </ul> |
| 372 | </nav> |
| 373 | |
| 374 | </li> |
| 375 | |
| 376 | <li class="md-nav__item"> |
| 377 | <a href="#reset-tree" title="Reset tree" class="md-nav__link"> |
| 378 | Reset tree |
| 379 | </a> |
| 380 | |
| 381 | </li> |
| 382 | |
| 383 | <li class="md-nav__item"> |
| 384 | <a href="#github-cherry-pick" title="GitHub cherry-pick" class="md-nav__link"> |
| 385 | GitHub cherry-pick |
| 386 | </a> |
| 387 | |
| 388 | </li> |
| 389 | |
| 390 | <li class="md-nav__item"> |
| 391 | <a href="#make-and-go-inside" title="Make and go inside" class="md-nav__link"> |
| 392 | Make and go inside |
| 393 | </a> |
| 394 | |
| 395 | </li> |
| 396 | |
| 397 | |
| 398 | |
| 399 | |
| 400 | |
| 401 | </ul> |
| 402 | |
| 403 | </nav> |
| 404 | |
| 405 | </li> |
| 406 | |
| 407 | |
| 408 | </ul> |
| 409 | </nav> |
| 410 | </li> |
| 411 | |
| 412 | |
| 413 | |
| 414 | |
| 415 | |
| 416 | |
| 417 | |
| 418 | <li class="md-nav__item md-nav__item--nested"> |
| 419 | |
| 420 | <input class="md-toggle md-nav__toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4"> |
| 421 | |
| 422 | <label class="md-nav__link" for="nav-4"> |
| 423 | Common |
| 424 | </label> |
| 425 | <nav class="md-nav" data-md-component="collapsible" data-md-level="1"> |
| 426 | <label class="md-nav__title" for="nav-4"> |
| 427 | Common |
| 428 | </label> |
| 429 | <ul class="md-nav__list" data-md-scrollfix> |
| 430 | |
| 431 | |
| 432 | |
| 433 | |
| 434 | |
| 435 | |
| 436 | |
| 437 | <li class="md-nav__item"> |
| 438 | <a href="../../common/" title="Index" class="md-nav__link"> |
| 439 | Index |
| 440 | </a> |
| 441 | </li> |
| 442 | |
| 443 | |
| 444 | |
| 445 | |
| 446 | |
| 447 | |
| 448 | |
| 449 | <li class="md-nav__item"> |
| 450 | <a href="../../common/git-started/" title="Git Started" class="md-nav__link"> |
| 451 | Git Started |
| 452 | </a> |
| 453 | </li> |
| 454 | |
| 455 | |
Eric Park | 608ce5a | 2019-08-07 21:27:46 +0800 | [diff] [blame] | 456 | |
| 457 | |
| 458 | |
| 459 | |
| 460 | |
| 461 | <li class="md-nav__item"> |
| 462 | <a href="../../common/using-dippy-bird/" title="Using `dippy-bird`" class="md-nav__link"> |
| 463 | Using `dippy-bird` |
| 464 | </a> |
| 465 | </li> |
| 466 | |
| 467 | |
Eric Park | c993199 | 2019-07-29 13:10:53 +0900 | [diff] [blame] | 468 | </ul> |
| 469 | </nav> |
| 470 | </li> |
| 471 | |
| 472 | |
| 473 | |
| 474 | |
| 475 | |
| 476 | |
| 477 | |
| 478 | <li class="md-nav__item md-nav__item--nested"> |
| 479 | |
| 480 | <input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5"> |
| 481 | |
| 482 | <label class="md-nav__link" for="nav-5"> |
| 483 | Infrastructure |
| 484 | </label> |
| 485 | <nav class="md-nav" data-md-component="collapsible" data-md-level="1"> |
| 486 | <label class="md-nav__title" for="nav-5"> |
| 487 | Infrastructure |
| 488 | </label> |
| 489 | <ul class="md-nav__list" data-md-scrollfix> |
| 490 | |
| 491 | |
| 492 | |
| 493 | |
| 494 | |
| 495 | |
| 496 | |
| 497 | <li class="md-nav__item"> |
| 498 | <a href="../../infrastructure/" title="Index" class="md-nav__link"> |
| 499 | Index |
| 500 | </a> |
| 501 | </li> |
| 502 | |
| 503 | |
| 504 | </ul> |
| 505 | </nav> |
| 506 | </li> |
| 507 | |
| 508 | |
| 509 | </ul> |
| 510 | </nav> |
| 511 | </div> |
| 512 | </div> |
| 513 | </div> |
| 514 | |
| 515 | |
| 516 | <div class="md-sidebar md-sidebar--secondary" data-md-component="toc"> |
| 517 | <div class="md-sidebar__scrollwrap"> |
| 518 | <div class="md-sidebar__inner"> |
| 519 | |
| 520 | <nav class="md-nav md-nav--secondary"> |
| 521 | |
| 522 | |
| 523 | |
| 524 | |
| 525 | |
| 526 | <label class="md-nav__title" for="__toc">Table of contents</label> |
| 527 | <ul class="md-nav__list" data-md-scrollfix> |
| 528 | |
| 529 | <li class="md-nav__item"> |
| 530 | <a href="#repo-optimization-tips" title="repo optimization tips" class="md-nav__link"> |
| 531 | repo optimization tips |
| 532 | </a> |
| 533 | |
| 534 | <nav class="md-nav"> |
| 535 | <ul class="md-nav__list"> |
| 536 | |
| 537 | <li class="md-nav__item"> |
| 538 | <a href="#threads" title="Threads" class="md-nav__link"> |
| 539 | Threads |
| 540 | </a> |
| 541 | |
| 542 | </li> |
| 543 | |
| 544 | <li class="md-nav__item"> |
| 545 | <a href="#current-history-only" title="Current history only" class="md-nav__link"> |
| 546 | Current history only |
| 547 | </a> |
| 548 | |
| 549 | </li> |
| 550 | |
| 551 | <li class="md-nav__item"> |
| 552 | <a href="#force" title="Force" class="md-nav__link"> |
| 553 | Force |
| 554 | </a> |
| 555 | |
| 556 | </li> |
| 557 | |
| 558 | <li class="md-nav__item"> |
| 559 | <a href="#minimal-fetch" title="Minimal fetch" class="md-nav__link"> |
| 560 | Minimal fetch |
| 561 | </a> |
| 562 | |
| 563 | </li> |
| 564 | |
| 565 | <li class="md-nav__item"> |
| 566 | <a href="#putting-it-all-together" title="Putting it all together" class="md-nav__link"> |
| 567 | Putting it all together |
| 568 | </a> |
| 569 | |
| 570 | </li> |
| 571 | |
| 572 | </ul> |
| 573 | </nav> |
| 574 | |
| 575 | </li> |
| 576 | |
| 577 | <li class="md-nav__item"> |
| 578 | <a href="#reset-tree" title="Reset tree" class="md-nav__link"> |
| 579 | Reset tree |
| 580 | </a> |
| 581 | |
| 582 | </li> |
| 583 | |
| 584 | <li class="md-nav__item"> |
| 585 | <a href="#github-cherry-pick" title="GitHub cherry-pick" class="md-nav__link"> |
| 586 | GitHub cherry-pick |
| 587 | </a> |
| 588 | |
| 589 | </li> |
| 590 | |
| 591 | <li class="md-nav__item"> |
| 592 | <a href="#make-and-go-inside" title="Make and go inside" class="md-nav__link"> |
| 593 | Make and go inside |
| 594 | </a> |
| 595 | |
| 596 | </li> |
| 597 | |
| 598 | |
| 599 | |
| 600 | |
| 601 | |
| 602 | </ul> |
| 603 | |
| 604 | </nav> |
| 605 | </div> |
| 606 | </div> |
| 607 | </div> |
| 608 | |
| 609 | |
| 610 | <div class="md-content"> |
| 611 | <article class="md-content__inner md-typeset"> |
| 612 | |
| 613 | |
| 614 | |
| 615 | <h1 id="build-tips">Build Tips</h1> |
| 616 | <p>Here's a collective list of things you can try to improve your builds. Have fun!</p> |
| 617 | <h2 id="repo-optimization-tips"><code>repo</code> optimization tips</h2> |
| 618 | <h3 id="threads">Threads</h3> |
| 619 | <p>By default, <code>repo</code> only utilizes four threads (or whatever the ROM manifest declares.) If you have a stronger machine with more threads, you can increase this number. So, for example, if you have 24 threads, you would type:</p> |
| 620 | <pre><code>repo sync -j24 |
| 621 | </code></pre> |
| 622 | <h3 id="current-history-only">Current history only</h3> |
| 623 | <p>This should be set by default in your ROM manifest, but just in case, you can tell <code>repo</code> to only fetch recent changes. This allows for smaller downloads, which makes the sync quicker. Add the flag:</p> |
| 624 | <pre><code>repo sync -c |
| 625 | </code></pre> |
| 626 | <h3 id="force">Force</h3> |
| 627 | <p><strong>Warning! Dangerous option. Read before proceeding!</strong> Sometimes, your local history may go out of sync with remote repositories. This wouldn't be a problem if <code>repo</code> can handle it gracefully, but it doesn't and gives off a sync error. If you do not commit much, it may be worthwhile to add the force flags. Be warned though, <strong>any changes you make to the repositories WILL BE DELETED.</strong> Later down the line, if you commit a lot, you may want to remove this flag. To force sync, add the flag:</p> |
| 628 | <pre><code>repo sync -f --force-sync |
| 629 | </code></pre> |
| 630 | <h3 id="minimal-fetch">Minimal fetch</h3> |
| 631 | <p>To disable syncing clone bundles and tags, use:</p> |
| 632 | <pre><code>repo sync --no-clone-bundle --no-tags |
| 633 | </code></pre> |
| 634 | <p>More documentation on this required, but for most developers these flags will be OK to use. This makes the sync faster as there is less information to sync over.</p> |
| 635 | <h3 id="putting-it-all-together">Putting it all together</h3> |
| 636 | <pre><code>repo sync -c -f -j24 --force-sync --no-clone-bundle --no-tags |
| 637 | </code></pre> |
| 638 | <p>That's quite long! How about we add this to our <code>.bashrc</code> as a alias? That way, we only have to type one phrase for <code>bash</code> to automatically type that out for us.</p> |
| 639 | <p>Open up <code>~/.bashrc</code> and add these lines:</p> |
| 640 | <pre><code># Alias to sync |
| 641 | alias reposync='repo sync -c -f -j24 --force-sync --no-clone-bundle --no-tags' |
| 642 | </code></pre> |
| 643 | <p>This way, next time you want to sync, just type <code>reposync</code> and <code>bash</code> will substitute the command for you. Easy! Just don't forget to <code>source ~/.bashrc</code> otherwise <code>bash</code> will not know of this new alias.</p> |
| 644 | <h2 id="reset-tree">Reset tree</h2> |
| 645 | <p><strong>Warning! Very destructive tip. Do not use if you don't know what you are doing!</strong></p> |
| 646 | <p>While messing around with device specific folders, you may break something and the build process might not work. Or, you may have multiple devices synced and you want to delete it all and start over. However, you might have limited bandwidth, and might not want to download the source over again.</p> |
| 647 | <p>Add this function to your <code>~/.bashrc</code>:</p> |
| 648 | <pre><code># Script to clean the source |
| 649 | function resettree() { |
| 650 | rm -rf device kernel vendor out .repo/local_manifests |
| 651 | reposync |
| 652 | } |
| 653 | </code></pre> |
| 654 | <p>Let's go over what this does, word by word:</p> |
| 655 | <ul> |
| 656 | <li><code>rm -rf</code>: Destructive command to erase all of the following:</li> |
| 657 | <li><code>device</code> folder: Holds all device-related files</li> |
| 658 | <li><code>kernel</code> folder: Holds all kernel-related files for devices</li> |
| 659 | <li><code>vendor</code> folder: Holds all vendor-related files for devices AND ROM-specific vendor customizations</li> |
| 660 | <li><code>out</code> folder: Stores artifacts of builds</li> |
| 661 | <li><code>.repo/local_manifests</code> folder: Stores "manifest" information of devices to sync.</li> |
| 662 | <li><code>reposync</code>: Executes the <code>repo sync</code> alias we made earlier.</li> |
| 663 | </ul> |
| 664 | <p>The last line is important, because by deleting the <code>vendor</code> folder, we also delete some crucial files for building Bliss. To fix that, we rerun a sync. Note that because we did not delete any other folders, syncing and updating files only take a fraction of a time compared to starting from scratch.</p> |
| 665 | <p>To use this, after copying, don't forget to <code>source ~/.bashrc</code>. Then, run <code>resettree</code> at the base folder of the source code. Once you're done, don't forget to initialize a new device using <code>breakfast <devicename></code>.</p> |
| 666 | <h2 id="github-cherry-pick">GitHub cherry-pick</h2> |
| 667 | <p>Thanks to @blueyes for providing the script!</p> |
| 668 | <p>Copy the following into your <code>~/.bashrc</code>:</p> |
| 669 | <pre><code>function gcp() { |
| 670 | COMMIT=`echo "$1" | cut -d/ -f6` |
| 671 | GH=`echo "$1" | cut -d/ -f1-3` |
| 672 | if [ "$COMMIT" != "commit" ]; then |
| 673 | echo -e "Please use a commit URL." |
| 674 | elif [ "$GH" != "https://github.com" ]; then |
| 675 | echo -e "Please use an https://github.com/ URL." |
| 676 | else |
| 677 | PROJECT=`echo "$1" | cut -d/ -f1-5` |
| 678 | git fetch $PROJECT |
| 679 | CP=`echo "$1" | cut -d/ -f7` |
| 680 | git cherry-pick $CP |
| 681 | fi |
| 682 | } |
| 683 | </code></pre> |
| 684 | <p>To use this, <code>source ~/.bashrc</code> and then run <code>gcp <GitHub commit URL here></code>.</p> |
| 685 | <h2 id="make-and-go-inside">Make and go inside</h2> |
| 686 | <p>This is a quick way to create and go inside a folder. Once again, copy this to your <code>~/.bashrc</code>:</p> |
| 687 | <pre><code>function mkcdir () |
| 688 | { |
| 689 | mkdir -p -- "$1" && |
| 690 | cd -P -- "$1" |
| 691 | } |
| 692 | </code></pre> |
| 693 | <p>Don't forget to <code>source</code>, and run <code>mkcdir <directory name></code>.</p> |
| 694 | |
| 695 | |
| 696 | |
| 697 | |
| 698 | |
| 699 | |
| 700 | |
| 701 | |
| 702 | |
| 703 | </article> |
| 704 | </div> |
| 705 | </div> |
| 706 | </main> |
| 707 | |
| 708 | |
| 709 | <footer class="md-footer"> |
| 710 | |
| 711 | <div class="md-footer-nav"> |
| 712 | <nav class="md-footer-nav__inner md-grid"> |
| 713 | |
Eric Park | 608ce5a | 2019-08-07 21:27:46 +0800 | [diff] [blame] | 714 | <a href="../build-guide/" title="Build Guide" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev"> |
Eric Park | c993199 | 2019-07-29 13:10:53 +0900 | [diff] [blame] | 715 | <div class="md-flex__cell md-flex__cell--shrink"> |
| 716 | <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i> |
| 717 | </div> |
| 718 | <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"> |
| 719 | <span class="md-flex__ellipsis"> |
| 720 | <span class="md-footer-nav__direction"> |
| 721 | Previous |
| 722 | </span> |
Eric Park | 608ce5a | 2019-08-07 21:27:46 +0800 | [diff] [blame] | 723 | Build Guide |
Eric Park | c993199 | 2019-07-29 13:10:53 +0900 | [diff] [blame] | 724 | </span> |
| 725 | </div> |
| 726 | </a> |
| 727 | |
| 728 | |
| 729 | <a href="../../common/" title="Index" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next"> |
| 730 | <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"> |
| 731 | <span class="md-flex__ellipsis"> |
| 732 | <span class="md-footer-nav__direction"> |
| 733 | Next |
| 734 | </span> |
| 735 | Index |
| 736 | </span> |
| 737 | </div> |
| 738 | <div class="md-flex__cell md-flex__cell--shrink"> |
| 739 | <i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i> |
| 740 | </div> |
| 741 | </a> |
| 742 | |
| 743 | </nav> |
| 744 | </div> |
| 745 | |
| 746 | <div class="md-footer-meta md-typeset"> |
| 747 | <div class="md-footer-meta__inner md-grid"> |
| 748 | <div class="md-footer-copyright"> |
| 749 | |
| 750 | powered by |
| 751 | <a href="https://www.mkdocs.org">MkDocs</a> |
| 752 | and |
| 753 | <a href="https://squidfunk.github.io/mkdocs-material/"> |
| 754 | Material for MkDocs</a> |
| 755 | </div> |
| 756 | |
| 757 | </div> |
| 758 | </div> |
| 759 | </footer> |
| 760 | |
| 761 | </div> |
| 762 | |
| 763 | <script src="../../assets/javascripts/application.245445c6.js"></script> |
| 764 | |
| 765 | <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> |
| 766 | |
| 767 | |
| 768 | </body> |
| 769 | </html> |