This guide covers building of Switchroot Android 11/R, based on LineageOS 18.1, with Switchroot + Lineage's nx device repo and LineageOS mainline trees.
This is a GUIDE, not a SCRIPT--read and understand, don't just copy-paste
We recommend inexperienced users do not build this. Android 11 is not yet ready for release or public consumption. The source trees may have missing bits or be incomplete, issues will be present until (and through) the final release, and we do not provide any support for self-compiled installs (and they will not receive OTA updates).
Note that while this isn't ready for use at the moment, it does support all Switch models.
PSA and Licensing
These repos are licenses under the Apache License, version 2.0, for all AOSP, LineageOS Project, and Switchroot (via personal copyright) copyright-labelled files, and the Linux kernel (along with some drivers) is licensed under the GNU General Public License, version 2. Attribution and/or patches are required to be published as per each license.
Requirements
~350 GB free storage
~16GB RAM
Ubuntu Linux installation (WSL2 works as well, but the i/o speeds are generally extremely poor)
Environment Setup
# Grab platform tools & add to pathexport BUILDBASE=[path-to-build-root]wgethttps://dl.google.com/android/repository/platform-tools-latest-linux.zipunzipplatform-tools-latest-linux.zip-d~cat>>~/.profile<<EOF# add Android SDK platform tools to pathif [ -d "\$HOME/platform-tools" ] ; then PATH="\$HOME/platform-tools:\$PATH"fiEOF# Update and grab new packagessudoaptupdatesudoaptupgradesudoaptinstallbcbisonbuild-essentialccachecurlflexg++-multilibgcc-multilibgitgit-lfsgnupggperfimagemagicklib32ncurses5-devlib32readline-dev \lib32z1-dev liblz4-toollibncurses5libncurses5-devlibsdl1.2-devlibssl-devlibxml2libxml2-utilslzoppngcrushpython3rsyncschedtoolsquashfs-tools \xsltproc zipzlib1g-dev# Needed on some versions of Ubuntusudoaptinstallpython-is-python3# Only needed for Ubuntu < 20.04:sudoaptinstalllibwxgtk3.0-devpython-is-python3# Only needed for Ubuntu < 16.04:sudoaptinstalllibwxgtk2.8-dev# Create foldersmkdir-p~/binmkdir-p $BUILDBASE/android/lineage# Grab repo commandcurlhttps://storage.googleapis.com/git-repo-downloads/repo>~/bin/repochmoda+x~/bin/repo# Only needed for older versions of Ubuntu:cat>>~/.profile<<EOF# set PATH so it includes user's private bin if it existsif [ -d "\$HOME/bin" ] ; then PATH="\$HOME/bin:\$PATH"fiEOF# The below must be run on all version of Ubuntu, regardless of whether bin is added to path.source~/.profile# Configure Gitgitconfig--globaluser.email"[email protected]"gitconfig--globaluser.name"Your Name"
Copy
Clean Build
# Init repo tree and grab Switchroot 18.1 manifestcd $BUILDBASE/android/lineagerepoinit-uhttps://github.com/LineageOS/android.git-blineage-18.1--git-lfsgitclonehttps://gitlab.com/switchroot/android/manifest.git--recursive-blineage-18.1.repo/local_manifests.repo/local_manifests/snack/snack.sh-yexport USE_CCACHE=1export CCACHE_EXEC=$(whichccache)export WITHOUT_CHECK_API=trueccache-M50Gsourcebuild/envsetup.sh# For standard tablet Androidlunchlineage_nx_tab-userdebug# For Android TVlunchlineage_nx-userdebug# Buildmkabacon
Copy
First Install
PLEASE WIPE ANY 17.1 OR OLD 18.1 INSTALLS BEFORE TRYING TO INSTALL
Grab the latest version of the hekate bootloader from HERE and unzip it to the root of the SD card-you NEED 6.0.3 or later.
From out/target/product/[device name], copy 00-android.ini to bootloader/ini/, bl31.bin and bl33.bin to switchroot/android, boot.img, recovery.img, and install/nx-plat.dtbimg to switchroot/install, and lineage-18.1-[date]-UNOFFICIAL-[device name].zip to the root of the SD card.
Flash Android in hekate's partition manager
Continue to Lineage Recovery and install the lineage... zip
Updating Tree
cd $BUILDBASE/android/lineage# ONLY IF YOU HAVEN'T BUILT FOR A WHILErepoinit--git-lfs.repo/local_manifests/snack/snack.sh-y# Use -n instead to skip syncing and# -w to not overwrite local changesexport USE_CCACHE=1export CCACHE_EXEC=$(whichccache)export WITHOUT_CHECK_API=trueccache-M50Gsourcebuild/envsetup.sh# For standard tablet Androidlunchlineage_nx_tab-userdebug# For Android TVlunchlineage_nx-userdebug# Buildmkabacon
Copy
Updating Install
PLEASE WIPE ANY 17.1 OR OLD 18.1 INSTALLS BEFORE TRYING TO INSTALL
From out/target/product/[device name], copy lineage-18.1-[date]-UNOFFICIAL-[device name].zip to the root of the SD card
Boot to Lineage Recovery by holding VOL+ on boot and install the new lineage... zip