ADB Sideloading Lineage onto your Ouya via Raspberry Pi.
This tutorial assumes that you have already set up your base Raspberry Pi OS and that you are either operating locally on the Pi or via SSH from another PC. This tutorial dives into the ability to sideload all of the packages required for the OS known as Lineage, which is a rebirth of the Cyanogen project in previous tutorials that we have done. This tutorial also assumes that This is our current 2019 method of flashing and programming Ouya and Android devices due to the nature of commercial OSs locking the security down on hardware devices. Read on if you want to learn more.
"Note: If you get a black screen but the audio is playing. Or you got a potato PC and it's studdering. We have fallback Links below."
Video tutorial fallback mirrors:
In case you have no-script enabled or for some reason cannot see the title video on this website. We have provided direct links for these videos. For more information about the standards we use on this site click here if you would like to know more.
AV1 - Link MP4/.h264 - Link OGV - Link
Prerequisites:
This tutorial assumes that you have performed the following tasks from previous blog entries. Describing everything in a solid blog article would tend to lead down the path of insanity as it would be 10,000+ words and over 27 minutes of video that some more experienced users may or may not need.
Section 1: Preparing the Raspberry Pi image with ADB
Section 2: Setting up your Pi in headless/wireless mode to ADB with your Ouya.
Acquire the software:
A blog or any tutorial frankly should be responsible enough to provide you with all of the tools that you need to perform what it is teaching. This is why we use a blog CMS service instead of just joining a forum to dump this content upon. This is the belief that we hold. The downloads that you click on here are being hosted locally and with no tracking/spyware/adware/malware attached to it. We are not going to throw you off into some garbage "Free-Filez" site that's going to load your Android or PC with crap either! However, I should also throw a disclaimer that anything you download off of the internet is suspect. You should have a virus scanner on your machine to ensure that the files you are getting are legit.
Always check your data!
I have set up a link for all of the Lineage to take place onto your Ouya is known as "lineageouya.7z". Click here or on the Download icon to the right to begin downloading the 7-zip file.
Extract files from the archive:
Use your favorite file extraction utility on the 7-zip file you just downloaded. For this tutorial, we will be extracting to /d0/ on the Raspberry Pi which we will be using as a reference point throughout this tutorial. If you extract it elsewhere or if you are on a MAC or Windows box make note of where you extract it to and make adjustments accordingly.
The files that are in lineageouya.7z are as follows:
- adb.exe for Windows (which isn't necessary) as well as the two DLLs required to run ADB
- fastboot.exe for Windows (which isn't necessary ) which will be required to upload the recovery-clockwork-6.0.4.8-ouya.img via the micro-USB cable.
- zip folder containing the following:lineage-11-20190501-NIGHTLY-MLQ-ouya (Ouya nightly build of the Lineage OS) gapps-kk-20140105.zip (Google Play Apps) ouyabootmenu-mlq-v2.0.4.zip (required for Ouyas boot-menu) ouya-keylayouts.zip (which contains .kl files for the Ouya controller as well as a few other genetic controllers) recovery-clockwork-6.0.4.8-ouya.zip (This version of clockworks gets installed onto your Ouya boot-loader and does not get removed). Please note: At the time of the article this was the most currently nightly build. Newer versions can be acquired here.
- A Windows driver folder containing files that allow you to access your Ouya in both "ADB" mode and "Fastboot" mode. The android_winusb.inf is already modified to find an Ouya on USB device USB\VID_2836&PID_0010. This is placed here for the convenience of Windows users and is not used for the Raspberry Pi Linux tutorials mentioned here.
- apk folder which although we will not be using any APK during the installation of Lineage is exceptionally handy to have after you have installed everything as I shall show you later. Such as quick boot.
"Push" vs. "SideLoad" Methodologies.
Push method involves you the user to adb push <<FILE>> to the /sdcard/ folder of your Ouya which seems like a good idea but it can take of valuable space on your Ouya with it only being an 8GB console (the Lineage OS alone is 300MB that has to sit on your /sdcard/ this way. The sideload method means that as the files are ADB sideload <<FILE>> to our Ouya they are installed and discarded.
We feel it's important to cover both methods as sideloading will be the method used in the event of an unrecoverable or "Bricked" OS partition.
The Push method of preferred if your Ouya OS partition is intact and you want to save a lot of going back and forth between your Raspberry Pi or Linux box and your Ouya. The Push method is also handy if you download an upgrade to Lineage from Milaq and you can simply reboot your Ouya and jump back into recovery without needing to hook up your Raspberry Pi back up to your Ouya.
Let's begin!
This is probably a good idea to power on your Ouya and connect the ADB cable between your Ouya and your Raspberry Pi. Also, if you have an extra keyboard now would be a good time to also have that plugged into the back of the Ouya on the regular USB port as it will be necessary to navigate menus with the recovery system.
The first thing you will probably need to do is either open up the terminal on the Raspberry Pi if you are directly using the Pi as a desktop. If you are using the Pi in a headless state or you are SSH'ing into the Raspberry Pi be sure to log in to begin. First, we're going to go to wherever you downloaded and extracted the lineageouya.7z archive. For the sake of this tutorial we are going to assume that is located in /d0/lineageouya so:
cd /d0/lineageouya
then we're going to start up our ADB server and check the connection with our Ouya.
adb start-server
and
adb devices
To verify that we have connectivity with our Ouya. Now, let's get the Ouya into bootloader mode so we can load our recovery software.
adb reboot bootloader
Do not be alarmed! Your Ouya will blackout! This is because we're starting the Ouya off in a bootloader state meaning it has no program loaded into memory right now. Now that we are in a bootloader state we will now use another Android utility called 'fastboot' to check to see if our Ouya is ready.
fastboot devices.
Your Ouya should respond with the following:
015d49062a501415 fastboot
if for some reason you don't see fastboot but you can see the Ouya in ADB devices then the quality of your USB cable is probably crap and you should get another cable. Once we have confirmed our connectivity we can pass the command to load an image from our Raspberry Pi to the Ouya and boot it.
fastboot boot recovery-clockwork-06.0.4.8-ouya.img
It should respond with the following:
downloading 'boot.img'... OKAY [ 1.572s] booting... OKAY [ 0.263s]
Within a few seconds, your Ouya should come back to life and begin displaying the ClockWorkMOD interface.
On the Ouya...
Out of interest in saving bandwidth, we shall only focus on the menu selector in the upper left-hand corner as that is probably the most important aspect of this utility.
Arrow down with the keyboard to install zip and press enter.
Arrow down again to install zip from sideload and press enter.
At this point, we do not have to touch anything on the Ouya and we head back over to your Raspberry Pi/SSH Linux session.
Back to the Raspberry Pi.
We're going to CD into the zip folder which is where we kept all of the images for upgrading our Ouya to Lineage.
cd zip
if we check out our ADB devices we see that some things have changed.
adb devices
Your Ouya now returns the value
015d49062a501415 sideload
indicating it is ready to receive some data! So let us get started
adb sideload recovery-clockwork-6.0.4.8-ouya.zip
clockwork recovery is generally the first file we send over to the Ouya, replacing the recovery partition of the Ouya with clockwork from here on out. Your Ouya will then give you a report of the transfer status.
loading: 'recovery-clockwork-6.0.4.8-ouya.zip' sending: 'recovery-clockwork-6.0.4.8-ouya.zip' 100%
after the transfer is complete ClockWorkMOD will come to life and install the sideloaded file it just received.
Back to the Ouya.
After the first file is uploaded it will kick you back to this menu. Repeat the process and Arrow down once again to install zip from sideload and press enter.
Once again we do not have to touch anything on the Ouya and we head back over to your Raspberry Pi/SSH Linux session.
Back to the Raspberry Pi.
We can move along to the next item to side-load which is the Ouya Boot Menu. Which is a black and white screen that appears briefly on power-up allowing you to use the power button on the Ouya to navigate the menus to go into recovery mode if necessary.
adb sideload ouyabootmenu-mlq-v2.0.4.zip
Once it has been transferred and installed we jump back to the Ouya again.
Back to the Ouya.
After the first file is uploaded it will kick you back to this menu. Repeat the process and Arrow down once again to install zip from sideload and press enter.
Once again we do not have to touch anything on the Ouya and we head back over to your Raspberry Pi/SSH Linux session.
Back to the Raspberry Pi.
The next step is we're going to load the Lineage or Cyanogen OS itself. this load can take up to 10 minutes depending on connectivity and processing ability available at the time
adb sideload lineage-11-20191201-NIGHTLY-MLQ-ouya
Upon completion return to the Ouya.
Back to the Ouya.
After the first file is uploaded it will kick you back to this menu. Repeat the process and Arrow down once again to install zip from sideload and press enter.
Once again we do not have to touch anything on the Ouya and we head back over to your Raspberry Pi/SSH Linux session.
Back to the Raspberry Pi.
Although completely optional especially if you get your APKs elsewhere we could load Google apps as well.
adb sideload gapps-kk-20140105.zip
After the transfer is complete you can return to the Ouya.
Back to the Ouya.
After the first file is uploaded it will kick you back to this menu. Repeat the process and Arrow down once again to install zip from sideload and press enter.
Once again we do not have to touch anything on the Ouya and we head back over to your Raspberry Pi/SSH Linux session.
Back to the Raspberry Pi.
Next, we're going to load the Ouya key layouts archive which contains the libraries of joystick and controller support .kl conversions to ensure that whatever joystick that is plugged in will not suck.
adb sideload ouya-keylayouts-1.02.zip
After the transfer is complete you can return to the Ouya.
Back to the Ouya.
After the first file is uploaded it will kick you back to this menu. Repeat the process and Arrow down once again to install zip from sideload and press enter.
Once again we do not have to touch anything on the Ouya and we head back over to your Raspberry Pi/SSH Linux session.
Back to the Raspberry Pi.
Once again this utility isn't necessary but it is incredibly handy which is the Super-User utility.
adb sideload SR3-SuperSU-v2.79-SR3-20170114223742.zip
After the transfer is complete you can return to the Ouya.
Clearing all forms of cache.
This is probably the most critical step in a successful flash or OS load of an Ouya so pay attention!
We will need to wipe the system cache folder, clear user data, and finally remove the Dalvik cache that Google services would use. The reason we must do this is we need to clear any garbage that the previous OS left behind on the Android OS and make way for the new Lineage load to properly set up our user profile. So let us begin!
Since we are all done processing zip files and flashing our image to the Ouya we can arrow down to +++++Go Back+++++ .
At the main menu of ClockWorkMOD, we're going to arrow down to wipe data/factory reset and press enter.
Arrow down to Yes press enter. The Ouya will go to work clearing all non-essential data from the user folders. After it is complete it will dump you back to the main menu.
Arrow down to wipe cache partition and press enter.
Arrow down to Yes and press enter. The Ouya will then empty its cache partition and dump you back to the main menu.
Arrow down to advanced and press enter.
Within the advanced menu, we are going to arrow down to wipe Dalvik cache and press enter.
Once again it will ask for confirmation. Arrow down to Yes and press enter. The system will go to work and remove any of the cache files the Google Service may use.
Arrow all the way down to +++++Go Back+++++ and press enter.
Arrow over to reboot the system now and press enter.
If you ran the SuperSU script you may get an error like this warning you that root access is potentially lost. This is normal because of the way SuperSU operates. simply press No to continue and your Ouya will reboot.
Welcome to the Ouya Afterlife.
After the reboot, this screen would appear for a few seconds. You can use the Ouya power button to cycle down to "recovery" if you ever want to get back to ClockWorkMOD in case you forgot to clear that cache as we asked you to do. ;) Also, it's useful for flashing newer versions of lineage or reverting the system back stock.
After 3 seconds it will disappear and begin to load the OS.
Lineage may take up to 5-10 minutes to load and cycle. So be patient during this step. It has a lot of unpacking and figuring out the fact that you placed Lineage on an Ouya of all things!
This warning window may come up if your Raspberry Pi is still connected via the ADB cable. Since we might pass additional commands in Lineage such as ADB install <<APP>> we're going to use the keyboard to tab over to "Always allow from this computer" and then tab down to the "OK" button.
Final Thoughts
With the "Welcome to LineageOS" screen this tutorial ends and the new life of your Ouya begins!
This tutorial is a part of a series on how to ADB Lineage with a Raspberry Pi.
We do hope that you found this tutorial useful; Until next time.
May Server Protect you
+++ END OF LINE.
Hey,
Many thanks for making this blog and posts!
I wanted to try to resurrect my OUYA as well, haven't really used at all (Kickstarter backer here).
Now i will find some good use for it :)
I've put on postmarketOs on it first, was a PITA to do and when i finally got it up & running, i was getting kernel panics at random and i got fed up with that route.
Now using your post i've put LineageOS on my OUYA (which was way easier to do by just following these clear steps).
Oooooo, PostmarketOS. I wanted to give that one a try when i had more time.
But thanks for checking out this blog article on how I mod Ouyas. Super appreciated!