December 28th, 2019 rev1

Change-Id: Ibe61c94cfee17225b80f04a7b0845eaf51a32658
diff --git a/BlissRoms/build-guide/index.html b/BlissRoms/build-guide/index.html
index 1920922..fe9ccae 100644
--- a/BlissRoms/build-guide/index.html
+++ b/BlissRoms/build-guide/index.html
@@ -376,13 +376,6 @@
   
 </li>
         
-          <li class="md-nav__item">
-  <a href="#what-if-i-need-repo-globally" class="md-nav__link">
-    What if I need repo globally?
-  </a>
-  
-</li>
-        
       </ul>
     </nav>
   
@@ -393,19 +386,6 @@
     Download
   </a>
   
-    <nav class="md-nav">
-      <ul class="md-nav__list">
-        
-          <li class="md-nav__item">
-  <a href="#i-still-dont-know-how-much-cpu-threads-i-have-how-do-i-check" class="md-nav__link">
-    I still don't know how much CPU threads I have. How do I check?
-  </a>
-  
-</li>
-        
-      </ul>
-    </nav>
-  
 </li>
         
           <li class="md-nav__item">
@@ -682,13 +662,6 @@
   
 </li>
         
-          <li class="md-nav__item">
-  <a href="#what-if-i-need-repo-globally" class="md-nav__link">
-    What if I need repo globally?
-  </a>
-  
-</li>
-        
       </ul>
     </nav>
   
@@ -699,19 +672,6 @@
     Download
   </a>
   
-    <nav class="md-nav">
-      <ul class="md-nav__list">
-        
-          <li class="md-nav__item">
-  <a href="#i-still-dont-know-how-much-cpu-threads-i-have-how-do-i-check" class="md-nav__link">
-    I still don't know how much CPU threads I have. How do I check?
-  </a>
-  
-</li>
-        
-      </ul>
-    </nav>
-  
 </li>
         
           <li class="md-nav__item">
@@ -816,7 +776,7 @@
 <pre><code>sudo apt install git gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev lib32z1-dev ccache libgl1-mesa-dev libxml2 libxml2-utils xsltproc unzip squashfs-tools python python-mako libssl-dev ninja-build lunzip syslinux syslinux-utils gettext genisoimage bc xorriso liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk3.0-dev lzop maven pngcrush schedtool lib32readline-dev
 </code></pre>
 <h3 id="install-source-code-tools">Install source code tools</h3>
-<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 BlissRoms's GitHub organization, and find what repositories you need to actually build Android.</p>
+<p>Now we need to get the source code via a program named <code>repo</code>. The primary function of <code>repo</code> is to read a manifest file located in BlissRoms's GitHub organization, and find what repositories you need to actually build Android.</p>
 <p>Create a <code>~/bin</code> directory for <code>repo</code>:</p>
 <pre><code>mkdir -p ~/bin
 </code></pre>
@@ -842,40 +802,23 @@
 <h4 id="what-is-source">What is <code>source</code>?</h4>
 <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>
 <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>
-<h4 id="what-if-i-need-repo-globally">What if I need <code>repo</code> globally?</h4>
-<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>
-<pre><code>curl https://storage.googleapis.com/git-repo-downloads/repo &gt; ~/repo
-sudo mv ~/repo /usr/bin/
-chmod a+x /usr/bin/repo
-</code></pre>
-<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>
-<p>Now we’re ready to download the source code.</p>
 <h3 id="download">Download</h3>
 <p>Create a directory for the source:</p>
 <pre><code>mkdir -p ~/bliss/q
 cd ~/bliss/q
 </code></pre>
 <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>
-<pre><code>git config --global user.email “randy.mcrandyface@hotmail.net”
-git config --global user.name “Randy McRandyface”
+<pre><code>git config --global user.email "john.appleseed@example.com"
+git config --global user.name "John Appleseed"
 </code></pre>
 <p>Now, we’re ready to initialize. We need to tell <code>repo</code> which manifest to read:</p>
 <pre><code>repo init -u https://github.com/BlissRoms/platform_manifest.git -b q
 </code></pre>
 <p><code>-b</code> is for the branch, and we’re on <code>q</code>, Android 10. It’ll take a couple of seconds. You may need to type <code>y</code> for the color prompt.</p>
 <p>Then sync the source:</p>
-<pre><code>repo sync -j24 -c
+<pre><code>repo sync -j$(nproc --all) -c
 </code></pre>
-<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>
-<pre><code>repo sync -j4 -c
-</code></pre>
-<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>
-<h4 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?</h4>
-<p>Run <code>nproc</code>. The output should be something like this:</p>
-<pre><code>rwaterspf1@test:~$ nproc
-24
-</code></pre>
-<p>This means that there are 24 threads in your machine.</p>
+<p><em>Note: For more information about the <code>repo</code> tool, visit the <a href="../build-tips/">Build Tips guide</a> to learn more about the <a href="../build-tips/#repo-optimization-tips">repo flags</a>.</em></p>
 <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>
 <h3 id="build">Build</h3>
 <p>Set up the build environment:</p>
