Desktop Plasma on an Android Tablet!

So I have an NVIDIA SHIELD K1 Tablet that used to be quite popular as a gaming tablet around 2014-2015. It’s a pretty nice tablet. There are no powerful AND economically priced android tablets in the market anymore, as far as I could find. But who am I kidding, I bought this tablet because I was on a shopping spree last year after I officially wrapped up my Google Summer of Code 2019 project. I should probably make an expense report for the stipends I earned from the program as it was my first ever income! This weekend I came to know of Linux4Tegra,  a GNU/Linux based system software distribution by Nvidia for the Nvidia Tegra processor series. (you can read more about it at Wikipedia). So I checked out the releases by NVIDIA here and found out there was something available for my shiny K1 too! I sniffed around in xda forums and found out a forum post by Bogdacutu

Last weekend I stumbled upon Linux4Tegra while looking for custom ROMs to breathe new life into this 2015 device. I got up to Ubuntu 18.04, so this is what my final sequence of steps was. to make sure you can also have a working Desktop Ubuntu tablet within a day:-

  1. I have hosted the files for download here: https://sourceforge.net/projects/linux4tegra-ubuntu-18-04/files
  2. Forum post for Linux4Tegra for NVIDIA SHIELD TABLET K1: https://forum.xda-developers.com/shield-tablet/development/running-ubuntu-natively-shield-tablet-t2985238
  3. NVIDIA SHIELD TABLET K1 stock firmware:
    https://developer.nvidia.com/gameworksdownload
    get the version 0.0.0 Factory Image ^
  1. Make sure USB Debugging is turned ON. Boot into the bootloader.
    adb reboot bootloader
  2. Flash stock firmware that has Android Lollipop (absolute requirement for Linux4Tegra to boot up. L4T doesn’t boot up on newer bootloaders.
    Just run the bundled flash-all.sh as root and it will handle everything automatically.
  3. Reboot the device to make sure android lollipop is fine.
    1. Enable USB Debugging.
    2. Feel free to set up the Tablet’s android at this step. You will always be able to switch back and forth between android and L4Tโœจ
  4. Flash custom recovery: –
    adb reboot bootloader
    fastboot flash recovery twrp-multirom-20150909-UNOFFICIAL-shieldtablet.img

  5. Boot into recovery and flash these files in this order: –
    1. multirom-20150909-v32a-UNOFFICIAL-shieldtablet.zip
    2. multirom_shieldtablet_touch_support.zip
    3. kexec_patch_stock_31.zip
    4. Magisk.zip (optional, for rooted Android)
    You do not need a micro SD Card – there is MTP support in TWRP Recovery.
    As a side note, feel free to sideload the zips from your desktop.
    Once done, feel free to boot into android once to make sure all’s OK.
  6. Reboot into recovery again.
  7. Advanced Menu > Add ROM, and flash Linux4TegraR231.mrom.
    This will install Linux4Tegra v23.1.
    External storage (extX, NTFS, FAT32) such as SD Card or USB storage, can be used.
    However, once installed, you will need to re-plug the removable storage after bootloader loads so MultiROM picks it up.
    For internal storage, the ROM lives in /storage/emulated/0/roms/
  8. Reboot to system.
  9. Boot to Linux4Tegra231 from the boot menu. ๐Ÿ˜€

Welcome to Ubuntu 14.04 !

Well, pat yourself on the back, you have gone through a lot of risk already. It’s about to get bumpy from here.

Stuff that doesn’t work: 3G/LTE, accelerometer, GPS, camera
Stuff that does work: GPU (full OpenGL 4.5 and Vulkan), sound, USB device and host, WiFi, Bluetooth, touchscreen, sound, SD/USB install, HDMI playback

Enable on-screen keyboard from Ease of Access.
You might need holding on the key to record the input.
This happens just during the first set-up, everything is fine once the set-up is done.

  1. Update the installation by: –
    sudo apt update && sudo apt upgrade -y
    Keep package maintainer versions of all files.
  2. Upon successful updating, touch will be inverted upon reboot.
    Fix it by opening 10-evdev.conf and make the last section look like this:
    /usr/share/X11/xorg.conf.d/10-evdev.conf
    ________________________________________________
    Section "InputClass"
    Identifier "evdev touchscreen catchall"
    MatchIsTouchscreen "on"
    MatchDevicePath "/dev/input/event*"
    Driver "evdev"
    Option "InvertX" "yes" # impo
    Option "InvertY" "yes" # impo
    Option "Calibration" "0 1199 0 1919" # impo
    EndSection
  3. universe repositories are disabled OOTB. A simple command enables universe support for us:-
    sudo add-apt-repository universe && sudo apt update

Onwards to another release upgrade!

Perform the following commands to upgrade your release from 16.04 to 18.04.
Update your installation to latest packages to prep it for the upgrade and then run: –
sudo do-release-upgrade

Welcome to Ubuntu 16.04 !

Stuff that stops working: touchscreen (fixable)

Fix Touch Support

Run `rm-wrapper` on your tablet. Be sure to run this command in a root shell after doing the exports.
Add these lines to rc.local to automate this.
These lines expect that rm-wrapper has been renamed to .rm-wrapper
Replace $USER with your username beforehand.

/etc/rc.local
________________________________________________________
export LD_LIBRARY_PATH=/system/vendor/lib/hw:/system/vendor/lib:/system/lib
export TOUCH_CONF_DIR=/mnt/factory/touchscreen
export TOUCH_DATA_DIR=/data/misc/touchscreen
/home/$USER/.rm-wrapper /dev/null &


If you would be fine without touch support, feel free to go ahead to 18.04.
If you can improve touch support for 18.04, I’d love to sign up as a tester!

Onwards to another release upgrade!

sudo do-release-upgrade

Welcome to Ubuntu 18.04

Stuff that stops working: DNS resolution (fixable), touch (no fix)
CAUTION: The rm-wrapper fix does not work with Ubuntu 18.04. Fixes are welcome! (source link)

To Fix DNS Resolution

Add this line to the end of /etc/rc.local to fix your internet

echo "nameserver 8.8.8.8" | tee -a /etc/resolv.conf

But this is a poor hack – if resolvconf service ever restarts, your internet will go bonkers again, so you could either run that command (as root) yourself later again, or just restart the tablet. I tried working with netplan to fix it but that apparently crashed the whole WiFi during boot-up! xD


Gallery

mandatory screenfetch shot ๐Ÿ˜…

But can it run Plasma?

Using tasksel we can quickly install Plasma desktop on top of ubuntu.
sudo tasksel install kubuntu-desktop

Once that was done, I logged out of my current Desktop Environment which comes with Ubuntu 18.04, and logged into Plasma. The experience was beyond amazing!

Plasma Gallery

If I were to be honest, I don’t really know what I would do with the linux on my tablet.
For now, I am just content with the fact that I have a convertible android tablet that doubles as an SoC computer with display! ๐Ÿ˜„ I’m really glad with how it turned out, since I already plan to operate with this tablet remotely (SSH + VNC) when I have to do anything. ๐Ÿ˜‹

It would be amazing if developers from the XDA Developers community hop back on this project! I think there was more than enough hardware in this tablet for its time, and no hardware is under-powered to run Linux on it.This has been achieved once by NVIDIA, and then once rejuvenated by Bogdacutu, I think it’s only about time someone else gives it a shot? ๐Ÿ˜ƒ