Multi-Booting the Nexus 7 Tablet
Anyone who knows me well enough knows I love mobile devices. Phones, tablets and other shiny glowing gadgets are almost an addiction for me. I've talked about my addiction in other articles and columns, and Kyle Rankin even made fun of me once in a Point/Counterpoint column because my household has a bunch of iOS devices in it. Well, I was fortunate enough to add an Android device to the mix recently—a Nexus 7 tablet. I actually won this device at the Southern California Linux Expo as part of the Rackspace Break/Fix Contest, but that's a different story.
If you've not seen a Nexus 7, it's a nice little device. Like all "Nexus"-branded Android devices, it's a "reference" device for Google's base Android implementation, so it's got a well-supported set of hardware. I'm not trying to make this article sound like a full-fledged review of the device, but here's a few tech specs in case you're not familiar with it:
7" screen with 1280x800 resolution.
7.81" x 4.72" x 0.41" (198.5mm x 120mm x 10.45mm).
16 or 32GB of Flash storage (mine is the 16GB model).
1GB of RAM.
NVIDIA Tegra 3 Quad-Core Processor.
Wi-Fi, Bluetooth and optional 3G radios.
Android 4.2 Jelly Bean.
The Nexus line of Android devices makes up the reference implementation for Android, so that tends to be the series of device that sees the fastest movement in terms of new builds of the OS, and in unique OS derivatives like CyanogenMod. Right about the time I received the Nexus 7, Canonical released the developer beta of Ubuntu Touch, which targeted the Nexus 7 as its deployment platform.
Because I can't leave nice things well enough alone, I decided to start trying alternate OS ROMs on my shiny new Nexus 7. Ordinarily, each new OS would require you to reflash the device, losing all your configuration, apps and saved data. However, I found a neat hack called MultiROM that lets you sideload multiple ROMs on your device. How does it work? Well, let's walk through the installation.
Prep for MultiROM Installation
First, and I can't stress this enough, back up your device. I really, really mean it. Back up your device. You're messing around with lots of low-level stuff when you're installing MultiROM, so you'll want to have copies of your data. Also, one of the first steps is to wipe the device and return it to an "out-of-the-box" configuration, so you'll want your stuff safe.
Second, grab copies of the "stock" Nexus 7 ROMs as they shipped from the factory. You will want these in the event something goes wrong, or if you decide you don't like this MultiROM hackery and want to roll your device back to a stock configuration.
Third, check the links in the Resources section of this article for up-to-date documentation on MultiROM. It's possible for things to change between this writing and press time, so follow any instructions you see there. Those instructions will supersede anything I type here, as this kind of hack can be a rapidly moving target. Also, do your own homework—lots of great YouTube videos describe this process, and a video sometimes can be worth several thousand words.
Notice: please make sure you follow these three steps, then follow the MultiROM documentation exactly. I'm not responsible if your tablet gets bricked or turns itself into SkyNet and goes on a rampage against humanity. Though I have to say, if that happened, it'd be kind of neat, in a geeky sort of way.
Unlocking Your Bootloader
Your device should be on the latest available factory ROM supported by MultiROM before you begin the installation. At the time of this writing, on my Nexus 7 (Wi-Fi-only) model, that was 4.2.2. The Nexus 7 comes from the factory with a "locked" bootloader. The first thing you've got to do is unlock the bootloader before you can proceed.
To unlock the bootloader, you need the Android SDK tools installed on your computer (see the Resources section for a download link). Specifically, you'll need the fastboot and adb tools for this, so make sure they're on your system and in your shell's PATH environment variable.
Next, hook up your tablet to your computer via the USB-to-MicroUSB cable, and then run:
adb reboot bootloader
Your tablet then will reboot, and you'll be in the Android bootloader. Once you're in the bootloader, run the following command:
sudo fastboot oem unlock
Next, you'll be prompted to confirm the command and accept that all data on your device will be erased. The tablet then will reboot, winding up in the setup wizard where you'll be prompted for all your setup information as if it were fresh out of the box once more.
Now that your bootloader is unlocked, you can proceed to the trickiest part of this process—installing MultiROM. Grab a copy of it from the XDA-Developers MultiROM thread (the link is in the Resources section of this article; currently the filename is multirom_v10_n7-signed.zip). You'll also need to get the modified TWRP install file (TWRP_multirom_n7_20130404.img) and a patched kernel (kernel_kexec_422.zip). Rename the TWRP install file to recovery.img, then hook your tablet back up to your computer, and place these files in the root of its filesystem (keep the .zip files zipped—don't unzip them).
Next, from your computer's command line, you'll need to run the adb utility from the Android SDK again, but this time, with the proper argument to get the system to boot to "recovery" mode:
adb reboot recovery
This will bring the device to "Clockwork Recovery" mode. From the Recovery menu on the device, choose "Install zip from sdcard", followed by "choose zip from sdcard", then specify the MultiROM zip file you moved to the root of your tablet's filesystem earlier. When it's done flashing, select "reboot system now", and your Nexus 7 will reboot.
Once the device boots normally, issue the following command from your computer to get the system back in the bootloader:
adb reboot bootloader
The device will reboot in bootloader mode. Select the fastboot option on the screen, then type the following on your computer:
sudo fastboot flash recovery recovery.img
That'll flash the modified recovery image that MultiROM requires to your tablet. Next, just tell the tablet to reboot by issuing the following command to it:
sudo fastboot reboot
Your Nexus 7 now is ready to install alternate ROMs.
Bill Childers is the Virtual Editor for Linux Journal. No one really knows what that means.
Getting Started with DevOps - Including New Data on IT Performance from Puppet Labs 2015 State of DevOps Report
August 27, 2015
12:00 PM CDT
DevOps represents a profound change from the way most IT departments have traditionally worked: from siloed teams and high-anxiety releases to everyone collaborating on uneventful and more frequent releases of higher-quality code. It doesn't matter how large or small an organization is, or even whether it's historically slow moving or risk averse — there are ways to adopt DevOps sanely, and get measurable results in just weeks.
Free to Linux Journal readers.Register Now!
- Django Models and Migrations
- Hacking a Safe with Bash
- Secure Server Deployments in Hostile Territory, Part II
- The Controversy Behind Canonical's Intellectual Property Policy
- Home Automation with Raspberry Pi
- Shashlik - a Tasty New Android Simulator
- Huge Package Overhaul for Debian and Ubuntu
- KDE Reveals Plasma Mobile
- Embed Linux in Monitoring and Control Systems
- diff -u: What's New in Kernel Development