[Shield Tablet Android Development] LouMinartey:
L4T Ubuntu 14 >> Ubuntu 16.04 UPDATE INSTRUCTIONS:

I have only tested this on the OG shield tablet with the DirectStylus! I don't know how well this will work on the K1 without it, and some steps may consequently require an OTG cable + mouse/keyboard

WARNING! THIS IS HACKY AF! OS UPDATES MAY BREAK THINGS IN FUTURE!

REQUIREMENTS: Stock Android 5.1 Lollipop. Make sure you're running one of the following firmware versions, you can download one of the following depending on your device from the nvidia link below.

Stock FW Downloads >> https://developer.nvidia.com/gameworksdownload
MATCH THE DOWNLOAD TO YOUR TABLET TYPE! EG WIFI, LTE(US) or LTE(RoW)
OG Shield Tablet (with stylus): FW 3.1.1 STOCK
Shield Tablet K1 (without stylus): FW 0.0.0 STOCK

L4T files mirror >> https://sourceforge.net/projects/linux4tegra-ubuntu-18-04/files/

INITIAL SETUP:

1) Flash twrp-multirom-20150909-UNOFFICIAL-shieldtablet.img over usb from PC with fastboot

- REBOOT TO RECOVERY

2) Flash kexec_patch_stock_31.zip from TWRP

- REBOOT TO RECOVERY

3) Flash multirom_shieldtablet_touch_support.zip from TWRP

- REBOOT TO RECOVERY

4) Install Linux4TegraR231.mrom via TWRP MultiRom menu

- REBOOT TO L4T

5) Follow install process, using Onboard as onscreen keyboard or OTG cable + mouse/kb. DO NOT CONNECT TO WIFI YET!

IF YOU ARE INSTALLING ON K1, YOU MAY NEED THE OTG + MOUSE/KB!

Once installed and rebooted to the desktop, you may now connect to your WiFi

PREPARING UBUNTU 14:

1) sudo apt-get install openssh-server

- REBOOT, BACK TO L4T

FROM NOW ON, USE SSH FROM A PC IF POSSIBLE FOR ACCURACY + EASE

2) sudo apt-get install nano

ENABLE SWAP FOR RELIABILITY DURING UPGRADE, CREATES 2GB swapfile IN INTSTORAGE BY DEFAULT

1) sudo su

2) cd /data/media/0/

3) dd if=/dev/zero of=/data/media/0/swapfile bs=1024 count=2097152

4) mkswap swapfile

5) swapon swapfile

6) nano /etc/fstab

7) ADD THE FOLLOWING LINE AT THE BOTTOM, AS IS:

/data/media/0/swapfile swap swap defaults 0 0

8) Save (ctrl+o) and Exit (ctrl+x)

9) exit

10) sudo apt-get update && sudo apt-get upgrade

11) sudo apt-mark hold xserver-xorg-core

LOGINSCREEN ORIENTATION FIX

12) cp ~/.config/monitors.xml /var/lib/lightdm/.config/monitors.xml

14.04 setup complete! If holding on this version, enable multiverse repository and enjoy

UPGRADING TO UBUNTU 16:

DOWNLOAD rm-wrapper and keep it somewhere easy to get at! Preferably on an SDCard!

VIA SSH! SUPER IMPORTANT! THINGS WILL LIKELY BREAK GRAPHICALLY DURING UPGRADE!

1) sudo do-release-upgrade

WHEN ASKED, ALLOW TO RESTART SERVICES AUTOMATICALLY

During the upgrade process, you will be asked if it can replace some PulseAudio configs. ALLOW THIS! If you don't, sound will not work after upgrade!

Before rebooting after upgrade, via ssh copy rm-wrapper to your home directory, renaming it to .rm-wrapper

1) chmod +x .rm-wrapper

2) sudo nano /etc/rc.local

ADD THE FOLLOWING LINES, BEFORE EXIT 0 BUT AFTER THE COMMENTS! SUBSTITUTE YOURUSERNAME! EG /home/greg/.rm-wrapper

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/YOURUSERNAME/.rm-wrapper /dev/null &

DON'T FORGET THE &

REBOOT!

IF YOUR TOUCHSCREEN IS INVERTED AT ANY POINT, PERFORM THE FOLLOWING VIA SSH:

1) sudo nano /usr/share/X11/xorg.conf.d/10-evdev.conf

Edit the last section with identifier 'evdev touchscreen catchall' so it looks like the following, adding the 3 new Option lines if required

Section "InputClass"
Identifier "evdev touchscreen catchall"
MatchIsTouchscreen "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "InvertX" "yes"
Option "InvertY" "yes"
Option "Calibration" "0 1199 0 1919"
EndSection

UBUNTU 16 FIXES:

Slow touchscreen + ui Init Fix

COMMENT OUT LINE: PrivateNetwork=yes
TO: #PrivateNetwork=yes
IN THE FOLLOWING FILES:
/lib/systemd/system/rtkit-daemon.service
/lib/systemd/system/systemd-hostnamed.service

Bluetooth Fix

Add the following lines to /etc/rc.local BEFORE exit 0

rfkill block 0 && rfkill unblock 0 && /usr/bin/brcm_patchram_plus --enable_hci --use_baudrate_for_download --scopcm=0,2,0,0,0,0,0,0,0,0 --baudrate 3000000 --patchram /system/etc/firmware/bcm43241.hcd --no2bytes --enable_lpm --tosleep=50000 --bd_addr `cat /mnt/factory/bluetooth/bt_mac.txt` -d /dev/ttyTHS2 &
systemctl restart bluetooth

Default brightness on startup fix

Set desired brightness in settings

IN TERMINAL: cat /sys/class/backlight/pwm-backlight/actual_brightness

Add the following line to /etc/rc.local BEFORE EXIT 0, replacing value with the number you got from the above command

echo value > /sys/class/backlight/pwm-backlight/brightness

CPUFreq control

install indicator-cpufreq (requires multiverse repos enabled)

Misc Unity QoL fixes

Install unity-tweak-tool (requires multiverse repos enabled)

Change Scrollbars from Overlay to Classic

Screen rotation indicator

I used this: https://github.com/frecel/ScreenRotator/

You have to edit the config file so that the orientations in the menu match up to the actual screen, but I'll upload my config here when I can get to the tablet

Let me know if I missed anything. You should end up with a functional Ubuntu 16.04 installation after performing these steps in order. Enjoy!

KNOWN BUGS:

1) Nvidia video driver startup fails sometimes, booting to a black screen after hearing the ubuntu bongos. Hold power button for 10 seconds, reboot. Happens maybe 1 every 5 coldboots if you're unlucky

2) Touchscreen takes 5-10 seconds to initialize on 16.04 with rm-wrapper fix, far longer if you don't apply the slow touchscreen + ui startup fix. If you use the Brightness fix, the touchscreen is ready when the brightness has changed

CREDITS:

@Bogdacutu for L4T, tassadar + @Steel01 for MultiRom, @piyushaggarwal002 for file mirrors and his guide, @gadido30 for the ubuntu 16.04 bluetooth fix, countless others in both this thread and the MultiRom thread for ShieldTablet and the internet hivemind for a lot of the fixes.