@@ -927,9 +870,10 @@
 <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>
 <li>Make sure you’re at the root of the build tree. Again, to quickly jump there, use <code>croot</code>.</li>
 <li>Make sure you ran <code>breakfast</code> correctly and it did not error out. Missing device files will prevent successful builds.</li>
-<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>
+<li>Make sure your computer meets minimum requirements to compile AOSP. Chances are, you need more memory/CPU power to complete a build.</li>
+<li>Make sure your computer isn't faulty. This is unlikely, but to check, use a stress-test program like Prime95.</li>
 </ul>
-<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>
+<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 <a href="https://t.me/Team_Bliss_Build_Support">our Telegram Build Support chat.</a> (Please only ask issues about BlissRoms, not other custom ROMs as we are unable to assist with those!)</p>
 <h3 id="conclusion">Conclusion</h3>
 <p>Building a ROM is very hard and tedious and the results are very rewarding! If you managed to follow along, congratulations!</p>
 <p>After you finish building, you can try out the Git Started guide. Make changes, commit, and send them off to our Gerrit for review! 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>
diff --git a/BlissRoms/build-tips/index.html b/BlissRoms/build-tips/index.html
index 9898289..39ea82b 100644
--- a/BlissRoms/build-tips/index.html
+++ b/BlissRoms/build-tips/index.html
@@ -353,6 +353,13 @@
 </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>
@@ -367,8 +374,8 @@
 </li>
         
           <li class="md-nav__item">
-  <a href="#putting-it-all-together" class="md-nav__link">
-    Putting it all together
+  <a href="#reposync-alias" class="md-nav__link">
+    reposync alias
   </a>
   
 </li>
@@ -379,8 +386,8 @@
 </li>
       
         <li class="md-nav__item">
-  <a href="#reset-tree" class="md-nav__link">
-    Reset tree
+  <a href="#delete-all-device-trees-and-local-manifests" class="md-nav__link">
+    Delete all device trees and local manifests
   </a>
   
 </li>
@@ -392,13 +399,6 @@
   
 </li>
       
-        <li class="md-nav__item">
-  <a href="#make-and-go-inside" class="md-nav__link">
-    Make and go inside
-  </a>
-  
-</li>
-      
       
       
       
@@ -559,6 +559,13 @@
 </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>
@@ -573,8 +580,8 @@
 </li>
         
           <li class="md-nav__item">
-  <a href="#putting-it-all-together" class="md-nav__link">
-    Putting it all together
+  <a href="#reposync-alias" class="md-nav__link">
+    reposync alias
   </a>
   
 </li>
@@ -585,8 +592,8 @@
 </li>
       
         <li class="md-nav__item">
-  <a href="#reset-tree" class="md-nav__link">
-    Reset tree
+  <a href="#delete-all-device-trees-and-local-manifests" class="md-nav__link">
+    Delete all device trees and local manifests
   </a>
   
 </li>
@@ -598,13 +605,6 @@
   
 </li>
       
-        <li class="md-nav__item">
-  <a href="#make-and-go-inside" class="md-nav__link">
-    Make and go inside
-  </a>
-  
-</li>
-      
       
       
       
@@ -626,32 +626,40 @@
 <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. So, for example, if you have 24 threads, you would type:</p>
-<pre><code>repo sync -j24
+<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>
-<h3 id="current-history-only">Current history only</h3>
-<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>
+<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>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>
-<h3 id="putting-it-all-together">Putting it all together</h3>
-<pre><code>repo sync -c -j24 --no-clone-bundle --no-tags
+<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="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 -j24 --no-clone-bundle --no-tags'
+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="reset-tree">Reset tree</h2>
-<p><strong>Warning! Very destructive tip. Do not use if you don't know what you are doing!</strong></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. However, you might have limited bandwidth, and might not want to download the source over again.</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># Script to clean the source
+<pre><code># Remove all device trees/local manifests
 function resettree() {
     rm -rf device kernel vendor out .repo/local_manifests
     reposync
@@ -668,7 +676,7 @@
 <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>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 &lt;devicename&gt;</code>.</p>
+<p>After running <code>resettree</code>, make sure to initialize a new tree by running <code>breakfast &lt;devicename&gt;</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>
@@ -688,15 +696,6 @@
 }
 </code></pre>
 <p>To use this, <code>source ~/.bashrc</code> and then run <code>gcp &lt;GitHub commit URL here&gt;</code>.</p>
-<h2 id="make-and-go-inside">Make and go inside</h2>
-<p>This is a quick way to create and go inside a folder. Once again, copy this to your <code>~/.bashrc</code>:</p>
-<pre><code>function mkcdir ()
-{
-    mkdir -p -- "$1" &amp;&amp;
-    cd -P -- "$1"
-}
-</code></pre>
-<p>Don't forget to <code>source</code>, and run <code>mkcdir &lt;directory name&gt;</code>.</p>