| <!DOCTYPE html> |
| <html lang="en" class="h-full"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="viewport" content="width=device-width,initial-scale=1"> |
| <meta name="turbo-cache-control" content="no-cache" data-turbo-track="reload" data-track-token="2.3.0.709105685982"> |
| |
| <!-- See retype.com --> |
| <meta name="generator" content="Retype 2.3.0"> |
| |
| <!-- Primary Meta Tags --> |
| <title>Build BlissRom - BlissRoms Docs</title> |
| <meta name="title" content="Build BlissRom - BlissRoms Docs"> |
| <meta name="description" content="This is the official guide to build BlissRom for your device. In this guide, we will only cover official devices with actual maintainers." /> |
| |
| <!-- Canonical --> |
| <link rel="canonical" href="https://docs.blissroms.org/development/build-guide/" /> |
| |
| <!-- Open Graph / Facebook --> |
| <meta property="og:type" content="website"> |
| <meta property="og:url" content="https://docs.blissroms.org/development/build-guide/"> |
| <meta property="og:title" content="Build BlissRom - BlissRoms Docs"> |
| <meta property="og:description" content="This is the official guide to build BlissRom for your device. In this guide, we will only cover official devices with actual maintainers."> |
| |
| <!-- Twitter --> |
| <meta property="twitter:card" content="summary_large_image"> |
| <meta property="twitter:url" content="https://docs.blissroms.org/development/build-guide/"> |
| <meta property="twitter:title" content="Build BlissRom - BlissRoms Docs"> |
| <meta property="twitter:description" content="This is the official guide to build BlissRom for your device. In this guide, we will only cover official devices with actual maintainers."> |
| |
| <script>(function () { var el = document.documentElement, m = localStorage.getItem("doc_theme"), wm = window.matchMedia; if (m === "dark" || (!m && wm && wm("(prefers-color-scheme: dark)").matches)) { el.classList.add("dark") } else { el.classList.remove("dark") } })();</script> |
| |
| <link href="../../resources/css/retype.css?v=2.3.0.709105685982" rel="stylesheet" /> |
| |
| <script type="text/javascript" src="../../resources/js/config.js?v=2.3.0.709105685982" data-turbo-eval="false" defer></script> |
| <script type="text/javascript" src="../../resources/js/retype.js?v=2.3.0" data-turbo-eval="false" defer></script> |
| <script id="lunr-js" type="text/javascript" src="../../resources/js/lunr.js?v=2.3.0.709105685982" data-turbo-eval="false" defer></script> |
| </head> |
| <body> |
| <div id="docs-app" class="relative text-base antialiased text-gray-700 bg-white font-body dark:bg-dark-850 dark:text-dark-300"> |
| <div class="absolute bottom-0 left-0 bg-gray-100 dark:bg-dark-800" style="top: 5rem; right: 50%"></div> |
| |
| <header id="docs-site-header" class="sticky top-0 z-30 flex w-full h-16 bg-white border-b border-gray-200 md:h-20 dark:bg-dark-850 dark:border-dark-650"> |
| <div class="container relative flex items-center justify-between grow pr-6 md:justify-start"> |
| <!-- Mobile menu button skeleton --> |
| <button v-cloak class="skeleton docs-mobile-menu-button flex items-center justify-center shrink-0 overflow-hidden dark:text-white focus:outline-none rounded-full w-10 h-10 ml-3.5 md:hidden"><svg xmlns="http://www.w3.org/2000/svg" class="mb-px shrink-0" width="24" height="24" viewBox="0 0 24 24" role="presentation" style="margin-bottom: 0px;"><g fill="currentColor"><path d="M2 4h20v2H2zM2 11h20v2H2zM2 18h20v2H2z"></path></g></svg></button> |
| <div v-cloak id="docs-sidebar-toggle"></div> |
| |
| <!-- Logo --> |
| <div class="flex items-center justify-between h-full py-2 md:w-75"> |
| <div class="flex items-center px-2 md:px-6"> |
| <a id="docs-site-logo" href="../../" class="flex items-center leading-snug text-2xl"> |
| <span class="dark:text-white font-semibold line-clamp-1 md:line-clamp-2">BlissRoms</span> |
| </a><span class="hidden px-2 py-1 ml-4 text-sm font-semibold leading-none text-root-logo-label-text bg-root-logo-label-bg rounded-sm md:inline-block">Docs</span> |
| </div> |
| |
| <span class="hidden h-8 border-r md:inline-block dark:border-dark-650"></span> |
| </div> |
| |
| <div class="flex justify-between md:grow"> |
| <!-- Top Nav --> |
| <nav class="hidden md:flex"> |
| <ul class="flex flex-col mb-4 md:pl-16 md:mb-0 md:flex-row md:items-center"> |
| <li class="mr-6"> |
| <a class="py-2 md:mb-0 inline-flex items-center text-sm whitespace-nowrap transition-colors duration-200 ease-linear md:text-blue-500 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-200" href="../../"> |
| <svg xmlns="http://www.w3.org/2000/svg" class="mb-px mr-1" width="18" height="18" viewBox="0 0 24 24" role="presentation"> |
| <g fill="currentColor"> |
| <path fill-rule="evenodd" d="M11.03 2.59a1.5 1.5 0 011.94 0l7.5 6.363a1.5 1.5 0 01.53 1.144V19.5a1.5 1.5 0 01-1.5 1.5h-5.75a.75.75 0 01-.75-.75V14h-2v6.25a.75.75 0 01-.75.75H4.5A1.5 1.5 0 013 19.5v-9.403c0-.44.194-.859.53-1.144l7.5-6.363zM12 3.734l-7.5 6.363V19.5h5v-6.25a.75.75 0 01.75-.75h3.5a.75.75 0 01.75.75v6.25h5v-9.403L12 3.734z"/> |
| </g> |
| </svg> |
| <span>Home</span> |
| </a> |
| </li> |
| |
| </ul> |
| </nav> |
| |
| <!-- Header Right Skeleton --> |
| <div v-cloak class="flex justify-end grow skeleton"> |
| |
| <!-- Search input mock --> |
| <div class="relative hidden w-40 lg:block lg:max-w-sm lg:ml-auto"> |
| <div class="absolute flex items-center justify-center h-full pl-3 dark:text-dark-300"> |
| <svg xmlns="http://www.w3.org/2000/svg" class="icon-base" width="16" height="16" viewBox="0 0 24 24" aria-labelledby="icon" role="presentation" style="margin-bottom: 1px;"><g fill="currentColor" ><path d="M21.71 20.29l-3.68-3.68A8.963 8.963 0 0020 11c0-4.96-4.04-9-9-9s-9 4.04-9 9 4.04 9 9 9c2.12 0 4.07-.74 5.61-1.97l3.68 3.68c.2.19.45.29.71.29s.51-.1.71-.29c.39-.39.39-1.03 0-1.42zM4 11c0-3.86 3.14-7 7-7s7 3.14 7 7c0 1.92-.78 3.66-2.04 4.93-.01.01-.02.01-.02.01-.01.01-.01.01-.01.02A6.98 6.98 0 0111 18c-3.86 0-7-3.14-7-7z" ></path></g></svg> |
| </div> |
| |
| <input class="w-full h-10 transition-colors duration-200 ease-in bg-gray-200 border border-transparent rounded md:text-sm hover:bg-white hover:border-gray-300 focus:outline-none focus:bg-white focus:border-gray-500 dark:bg-dark-600 dark:border-dark-600 placeholder-gray-400 dark:placeholder-dark-400" |
| style="padding: 0.625rem 0.75rem 0.625rem 2rem" type="text" placeholder="Search" /> |
| </div> |
| |
| <!-- Mobile search button mock --> |
| <div class="flex items-center justify-center w-10 h-10 lg:hidden"> |
| <svg xmlns="http://www.w3.org/2000/svg" class="shrink-0 icon-base" width="20" height="20" viewBox="0 0 24 24" aria-labelledby="icon" role="presentation" style="margin-bottom: 0px;"><g fill="currentColor" ><path d="M21.71 20.29l-3.68-3.68A8.963 8.963 0 0020 11c0-4.96-4.04-9-9-9s-9 4.04-9 9 4.04 9 9 9c2.12 0 4.07-.74 5.61-1.97l3.68 3.68c.2.19.45.29.71.29s.51-.1.71-.29c.39-.39.39-1.03 0-1.42zM4 11c0-3.86 3.14-7 7-7s7 3.14 7 7c0 1.92-.78 3.66-2.04 4.93-.01.01-.02.01-.02.01-.01.01-.01.01-.01.02A6.98 6.98 0 0111 18c-3.86 0-7-3.14-7-7z" ></path></g></svg> |
| </div> |
| |
| <!-- Dark mode switch placehokder --> |
| <div class="w-10 h-10 lg:ml-2"></div> |
| |
| <!-- History button mock --> |
| <div class="flex items-center justify-center w-10 h-10" style="margin-right: -0.625rem;"> |
| <svg xmlns="http://www.w3.org/2000/svg" class="shrink-0 icon-base" width="22" height="22" viewBox="0 0 24 24" aria-labelledby="icon" role="presentation" style="margin-bottom: 0px;"><g fill="currentColor" ><g ><path d="M12.01 6.01c-.55 0-1 .45-1 1V12a1 1 0 00.4.8l3 2.22a.985.985 0 001.39-.2.996.996 0 00-.21-1.4l-2.6-1.92V7.01c.02-.55-.43-1-.98-1z"></path><path d="M12.01 1.91c-5.33 0-9.69 4.16-10.05 9.4l-.29-.26a.997.997 0 10-1.34 1.48l1.97 1.79c.19.17.43.26.67.26s.48-.09.67-.26l1.97-1.79a.997.997 0 10-1.34-1.48l-.31.28c.34-4.14 3.82-7.41 8.05-7.41 4.46 0 8.08 3.63 8.08 8.09s-3.63 8.08-8.08 8.08c-2.18 0-4.22-.85-5.75-2.4a.996.996 0 10-1.42 1.4 10.02 10.02 0 007.17 2.99c5.56 0 10.08-4.52 10.08-10.08.01-5.56-4.52-10.09-10.08-10.09z"></path></g></g></svg> |
| </div> |
| </div> |
| |
| <div v-cloak class="flex justify-end grow"> |
| <div id="docs-mobile-search-button"></div> |
| <doc-search-desktop></doc-search-desktop> |
| |
| <doc-theme-switch class="lg:ml-2"></doc-theme-switch> |
| <doc-history></doc-history> |
| </div> |
| </div> |
| </div> |
| </header> |
| |
| <div class="container relative flex bg-white"> |
| <!-- Sidebar Skeleton --> |
| <div v-cloak class="fixed flex flex-col shrink-0 duration-300 ease-in-out bg-gray-100 border-gray-200 sidebar top-20 w-75 border-r h-screen md:sticky transition-transform skeleton dark:bg-dark-800 dark:border-dark-650"> |
| |
| <!-- Render this div, if config.showSidebarFilter is `true` --> |
| <div class="flex items-center h-16 px-6"> |
| <input class="w-full h-8 px-3 py-2 transition-colors duration-200 ease-linear bg-white border border-gray-200 rounded shadow-none text-sm focus:outline-none focus:border-gray-600 dark:bg-dark-600 dark:border-dark-600" type="text" placeholder="Filter" /> |
| </div> |
| |
| <div class="pl-6 mb-4 mt-1"> |
| <div class="w-32 h-3 mb-4 bg-gray-200 rounded-full loading dark:bg-dark-600"></div> |
| <div class="w-48 h-3 mb-4 bg-gray-200 rounded-full loading dark:bg-dark-600"></div> |
| <div class="w-40 h-3 mb-4 bg-gray-200 rounded-full loading dark:bg-dark-600"></div> |
| <div class="w-32 h-3 mb-4 bg-gray-200 rounded-full loading dark:bg-dark-600"></div> |
| <div class="w-48 h-3 mb-4 bg-gray-200 rounded-full loading dark:bg-dark-600"></div> |
| <div class="w-40 h-3 mb-4 bg-gray-200 rounded-full loading dark:bg-dark-600"></div> |
| </div> |
| |
| <div class="shrink-0 mt-auto bg-transparent dark:border-dark-650"> |
| <a class="flex items-center justify-center flex-nowrap h-16 text-gray-400 dark:text-dark-400 hover:text-gray-700 dark:hover:text-dark-300 transition-colors duration-150 ease-in docs-powered-by" target="_blank" href="https://retype.com/" rel="noopener"> |
| <span class="text-xs whitespace-nowrap">Powered by</span> |
| <svg xmlns="http://www.w3.org/2000/svg" class="ml-2" fill="currentColor" width="96" height="20" overflow="visible"><path d="M0 0v20h13.59V0H0zm11.15 17.54H2.44V2.46h8.71v15.08zM15.8 20h2.44V4.67L15.8 2.22zM20.45 6.89V20h2.44V9.34z"/><g><path d="M40.16 8.44c0 1.49-.59 2.45-1.75 2.88l2.34 3.32h-2.53l-2.04-2.96h-1.43v2.96h-2.06V5.36h3.5c1.43 0 2.46.24 3.07.73s.9 1.27.9 2.35zm-2.48 1.1c.26-.23.38-.59.38-1.09 0-.5-.13-.84-.4-1.03s-.73-.28-1.39-.28h-1.54v2.75h1.5c.72 0 1.2-.12 1.45-.35zM51.56 5.36V7.2h-4.59v1.91h4.13v1.76h-4.13v1.92h4.74v1.83h-6.79V5.36h6.64zM60.09 7.15v7.48h-2.06V7.15h-2.61V5.36h7.28v1.79h-2.61zM70.81 14.64h-2.06v-3.66l-3.19-5.61h2.23l1.99 3.45 1.99-3.45H74l-3.19 5.61v3.66zM83.99 6.19c.65.55.97 1.4.97 2.55s-.33 1.98-1 2.51-1.68.8-3.04.8h-1.23v2.59h-2.06V5.36h3.26c1.42 0 2.45.28 3.1.83zm-1.51 3.65c.25-.28.37-.69.37-1.22s-.16-.92-.48-1.14c-.32-.23-.82-.34-1.5-.34H79.7v3.12h1.38c.68 0 1.15-.14 1.4-.42zM95.85 5.36V7.2h-4.59v1.91h4.13v1.76h-4.13v1.92H96v1.83h-6.79V5.36h6.64z"/></g></svg> |
| </a> |
| </div> |
| </div> |
| |
| <!-- Sidebar component --> |
| <doc-sidebar v-cloak> |
| <template #sidebar-footer> |
| <div class="shrink-0 mt-auto border-t md:bg-transparent md:border-none dark:border-dark-650"> |
| |
| <div class="py-3 px-6 md:hidden border-b dark:border-dark-650"> |
| <nav> |
| <ul class="flex flex-wrap justify-center items-center"> |
| <li class="mr-6"> |
| <a class="block py-1 inline-flex items-center text-sm whitespace-nowrap transition-colors duration-200 ease-linear md:text-blue-500 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-200" href="../../"> |
| <svg xmlns="http://www.w3.org/2000/svg" class="mb-px mr-1" width="18" height="18" viewBox="0 0 24 24" role="presentation"> |
| <g fill="currentColor"> |
| <path fill-rule="evenodd" d="M11.03 2.59a1.5 1.5 0 011.94 0l7.5 6.363a1.5 1.5 0 01.53 1.144V19.5a1.5 1.5 0 01-1.5 1.5h-5.75a.75.75 0 01-.75-.75V14h-2v6.25a.75.75 0 01-.75.75H4.5A1.5 1.5 0 013 19.5v-9.403c0-.44.194-.859.53-1.144l7.5-6.363zM12 3.734l-7.5 6.363V19.5h5v-6.25a.75.75 0 01.75-.75h3.5a.75.75 0 01.75.75v6.25h5v-9.403L12 3.734z"/> |
| </g> |
| </svg> |
| <span>Home</span> |
| </a> |
| </li> |
| |
| </ul> |
| </nav> |
| </div> |
| |
| <a class="flex items-center justify-center flex-nowrap h-16 text-gray-400 dark:text-dark-400 hover:text-gray-700 dark:hover:text-dark-300 transition-colors duration-150 ease-in docs-powered-by" target="_blank" href="https://retype.com/" rel="noopener"> |
| <span class="text-xs whitespace-nowrap">Powered by</span> |
| <svg xmlns="http://www.w3.org/2000/svg" class="ml-2" fill="currentColor" width="96" height="20" overflow="visible"><path d="M0 0v20h13.59V0H0zm11.15 17.54H2.44V2.46h8.71v15.08zM15.8 20h2.44V4.67L15.8 2.22zM20.45 6.89V20h2.44V9.34z"/><g><path d="M40.16 8.44c0 1.49-.59 2.45-1.75 2.88l2.34 3.32h-2.53l-2.04-2.96h-1.43v2.96h-2.06V5.36h3.5c1.43 0 2.46.24 3.07.73s.9 1.27.9 2.35zm-2.48 1.1c.26-.23.38-.59.38-1.09 0-.5-.13-.84-.4-1.03s-.73-.28-1.39-.28h-1.54v2.75h1.5c.72 0 1.2-.12 1.45-.35zM51.56 5.36V7.2h-4.59v1.91h4.13v1.76h-4.13v1.92h4.74v1.83h-6.79V5.36h6.64zM60.09 7.15v7.48h-2.06V7.15h-2.61V5.36h7.28v1.79h-2.61zM70.81 14.64h-2.06v-3.66l-3.19-5.61h2.23l1.99 3.45 1.99-3.45H74l-3.19 5.61v3.66zM83.99 6.19c.65.55.97 1.4.97 2.55s-.33 1.98-1 2.51-1.68.8-3.04.8h-1.23v2.59h-2.06V5.36h3.26c1.42 0 2.45.28 3.1.83zm-1.51 3.65c.25-.28.37-.69.37-1.22s-.16-.92-.48-1.14c-.32-.23-.82-.34-1.5-.34H79.7v3.12h1.38c.68 0 1.15-.14 1.4-.42zM95.85 5.36V7.2h-4.59v1.91h4.13v1.76h-4.13v1.92H96v1.83h-6.79V5.36h6.64z"/></g></svg> |
| </a> |
| </div> |
| </template> |
| </doc-sidebar> |
| |
| <div class="grow min-w-0 dark:bg-dark-850"> |
| <!-- Render "toolbar" template here on api pages --><!-- Render page content --> |
| <div class="flex"> |
| <div class="grow min-w-0 px-6 md:px-16"> |
| <main class="relative pt-6 pb-16"> |
| <div class="docs-markdown" id="docs-content"> |
| <!-- Rendered if sidebar right is enabled --> |
| <div id="docs-sidebar-right-toggle"></div> |
| |
| <!-- Page content --> |
| <doc-anchor-target id="build-blissrom" class="break-words"> |
| <h1> |
| <doc-anchor-trigger class="header-anchor-trigger" to="#build-blissrom">#</doc-anchor-trigger> |
| <span>Build BlissRom</span> |
| </h1> |
| </doc-anchor-target> |
| <doc-anchor-target id="introduction"> |
| <h2> |
| <doc-anchor-trigger class="header-anchor-trigger" to="#introduction">#</doc-anchor-trigger> |
| <span>Introduction</span> |
| </h2> |
| </doc-anchor-target> |
| <p>This is the official guide to build BlissRom for your device. In this guide, we will only cover official devices with actual maintainers. We will not delve into porting devices.</p> |
| <p>The golden rule to building is patience. If something breaks, wait for your maintainer to fix it, send a polite message to your maintainer, or better yet, try and fix it yourself. Then you can make a merge request and contribute!</p> |
| <p>Let’s get started.</p> |
| <doc-anchor-target id="preparation"> |
| <h2> |
| <doc-anchor-trigger class="header-anchor-trigger" to="#preparation">#</doc-anchor-trigger> |
| <span>Preparation</span> |
| </h2> |
| </doc-anchor-target> |
| <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> |
| <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> |
| <doc-anchor-target id="install-the-jdk"> |
| <h3> |
| <doc-anchor-trigger class="header-anchor-trigger" to="#install-the-jdk">#</doc-anchor-trigger> |
| <span>Install the JDK</span> |
| </h3> |
| </doc-anchor-target> |
| <p>Install OpenJDK:</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none">sudo apt install openjdk-8-jdk</code></pre> |
| </doc-codeblock></div> |
| <doc-anchor-target id="install-build-tools"> |
| <h3> |
| <doc-anchor-trigger class="header-anchor-trigger" to="#install-build-tools">#</doc-anchor-trigger> |
| <span>Install build tools</span> |
| </h3> |
| </doc-anchor-target> |
| <p>To install the required build tools, run the following command:</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none">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> |
| </doc-codeblock></div> |
| <doc-anchor-target id="install-source-code-tools"> |
| <h3> |
| <doc-anchor-trigger class="header-anchor-trigger" to="#install-source-code-tools">#</doc-anchor-trigger> |
| <span>Install source code tools</span> |
| </h3> |
| </doc-anchor-target> |
| <p>Now we need to get the source code via a program named <code v-pre>repo</code>. The primary function of <code v-pre>repo</code> is to read a manifest file located in BlissRoms GitHub organization, and find what repositories you need to actually build Android.</p> |
| <p>Create a <code v-pre>~/bin</code> directory for <code v-pre>repo</code>:</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none">mkdir -p ~/bin</code></pre> |
| </doc-codeblock></div> |
| <p>The <code v-pre>-p</code> flag instructs <code v-pre>mkdir</code> to <em>only</em> create the directory if it does not exist in the first place. Now download the <code v-pre>repo</code> tool into <code v-pre>~/bin</code>:</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none">curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo</code></pre> |
| </doc-codeblock></div> |
| <p>Make <code v-pre>repo</code> executable:</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none">chmod a+x ~/bin/repo</code></pre> |
| </doc-codeblock></div> |
| <p>And add it to PATH:</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none">nano .bashrc</code></pre> |
| </doc-codeblock></div> |
| <p>Scroll to the end of the file and type these lines:</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none"># Export ~/bin |
| export PATH=~/bin:$PATH</code></pre> |
| </doc-codeblock></div> |
| <p>Ctrl-O and enter to save, then Ctrl-X to exit nano. Now either logout and login again (or reboot), or <code v-pre>source</code> the file:</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none">source .bashrc</code></pre> |
| </doc-codeblock></div> |
| <p>Which can be shortened to:</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none">. .bashrc</code></pre> |
| </doc-codeblock></div> |
| <doc-anchor-target id="what-is-source"> |
| <h4> |
| <doc-anchor-trigger class="header-anchor-trigger" to="#what-is-source">#</doc-anchor-trigger> |
| <span>What is <code v-pre>source</code>?</span> |
| </h4> |
| </doc-anchor-target> |
| <p><code v-pre>source</code> is a <code v-pre>bash</code> command to read aliases, functions, and commands from the specified file. Typically, you'll supply <code v-pre>bash</code> with a configuration file such as <code v-pre>.bashrc</code> or <code v-pre>.bash_profile</code>, or an initialization file such as <code v-pre>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 v-pre>breakfast</code>, <code v-pre>brunch</code>, and <code v-pre>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 v-pre>bash</code> cannot automatically detect changes in our files. To solve this, we either <code v-pre>source</code> it or log out and log back in, forcing <code v-pre>bash</code> to reload configuration files. Keep this in mind, because unlike configuration files, if you forget to <code v-pre>source</code> initialization files, build commands will not function!</p> |
| <doc-anchor-target id="download"> |
| <h3> |
| <doc-anchor-trigger class="header-anchor-trigger" to="#download">#</doc-anchor-trigger> |
| <span>Download</span> |
| </h3> |
| </doc-anchor-target> |
| <p>Create a directory for the source:</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none">mkdir -p ~/bliss/q |
| cd ~/bliss/q</code></pre> |
| </doc-codeblock></div> |
| <p>Before we download, we need to tell <code v-pre>repo</code> and <code v-pre>git</code> who we are. Run the following commands, substituting your information:</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none">git config --global user.email "john.appleseed@example.com" |
| git config --global user.name "John Appleseed"</code></pre> |
| </doc-codeblock></div> |
| <p>Now, we’re ready to initialize. We need to tell <code v-pre>repo</code> which manifest to read:</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none">repo init -u https://github.com/BlissRoms/platform_manifest.git -b r</code></pre> |
| </doc-codeblock></div> |
| <p><code v-pre>-b</code> is for the branch, and we’re on <code v-pre>q</code>, Android 10. It’ll take a couple of seconds. You may need to type <code v-pre>y</code> for the color prompt.</p> |
| <p>Then sync the source:</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none">repo sync -j$(nproc --all) -c</code></pre> |
| </doc-codeblock></div> |
| <p><em>Note: For more information about the <code v-pre>repo</code> tool, visit the</em> <a href="build-tips.md"><em>Build Tips guide</em></a> <em>to learn more about the</em> <a href="build-tips.md#repo-optimization-tips"><em>repo flags</em></a><em>.</em></p> |
| <p><code v-pre>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> |
| <doc-anchor-target id="build"> |
| <h3> |
| <doc-anchor-trigger class="header-anchor-trigger" to="#build">#</doc-anchor-trigger> |
| <span>Build</span> |
| </h3> |
| </doc-anchor-target> |
| <p>Set up the build environment:</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none">. build/envsetup.sh</code></pre> |
| </doc-codeblock></div> |
| <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 v-pre>source</code> this file every time you log out and log back in, or launch a new <code v-pre>bash</code>/Terminal instance.</p> |
| <p>Define what device you’re going to build. For example, the Pixel 4A, has a codename of <code v-pre>sunfish</code>. You can check your specific device's codename on GitHub or on Google. Execute:</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none">breakfast sunfish</code></pre> |
| </doc-codeblock></div> |
| <p>What does this do? <code v-pre>breakfast</code> searches repositories for your device "tree", which contains all the details needed to make the build suitable for your device. CPU, kernel info, device screen size, whether the board has Bluetooth, NFC, what frequencies the build needs for Wi-Fi, and a bunch of other things. <code v-pre>breakfast</code> will automatically search in the <code v-pre>BlissRoms-Devices</code> GitHub repository, and grab your device tree for you.</p> |
| <p>Okay, so we have the device tree set up. Feel free to browse around the source code to see what changed. You should see folders added to <code v-pre>device/</code>, <code v-pre>kernel/</code> and <code v-pre>vendor/</code>. A shortcut:</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none">croot</code></pre> |
| </doc-codeblock></div> |
| <p>will dump you back in the root of the source code tree. So if you’ve been going through folders and don’t have any idea where you are, you can use the above command. This command, however, requires you to have <code v-pre>source</code>d <code v-pre>build/envsetup.sh</code> earlier.</p> |
| <p>We're ready to build, but before we teach you the easy command to execute a build, we will first try the manual method. To set up the current terminal environment for building your particular device, execute:</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none">lunch bliss_sunfish-userdebug</code></pre> |
| </doc-codeblock></div> |
| <p>Let's break down the command. <code v-pre>lunch</code> initializes the proper environmental variables required for the build tools to build your specific device. Things like <code v-pre>BLISS_DEVICE</code> and other variables are set in this stage, and the changed variables will be shown as output. <code v-pre>bliss_</code> is the ROM that we are building. As convention, all devices will have this prefix. <code v-pre>sunfish</code> is the specific device we are building - in this case, the Pixel 4A. Finally, <code v-pre>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 v-pre>user</code> which disables most of the useful Android Logcats.</p> |
| <doc-anchor-target id="my-device-isnt-booting-and-userdebug-wont-print-any-adb-logcats-what-gives"> |
| <h4> |
| <doc-anchor-trigger class="header-anchor-trigger" to="#my-device-isnt-booting-and-userdebug-wont-print-any-adb-logcats-what-gives">#</doc-anchor-trigger> |
| <span>My device isn't booting, and <code v-pre>userdebug</code> won't print any <code v-pre>adb logcat</code>s. What gives?</span> |
| </h4> |
| </doc-anchor-target> |
| <p>There is a third build variant called <code v-pre>eng</code>, short for engineering builds. These builds will activate <code v-pre>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 v-pre>eng</code> build!</p> |
| <p>All set? Let's start the building process. Run:</p> |
| <p><code v-pre>mka blissify</code></p> |
| <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> |
| <doc-anchor-target id="why-mka-and-not-make"> |
| <h4> |
| <doc-anchor-trigger class="header-anchor-trigger" to="#why-mka-and-not-make">#</doc-anchor-trigger> |
| <span>Why <code v-pre>mka</code> and not <code v-pre>make</code>?</span> |
| </h4> |
| </doc-anchor-target> |
| <p><code v-pre>make</code> only runs with 1 thread. <code v-pre>mka</code> is properly aliased to use all of your threads by checking <code v-pre>nproc</code>.</p> |
| <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 v-pre>make blissify -j#</code>, replacing the hash with the number of threads (example of <code v-pre>make blissify -j4</code>).</p> |
| <doc-anchor-target id="i-get-an-error-about-no-blissify-targets-to-build-against-whats-wrong"> |
| <h4> |
| <doc-anchor-trigger class="header-anchor-trigger" to="#i-get-an-error-about-no-blissify-targets-to-build-against-whats-wrong">#</doc-anchor-trigger> |
| <span>I get an error about no <code v-pre>blissify</code> targets to build against, what's wrong?</span> |
| </h4> |
| </doc-anchor-target> |
| <p>If you are building other ROMs, it is usually <code v-pre>make bacon</code>. For BlissRoms, we chose the build target of <code v-pre>blissify</code>. If that doesn't work, sometimes there is a bug, or the ROM developers do not implement a <code v-pre>bacon</code> target to build against. In this case, you will need to find what name they use to initialize a full build of the ROM. Conventionally, it is supposed to be <code v-pre>bacon</code>, but some ROM developers change this name inadvertently, or actually have a bug that causes the build target to never be found. If you cannot locate the build target, ask the developers of the ROM. Alternatively, you can try poking around in <code v-pre>build/make/core/Makefile</code> to see what the build target name is. But this is out of the scope of this article as you're not supposed to be building other ROMs (that's not what this tutorial is for, sorry!)</p> |
| <p>All right, but that's annoying. You had to type <strong>three</strong> commands to build it all. What about running one command?</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none"> blissify options codename</code></pre> |
| </doc-codeblock></div> |
| <p><strong>Options:</strong></p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none">-h | --help: Shows the help dialog |
| -c | --clean: Clean up before running the build |
| -d | --devclean: Clean up device only before running the build |
| -v | --vanilla: Build with no added app store solution **default option** |
| -g | --gapps: Build with Google Play Services added |
| -f | --foss: build with FOSS (arm64-v8a) app store solutions added **requires vendor/foss** |
| -u : userdebug (default) |
| -U : user |
| -e : eng</code></pre> |
| </doc-codeblock></div> |
| <p><strong>Examples:</strong></p> |
| <ul> |
| <li><strong>To build with gapps</strong></li> |
| </ul> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none"> blissify -g sunfish</code></pre> |
| </doc-codeblock></div> |
| <ul> |
| <li><strong>To build with FOSS</strong></li> |
| </ul> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none"> blissify -f sunfish</code></pre> |
| </doc-codeblock></div> |
| <ul> |
| <li><strong>To build with gapps and deviceclean</strong></li> |
| </ul> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none"> blissify -g -d sunfish</code></pre> |
| </doc-codeblock></div> |
| <ul> |
| <li><strong>To build an userdebug build with gapps</strong></li> |
| </ul> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none"> blissify -u -g sunfish</code></pre> |
| </doc-codeblock></div> |
| <ul> |
| <li><strong>To build an eng build with gapps</strong></li> |
| </ul> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none"> blissify -e -g sunfish</code></pre> |
| </doc-codeblock></div> |
| <ul> |
| <li><strong>To build an user build with gapps</strong></li> |
| </ul> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none"> blissify -U -g sunfish</code></pre> |
| </doc-codeblock></div> |
| <p><strong>This method is also backwards compatible with the legacy blissify command also</strong> |
| Default build type = userdebug |
| Default build variant = vanilla</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none"> blissify sunfish</code></pre> |
| </doc-codeblock></div> |
| <p>But what is <code v-pre>blissify</code>? It is a compact form of these commands:</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none">breakfast sunfish |
| lunch bliss_sunfish-userdebug |
| make blissify</code></pre> |
| </doc-codeblock></div> |
| <p>Sounds great, right? Once you have run the command, jump over to the next section.</p> |
| <doc-anchor-target id="after-building"> |
| <h3> |
| <doc-anchor-trigger class="header-anchor-trigger" to="#after-building">#</doc-anchor-trigger> |
| <span>After building</span> |
| </h3> |
| </doc-anchor-target> |
| <p>There are two outcomes to a build - either it fails and you get a red error message from <code v-pre>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> |
| <p>If you face the latter, congratulations! You've successfully built BlissRoms for your device. Grab the artifacts for your device:</p> |
| <div class="codeblock-wrapper"><doc-codeblock> |
| <pre class="language-none"><code v-pre class="language-none">cd out/target/product/sunfish/</code></pre> |
| </doc-codeblock></div> |
| <p>In here, you’ll find a <code v-pre>.zip</code> that goes along the lines of <code v-pre>Bliss-v14.4-sunfish-UNOFFICIAL-vanilla-20210615.zip</code>. Install TWRP, flash the build to your device, and enjoy!</p> |
| |
| |
| <!-- Required only on API pages --> |
| <doc-toolbar-member-filter-no-results /> |
| </div> |
| <footer class="clear-both"> |
| <div class="flex flex-wrap items-center justify-between mt-14"> |
| <a class="my-2.5 inline-flex items-center text-sm whitespace-nowrap text-blue-500 dark:text-blue-400 hover:text-blue-700 hover:underline" href="https://github.com/BlissRoms/Documentation/blob/main/development/build-guide.md" target="_blank" rel="noopener"> |
| <svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="currentColor" overflow="visible"><path d="M20 12c-.55 0-1 .45-1 1v7c0 .55-.45 1-1 1H4c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h7c.55 0 1-.45 1-1s-.45-1-1-1H4C2.35 3 1 4.35 1 6v14c0 1.65 1.35 3 3 3h14c1.65 0 3-1.35 3-3v-7c0-.55-.45-1-1-1z" /><path d="M22.21 1.79c-1.18-1.18-3.24-1.18-4.41 0l-9.5 9.5c-.13.13-.22.29-.26.46l-1 4c-.08.34.01.7.26.95.18.2.44.3.7.3.08 0 .16-.01.24-.03l4-1c.18-.04.34-.13.46-.26l9.5-9.5c1.22-1.22 1.22-3.2.01-4.42zm-1.42 3l-9.3 9.3-2.11.53.53-2.11 9.3-9.3c.42-.42 1.16-.42 1.59 0 .43.43.43 1.15-.01 1.58z" /><path fill="none" d="M0 0h24v24H0z" /></svg> |
| <span>Edit on GitHub</span> |
| </a> |
| </div> |
| |
| <nav class="flex mt-14"> |
| <div class="w-1/2"> |
| <a class="px-5 py-4 h-full flex items-center break-normal font-medium text-blue-500 dark:text-blue-400 border border-gray-300 hover:border-gray-400 dark:border-dark-650 dark:hover:border-dark-450 rounded-l-lg transition-colors duration-150 relative hover:z-5" href="../../"> |
| <svg xmlns="http://www.w3.org/2000/svg" class="mr-3" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" overflow="visible"><path d="M19 11H7.41l5.29-5.29a.996.996 0 10-1.41-1.41l-7 7a1 1 0 000 1.42l7 7a1.024 1.024 0 001.42-.01.996.996 0 000-1.41L7.41 13H19c.55 0 1-.45 1-1s-.45-1-1-1z" /><path fill="none" d="M0 0h24v24H0z" /></svg> |
| <span> |
| <span class="block text-xs font-normal text-gray-400 dark:text-dark-400">Previous</span> |
| <span class="block mt-1">Getting Started</span> |
| </span> |
| </a> |
| </div> |
| |
| <div class="w-1/2"> |
| <a class="px-5 py-4 -mx-px h-full flex items-center justify-end break-normal font-medium text-blue-500 dark:text-blue-400 border border-gray-300 hover:border-gray-400 dark:border-dark-650 dark:hover:border-dark-450 rounded-r-lg transition-colors duration-150 relative hover:z-5" href="../../development/troubleshoot/"> |
| <span> |
| <span class="block text-xs font-normal text-right text-gray-400 dark:text-dark-400">Next</span> |
| <span class="block mt-1">Troubleshoot</span> |
| </span> |
| <svg xmlns="http://www.w3.org/2000/svg" class="ml-3" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" overflow="visible"><path d="M19.92 12.38a1 1 0 00-.22-1.09l-7-7a.996.996 0 10-1.41 1.41l5.3 5.3H5c-.55 0-1 .45-1 1s.45 1 1 1h11.59l-5.29 5.29a.996.996 0 000 1.41c.19.2.44.3.7.3s.51-.1.71-.29l7-7c.09-.09.16-.21.21-.33z" /><path fill="none" d="M0 0h24v24H0z" /></svg> |
| </a> |
| </div> |
| </nav> |
| </footer> |
| </main> |
| |
| <div class="border-t dark:border-dark-650 pt-6 mb-8"> |
| <footer class="flex flex-wrap items-center justify-between"> |
| <div> |
| <ul class="flex flex-wrap items-center text-sm"> |
| </ul> |
| </div> |
| <div class="docs-copyright py-2 text-gray-500 dark:text-dark-350 text-sm leading-relaxed"><p>© Copyright 2022 – <a href="https://blisslabs.org/">BlissLabs</a> – All rights reserved</p></div> |
| </footer> |
| </div> |
| </div> |
| |
| <!-- Rendered if sidebar right is enabled --> |
| <!-- Sidebar right skeleton--> |
| <div v-cloak class="fixed top-0 bottom-0 right-0 translate-x-full bg-white border-gray-200 lg:sticky lg:border-l lg:shrink-0 lg:pt-6 lg:transform-none sm:w-1/2 lg:w-64 lg:z-0 md:w-104 sidebar-right skeleton dark:bg-dark-850 dark:border-dark-650"> |
| <div class="pl-5"> |
| <div class="w-32 h-3 mb-4 bg-gray-200 dark:bg-dark-600 rounded-full loading"></div> |
| <div class="w-48 h-3 mb-4 bg-gray-200 dark:bg-dark-600 rounded-full loading"></div> |
| <div class="w-40 h-3 mb-4 bg-gray-200 dark:bg-dark-600 rounded-full loading"></div> |
| </div> |
| </div> |
| |
| <!-- User should be able to hide sidebar right --> |
| <doc-sidebar-right v-cloak></doc-sidebar-right> |
| </div> |
| |
| </div> |
| </div> |
| |
| <doc-search-mobile></doc-search-mobile> |
| <doc-back-to-top></doc-back-to-top> |
| </div> |
| |
| |
| <div id="docs-overlay-target"></div> |
| |
| <script>window.__DOCS__ = { "title": "Build BlissRom", level: 2, icon: "file", hasPrism: false, hasMermaid: false, hasMath: false }</script> |
| </body> |
| </html> |