| |
| |
| |
| |
| <!doctype html> |
| <html lang="en" class="no-js"> |
| <head> |
| |
| <meta charset="utf-8"> |
| <meta name="viewport" content="width=device-width,initial-scale=1"> |
| <meta http-equiv="x-ua-compatible" content="ie=edge"> |
| |
| |
| |
| |
| <meta name="lang:clipboard.copy" content="Copy to clipboard"> |
| |
| <meta name="lang:clipboard.copied" content="Copied to clipboard"> |
| |
| <meta name="lang:search.language" content="en"> |
| |
| <meta name="lang:search.pipeline.stopwords" content="True"> |
| |
| <meta name="lang:search.pipeline.trimmer" content="True"> |
| |
| <meta name="lang:search.result.none" content="No matching documents"> |
| |
| <meta name="lang:search.result.one" content="1 matching document"> |
| |
| <meta name="lang:search.result.other" content="# matching documents"> |
| |
| <meta name="lang:search.tokenizer" content="[\s\-]+"> |
| |
| <link rel="shortcut icon" href="../../assets/images/favicon.png"> |
| <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> |
| |
| |
| |
| <title>Build Tips - Team Bliss</title> |
| |
| |
| |
| <link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> |
| |
| |
| |
| |
| <script src="../../assets/javascripts/modernizr.74668098.js"></script> |
| |
| |
| |
| <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> |
| <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> |
| <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> |
| |
| |
| <link rel="stylesheet" href="../../assets/fonts/material-icons.css"> |
| |
| |
| |
| |
| |
| |
| </head> |
| |
| <body dir="ltr"> |
| |
| <svg class="md-svg"> |
| <defs> |
| |
| |
| </defs> |
| </svg> |
| <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off"> |
| <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> |
| <label class="md-overlay" data-md-component="overlay" for="__drawer"></label> |
| |
| <a href="#build-tips" tabindex="1" class="md-skip"> |
| Skip to content |
| </a> |
| |
| |
| <header class="md-header" data-md-component="header"> |
| <nav class="md-header-nav md-grid"> |
| <div class="md-flex"> |
| <div class="md-flex__cell md-flex__cell--shrink"> |
| <a href="../.." title="Team Bliss" class="md-header-nav__button md-logo"> |
| |
| <i class="md-icon"></i> |
| |
| </a> |
| </div> |
| <div class="md-flex__cell md-flex__cell--shrink"> |
| <label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label> |
| </div> |
| <div class="md-flex__cell md-flex__cell--stretch"> |
| <div class="md-flex__ellipsis md-header-nav__title" data-md-component="title"> |
| |
| <span class="md-header-nav__topic"> |
| Team Bliss |
| </span> |
| <span class="md-header-nav__topic"> |
| |
| Build Tips |
| |
| </span> |
| |
| </div> |
| </div> |
| <div class="md-flex__cell md-flex__cell--shrink"> |
| |
| <label class="md-icon md-icon--search md-header-nav__button" for="__search"></label> |
| |
| <div class="md-search" data-md-component="search" role="dialog"> |
| <label class="md-search__overlay" for="__search"></label> |
| <div class="md-search__inner" role="search"> |
| <form class="md-search__form" name="search"> |
| <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"> |
| <label class="md-icon md-search__icon" for="__search"></label> |
| <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> |
|  |
| </button> |
| </form> |
| <div class="md-search__output"> |
| <div class="md-search__scrollwrap" data-md-scrollfix> |
| <div class="md-search-result" data-md-component="result"> |
| <div class="md-search-result__meta"> |
| Type to start searching |
| </div> |
| <ol class="md-search-result__list"></ol> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| |
| </div> |
| |
| </div> |
| </nav> |
| </header> |
| |
| <div class="md-container"> |
| |
| |
| |
| |
| <main class="md-main" role="main"> |
| <div class="md-main__inner md-grid" data-md-component="container"> |
| |
| |
| <div class="md-sidebar md-sidebar--primary" data-md-component="navigation"> |
| <div class="md-sidebar__scrollwrap"> |
| <div class="md-sidebar__inner"> |
| <nav class="md-nav md-nav--primary" data-md-level="0"> |
| <label class="md-nav__title md-nav__title--site" for="__drawer"> |
| <a href="../.." title="Team Bliss" class="md-nav__button md-logo"> |
| |
| <i class="md-icon"></i> |
| |
| </a> |
| Team Bliss |
| </label> |
| |
| <ul class="md-nav__list" data-md-scrollfix> |
| |
| |
| |
| |
| |
| |
| <li class="md-nav__item"> |
| <a href="../.." title="Home" class="md-nav__link"> |
| Home |
| </a> |
| </li> |
| |
| |
| |
| |
| |
| |
| |
| <li class="md-nav__item md-nav__item--nested"> |
| |
| <input class="md-toggle md-nav__toggle" data-md-toggle="nav-2" type="checkbox" id="nav-2"> |
| |
| <label class="md-nav__link" for="nav-2"> |
| Bliss OS |
| </label> |
| <nav class="md-nav" data-md-component="collapsible" data-md-level="1"> |
| <label class="md-nav__title" for="nav-2"> |
| Bliss OS |
| </label> |
| <ul class="md-nav__list" data-md-scrollfix> |
| |
| |
| |
| |
| |
| |
| |
| <li class="md-nav__item"> |
| <a href="../../Bliss OS/" title="Index" class="md-nav__link"> |
| Index |
| </a> |
| </li> |
| |
| |
| |
| |
| |
| |
| |
| <li class="md-nav__item"> |
| <a href="../../Bliss OS/build-guide/" title="Build Guide" class="md-nav__link"> |
| Build Guide |
| </a> |
| </li> |
| |
| |
| |
| |
| |
| |
| |
| <li class="md-nav__item"> |
| <a href="../../Bliss OS/extras/" title="Extras" class="md-nav__link"> |
| Extras |
| </a> |
| </li> |
| |
| |
| |
| |
| |
| |
| |
| <li class="md-nav__item"> |
| <a href="../../Bliss OS/installation-guide/" title="Installation Guide" class="md-nav__link"> |
| Installation Guide |
| </a> |
| </li> |
| |
| |
| |
| |
| |
| |
| |
| <li class="md-nav__item"> |
| <a href="../../Bliss OS/troubleshooting/" title="Troubleshooting" class="md-nav__link"> |
| Troubleshooting |
| </a> |
| </li> |
| |
| |
| </ul> |
| </nav> |
| </li> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <li class="md-nav__item md-nav__item--active md-nav__item--nested"> |
| |
| <input class="md-toggle md-nav__toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3" checked> |
| |
| <label class="md-nav__link" for="nav-3"> |
| BlissRoms |
| </label> |
| <nav class="md-nav" data-md-component="collapsible" data-md-level="1"> |
| <label class="md-nav__title" for="nav-3"> |
| BlissRoms |
| </label> |
| <ul class="md-nav__list" data-md-scrollfix> |
| |
| |
| |
| |
| |
| |
| |
| <li class="md-nav__item"> |
| <a href="../" title="Index" class="md-nav__link"> |
| Index |
| </a> |
| </li> |
| |
| |
| |
| |
| |
| |
| |
| <li class="md-nav__item"> |
| <a href="../build-guide/" title="Build Guide" class="md-nav__link"> |
| Build Guide |
| </a> |
| </li> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <li class="md-nav__item md-nav__item--active"> |
| |
| <input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc"> |
| |
| |
| |
| |
| <label class="md-nav__link md-nav__link--active" for="__toc"> |
| Build Tips |
| </label> |
| |
| <a href="./" title="Build Tips" class="md-nav__link md-nav__link--active"> |
| Build Tips |
| </a> |
| |
| |
| <nav class="md-nav md-nav--secondary"> |
| |
| |
| |
| |
| |
| <label class="md-nav__title" for="__toc">Table of contents</label> |
| <ul class="md-nav__list" data-md-scrollfix> |
| |
| <li class="md-nav__item"> |
| <a href="#repo-optimization-tips" class="md-nav__link"> |
| repo optimization tips |
| </a> |
| |
| <nav class="md-nav"> |
| <ul class="md-nav__list"> |
| |
| <li class="md-nav__item"> |
| <a href="#threads" class="md-nav__link"> |
| Threads |
| </a> |
| |
| </li> |
| |
| <li class="md-nav__item"> |
| <a href="#current-branch-only" class="md-nav__link"> |
| Current branch only |
| </a> |
| |
| </li> |
| |
| <li class="md-nav__item"> |
| <a href="#current-history-only" class="md-nav__link"> |
| Current history only |
| </a> |
| |
| </li> |
| |
| <li class="md-nav__item"> |
| <a href="#minimal-fetch" class="md-nav__link"> |
| Minimal fetch |
| </a> |
| |
| </li> |
| |
| <li class="md-nav__item"> |
| <a href="#force-sync" class="md-nav__link"> |
| Force sync |
| </a> |
| |
| <nav class="md-nav"> |
| <ul class="md-nav__list"> |
| |
| <li class="md-nav__item"> |
| <a href="#why-not-use-f-as-well" class="md-nav__link"> |
| Why not use -f as well? |
| </a> |
| |
| </li> |
| |
| </ul> |
| </nav> |
| |
| </li> |
| |
| <li class="md-nav__item"> |
| <a href="#reposync-alias" class="md-nav__link"> |
| reposync alias |
| </a> |
| |
| </li> |
| |
| </ul> |
| </nav> |
| |
| </li> |
| |
| <li class="md-nav__item"> |
| <a href="#delete-all-device-trees-and-local-manifests" class="md-nav__link"> |
| Delete all device trees and local manifests |
| </a> |
| |
| </li> |
| |
| <li class="md-nav__item"> |
| <a href="#github-cherry-pick" class="md-nav__link"> |
| GitHub cherry-pick |
| </a> |
| |
| </li> |
| |
| |
| |
| |
| |
| </ul> |
| |
| </nav> |
| |
| </li> |
| |
| |
| </ul> |
| </nav> |
| </li> |
| |
| |
| |
| |
| |
| |
| |
| <li class="md-nav__item md-nav__item--nested"> |
| |
| <input class="md-toggle md-nav__toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4"> |
| |
| <label class="md-nav__link" for="nav-4"> |
| Common |
| </label> |
| <nav class="md-nav" data-md-component="collapsible" data-md-level="1"> |
| <label class="md-nav__title" for="nav-4"> |
| Common |
| </label> |
| <ul class="md-nav__list" data-md-scrollfix> |
| |
| |
| |
| |
| |
| |
| |
| <li class="md-nav__item"> |
| <a href="../../common/" title="Index" class="md-nav__link"> |
| Index |
| </a> |
| </li> |
| |
| |
| |
| |
| |
| |
| |
| <li class="md-nav__item"> |
| <a href="../../common/git-started/" title="Git Started" class="md-nav__link"> |
| Git Started |
| </a> |
| </li> |
| |
| |
| |
| |
| |
| |
| |
| <li class="md-nav__item"> |
| <a href="../../common/maintaining-proper-authorship/" title="Maintaining proper authorship" class="md-nav__link"> |
| Maintaining proper authorship |
| </a> |
| </li> |
| |
| |
| |
| |
| |
| |
| |
| <li class="md-nav__item"> |
| <a href="../../common/using-dippy-bird/" title="Using `dippy-bird`" class="md-nav__link"> |
| Using `dippy-bird` |
| </a> |
| </li> |
| |
| |
| </ul> |
| </nav> |
| </li> |
| |
| |
| |
| |
| |
| |
| |
| <li class="md-nav__item md-nav__item--nested"> |
| |
| <input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5"> |
| |
| <label class="md-nav__link" for="nav-5"> |
| Infrastructure |
| </label> |
| <nav class="md-nav" data-md-component="collapsible" data-md-level="1"> |
| <label class="md-nav__title" for="nav-5"> |
| Infrastructure |
| </label> |
| <ul class="md-nav__list" data-md-scrollfix> |
| |
| |
| |
| |
| |
| |
| |
| <li class="md-nav__item"> |
| <a href="../../infrastructure/" title="Index" class="md-nav__link"> |
| Index |
| </a> |
| </li> |
| |
| |
| </ul> |
| </nav> |
| </li> |
| |
| |
| </ul> |
| </nav> |
| </div> |
| </div> |
| </div> |
| |
| |
| <div class="md-sidebar md-sidebar--secondary" data-md-component="toc"> |
| <div class="md-sidebar__scrollwrap"> |
| <div class="md-sidebar__inner"> |
| |
| <nav class="md-nav md-nav--secondary"> |
| |
| |
| |
| |
| |
| <label class="md-nav__title" for="__toc">Table of contents</label> |
| <ul class="md-nav__list" data-md-scrollfix> |
| |
| <li class="md-nav__item"> |
| <a href="#repo-optimization-tips" class="md-nav__link"> |
| repo optimization tips |
| </a> |
| |
| <nav class="md-nav"> |
| <ul class="md-nav__list"> |
| |
| <li class="md-nav__item"> |
| <a href="#threads" class="md-nav__link"> |
| Threads |
| </a> |
| |
| </li> |
| |
| <li class="md-nav__item"> |
| <a href="#current-branch-only" class="md-nav__link"> |
| Current branch only |
| </a> |
| |
| </li> |
| |
| <li class="md-nav__item"> |
| <a href="#current-history-only" class="md-nav__link"> |
| Current history only |
| </a> |
| |
| </li> |
| |
| <li class="md-nav__item"> |
| <a href="#minimal-fetch" class="md-nav__link"> |
| Minimal fetch |
| </a> |
| |
| </li> |
| |
| <li class="md-nav__item"> |
| <a href="#force-sync" class="md-nav__link"> |
| Force sync |
| </a> |
| |
| <nav class="md-nav"> |
| <ul class="md-nav__list"> |
| |
| <li class="md-nav__item"> |
| <a href="#why-not-use-f-as-well" class="md-nav__link"> |
| Why not use -f as well? |
| </a> |
| |
| </li> |
| |
| </ul> |
| </nav> |
| |
| </li> |
| |
| <li class="md-nav__item"> |
| <a href="#reposync-alias" class="md-nav__link"> |
| reposync alias |
| </a> |
| |
| </li> |
| |
| </ul> |
| </nav> |
| |
| </li> |
| |
| <li class="md-nav__item"> |
| <a href="#delete-all-device-trees-and-local-manifests" class="md-nav__link"> |
| Delete all device trees and local manifests |
| </a> |
| |
| </li> |
| |
| <li class="md-nav__item"> |
| <a href="#github-cherry-pick" class="md-nav__link"> |
| GitHub cherry-pick |
| </a> |
| |
| </li> |
| |
| |
| |
| |
| |
| </ul> |
| |
| </nav> |
| </div> |
| </div> |
| </div> |
| |
| |
| <div class="md-content"> |
| <article class="md-content__inner md-typeset"> |
| |
| |
| |
| <h1 id="build-tips">Build Tips</h1> |
| <p>Here's a collective list of things you can try to improve your builds. Have fun!</p> |
| <h2 id="repo-optimization-tips"><code>repo</code> optimization tips</h2> |
| <h3 id="threads">Threads</h3> |
| <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. For example, to use 8 threads:</p> |
| <pre><code>repo sync -j8 |
| </code></pre> |
| <p>To use all of the threads on your machine, use:</p> |
| <pre><code>repo sync -j$(nproc --all) |
| </code></pre> |
| <h3 id="current-branch-only">Current branch only</h3> |
| <p>This is usually set by default in your ROM manifest, but just in case, you can tell <code>repo</code> to only fetch the branch you want to work on:</p> |
| <pre><code>repo sync -c |
| </code></pre> |
| <h3 id="current-history-only">Current history only</h3> |
| <p>To only download the most recent changes, use this flag:</p> |
| <pre><code>repo sync --depth=1 |
| </code></pre> |
| <p>This will make <code>repo</code> fetch the most recent changes.</p> |
| <h3 id="minimal-fetch">Minimal fetch</h3> |
| <p>To disable syncing clone bundles and tags, use:</p> |
| <pre><code>repo sync --no-clone-bundle --no-tags |
| </code></pre> |
| <p><code>repo</code> uses <code>git</code> bundles over HTTP to download repositories. To disable this behavior, we use the <code>--no-clone-bundle</code> flag. We also don't need all of the <code>git</code> tags in each repository, so we disable that too with <code>--no-tags</code>.</p> |
| <h3 id="force-sync">Force sync</h3> |
| <p>Sometimes, bad Internet conditions may cause your <code>.repo</code> directory to become corrupt and not sync. <code>repo</code> keeps two copies of a repository - one under <code>.repo</code>, and one in the root of your source directory. If the repository in <code>.repo</code> is corrupted, it will not sync over to the source directory.</p> |
| <p>To resolve this problem, you need to sometimes tell <code>repo</code> to forcefully sync the repository in <code>.repo</code> again with the remote repository so that changes can be synced over to the main source tree. Use the <code>--force-sync</code> flag to achieve this:</p> |
| <pre><code>repo sync --force-sync |
| </code></pre> |
| <h4 id="why-not-use-f-as-well">Why not use <code>-f</code> as well?</h4> |
| <p>Starting from <code>repo</code> 1.26, the use of the flags <code>-f</code> and <code>--force-sync</code> together has been deprecated. <code>repo</code> will warn you of this change if you try and use those two flags together. To make sure your scripts do not break in future <code>repo</code> versions, it is recommended to not use the <code>-f</code> flag at all.</p> |
| <h3 id="reposync-alias"><code>reposync</code> alias</h3> |
| <pre><code>repo sync -c -j$(nproc --all) --no-clone-bundle --no-tags |
| </code></pre> |
| <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> |
| <p>Open up <code>~/.bashrc</code> and add these lines:</p> |
| <pre><code># Alias to sync |
| alias reposync='repo sync -c -j$(nproc --all) --no-clone-bundle --no-tags' |
| </code></pre> |
| <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> |
| <h2 id="delete-all-device-trees-and-local-manifests">Delete all device trees and local manifests</h2> |
| <p><strong>WARNING</strong>: If you have any changes in your device trees, commit them and push them to a remote repository. This tip will permanently delete your local changes, so back them up!</p> |
| <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. This tip/command will let you delete only the device trees.</p> |
| <p>Add this function to your <code>~/.bashrc</code>:</p> |
| <pre><code># Remove all device trees/local manifests |
| function resettree() { |
| rm -rf device kernel vendor out .repo/local_manifests |
| reposync |
| } |
| </code></pre> |
| <p>Let's go over what this does, word by word:</p> |
| <ul> |
| <li><code>rm -rf</code>: Destructive command to erase all of the following:</li> |
| <li><code>device</code> folder: Holds all device-related files</li> |
| <li><code>kernel</code> folder: Holds all kernel-related files for devices</li> |
| <li><code>vendor</code> folder: Holds all vendor-related files for devices AND ROM-specific vendor customizations</li> |
| <li><code>out</code> folder: Stores artifacts of builds</li> |
| <li><code>.repo/local_manifests</code> folder: Stores "manifest" information of devices to sync.</li> |
| <li><code>reposync</code>: Executes the <code>repo sync</code> alias we made earlier.</li> |
| </ul> |
| <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> |
| <p>After running <code>resettree</code>, make sure to initialize a new tree by running <code>breakfast <devicename></code>.</p> |
| <h2 id="github-cherry-pick">GitHub cherry-pick</h2> |
| <p>Thanks to @blueyes for providing the script!</p> |
| <p>Copy the following into your <code>~/.bashrc</code>:</p> |
| <pre><code>function gcp() { |
| COMMIT=`echo "$1" | cut -d/ -f6` |
| GH=`echo "$1" | cut -d/ -f1-3` |
| if [ "$COMMIT" != "commit" ]; then |
| echo -e "Please use a commit URL." |
| elif [ "$GH" != "https://github.com" ]; then |
| echo -e "Please use an https://github.com/ URL." |
| else |
| PROJECT=`echo "$1" | cut -d/ -f1-5` |
| git fetch $PROJECT |
| CP=`echo "$1" | cut -d/ -f7` |
| git cherry-pick $CP |
| fi |
| } |
| </code></pre> |
| <p>To use this, <code>source ~/.bashrc</code> and then run <code>gcp <GitHub commit URL here></code>.</p> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| </article> |
| </div> |
| </div> |
| </main> |
| |
| |
| <footer class="md-footer"> |
| |
| <div class="md-footer-nav"> |
| <nav class="md-footer-nav__inner md-grid"> |
| |
| <a href="../build-guide/" title="Build Guide" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev"> |
| <div class="md-flex__cell md-flex__cell--shrink"> |
| <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i> |
| </div> |
| <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"> |
| <span class="md-flex__ellipsis"> |
| <span class="md-footer-nav__direction"> |
| Previous |
| </span> |
| Build Guide |
| </span> |
| </div> |
| </a> |
| |
| |
| <a href="../../common/" title="Index" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next"> |
| <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"> |
| <span class="md-flex__ellipsis"> |
| <span class="md-footer-nav__direction"> |
| Next |
| </span> |
| Index |
| </span> |
| </div> |
| <div class="md-flex__cell md-flex__cell--shrink"> |
| <i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i> |
| </div> |
| </a> |
| |
| </nav> |
| </div> |
| |
| <div class="md-footer-meta md-typeset"> |
| <div class="md-footer-meta__inner md-grid"> |
| <div class="md-footer-copyright"> |
| |
| powered by |
| <a href="https://www.mkdocs.org">MkDocs</a> |
| and |
| <a href="https://squidfunk.github.io/mkdocs-material/"> |
| Material for MkDocs</a> |
| </div> |
| |
| </div> |
| </div> |
| </footer> |
| |
| </div> |
| |
| <script src="../../assets/javascripts/application.ac79c3b0.js"></script> |
| |
| <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> |
| |
| |
| </body> |
| </html> |