yashsingh1/xdaforums huggingface dataset:
[Shield Tablet Android Development] Steel01:
Yes, sorry. Guess I wasn't clear. I'm running almost mainline stuff on my portable, with a few patches from gnurou. I also have the LTE edition of the tablet, which is what I'm talking about here.

I've got Ubuntu loaded and updated to 14.10 and it seems to run fairly well outside of what I already mentioned. You say the touchscreen already works? How do you activate it? I'm not clear on what this rm-wrapper thing is and how it is used.
[Shield Tablet Android Development] Bogdacutu:
Edited my post. You need to run the rm-wrapper manually (it's not part of the kernel), and evdev might need some configuration changes (I'm saying might because it sometimes works without these):

In /usr/share/X11/xorg.conf.d/10-evdev.conf, make the last section look like this:

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
[Shield Tablet Android Development] joshtheitguy:
All I managed to do when I upgraded to 14.10 was to kill the xserver, did you hold back the xserver-xorg-core package like Bogdacutu suggested?
[Shield Tablet Android Development] Steel01:
Yes, I did hold that package. I've done other things too, like remove unity and install KDE and lxde, but that shouldn't fix or break anything. Though, I did run out of space right at the very end of do-release-upgrade. But I freed up some space and it still booted afterwards. Random note: glxgears gives triple the output under lxde on 14.10 (1700+) as it did under unity on 14.04 (~650). Once I get most things working on this install, I'm going to rebuild it all to boot off an SD card. Even with 32 GB, I'm running out of space far too quickly. Then I'll try to get a Fedora user space to boot, but trying to match the xorg abi there will be fun. But all that's after I get back to my dev box in several hours. Can't even try the touchscreen stuff while I'm away. Someone needs to port that multiboot program, so I don't have to fastboot everything I test. Maybe something else to add to my 'when I have time' wish list.
[Shield Tablet Android Development] Bogdacutu:
You can flash the boot.img to the recovery partition (I never need the recovery when I don't have access to a computer, so I don't mind needing to use fastboot for booting the recovery - hell, you can even flash the recovery image from Android, so that if you do need it when you don't have fastboot, you still can have it), and to move it to SD, it's enough to modify the initramfs to mount the SD card too and use it as the root.

Also, MultiROM can probably be ported, now that we have working touchscreen without Android.
[Shield Tablet Android Development] Steel01:
Hijack the recovery partition? Now that is an idea... Not ideal, but should work for what I want right now. I'll still want to try and get proper multiboot eventually. Hopefully it'll be easier than with the portable which I couldn't ever stop the graphics distortion on. And yes, booting off the external SD should be trivial, I did that on that portable, should be the same outside of partition locations. *goes to finish touchscreen mods and reboot*

Edit: That worked great! Only problem: I think I unistalled the onscreen keyboard... Time to see if I can chroot in Android enough to install one.

Edit 2: Posting from the Ubuntu install. It is mobile usable. Just ought to find a touchscreen friendly DE that isnt unity. The only other thing I had to do was look up the command to rotate touchscreen input so I could script it with my xrandr rotate to horizontal.
[Shield Tablet Android Development] joshtheitguy:
Awesome, that means I should be able to upgrade without too many issues but I also did the same thing as you when it came to removing Unity. I just think KDE5 would be much better so I intend to upgrade to 14.10 and add the Kubuntu Next PPA to see how that goes.
[Shield Tablet Android Development] Bogdacutu:
Updated the prebuilt boot image with backported Bluetooth drivers. Bluetooth now works fine (with the drivers that are already in the kernel tree, it worked, but it randomly crashed when I tried to connect my Bluetooth keyboard; it's fine now)
[Shield Tablet Android Development] etienne51:
So I got my HDMI cable, and I can confirm it does not work yet on Ubuntu.
[Shield Tablet Android Development] Bogdacutu:
Here's a Python script for disabling touchscreen when the screen is covered (magnetic covers don't seem to like touchscreens), and for only allowing stylus input when you take the stylus out: https://gist.github.com/Bogdacutu/760ce8d8898d5b41f34b (requires "pip install evdev")
[Shield Tablet Android Development] Bogdacutu:
I've made the patch which I suspect breaks HDMI optional now, anyone willing to test?
[Shield Tablet Android Development] etienne51:
It's late, I just booted up your last v114 boot_image, and I can confirm I got my background displayed on my TV now! I'll do further tests tomorrow then!

That's really good news, now I'll be able to use the tablet as a desktop replacement on Ubuntu, sometimes... maybe. I'll need my USB OTG Y cable to arrive before anyway, and a proper hub to connect my keyboard and mouse.
[Shield Tablet Android Development] Bogdacutu:
Thanks for the info!

Also, I know the kernel source isn't up yet, that's because it's a pretty big mess at the moment. I will restart from scratch this weekend and upload everything to GitHub.
[Shield Tablet Android Development] SuperPichu:
I think I have a really jank plan to implement a dual boot system. I'll test it when I get home and post it here if it works.
[Shield Tablet Android Development] Bogdacutu:
would probably better to just try and port MultiROM, but let's see your plan
[Shield Tablet Android Development] SuperPichu:
Ok I just tested this and it seems to work.

Basically I've taken the new_boot(114).img and zipped it into a flashable zip.

This zip file (Ubuntu-Install.zip) does 2 things:

It makes a backup of the current kernel in /sdcard/backup.img

Flashes the Ubuntu kernel

The second zip file (Ubuntu-Restore.zip) flashes that backup of the Android kernel so that Android boots.

This way no computer is needed and you can switch back and forth.

Do Not Run Ubuntu-Install.zip when the Ubuntu kernel is flashed!! This will delete the backup of the Android kernel!!

I also came up with a way to boot Ubuntu from a ext4 formatted sdcard and it is working pretty well. This also adds a lot more space. Just extract the rootfs to the root of the sdcard instead of /sdcard/linux then use Ubuntu-Install-Ext.zip. The warning above still applies.
[Shield Tablet Android Development] SuperPichu:
How do I get audio to work? Mine only has Dummy Output.
[Shield Tablet Android Development] etienne51:
I just replaced the recovery partition with your boot image, since I'm not using the recovery quite often, and anyway, if I need to, I still can flash it back.

But about MultiROM, I have to admit, I have it on my Nexus 5, it seems to be the best solution. It's not really useful on my phone, but on a tablet with HDMI and everything, it will be really cool!

This is interesting! Does it seem to be faster running off the MicroSD or the internal memory? I plan on getting some UHS-1 really fast cards, maybe 64GB or even 128GB later. But still, I do have a 32GB UHS-1 at the moment, I can try to boot Ubuntu on this one.

-----

One more thing, about the USB OTG. I had a classic OTG cable (not a Y one), but I don't know, I lost it. So today I killed an old Samsung MicroUSB cable, and I converted it to USB OTG Y cable.

So basically what I did:

1. I stripped the MicroUSB connector and I cut both data cables, going to the USB male connector

2. I soldered pin 4 (sense) and 5 (GND) together

3. I also split a small USB 2.0 extension cable in half, grabbed the female end, and soldered all the 4 cables (+5V, data+, data-, GND) to the MicroUSB connector

4. Last but not least, if you do that, unlike me... it's safer to cover the connections using heatshrink

So I found an old USB 2.0 hub, the USB cable was in a bad shape so I also cut it, and soldered a proper USB connector (the other half of the extention cable I used earlier).

Then I plugged everything, the Y cable to the wall adapter, the HUB to the Y cable, and finally I plugged it to my Shield tabled on Android.

Wooah, it worked with a keyboard, a mouse, and a USB key! So I rebooted to Ubuntu to try it.

Well, it does not work correctly if the Y cable is connected to the wall adapter, so I disconnected it. Then everything worked like a charm!

Still, there is one thing that makes Ubuntu totally impossible to use for the moment, for me at least...

I don't know why, the graphical environment gets kicked randomly or something. I get back to the login screen, and then the integrated display looses it's orientation, I have to set it back to "counterclockwise", and I'm good to go again... waiting for the next restart a few minutes later.

Oh, about the internal display orientation, I just noticed something, if someone have the original cover from NVidia, with magnets.

If you close the cover, when you open it to use the tablet, the screen orientation changes automatically to "counterclockwise" (or maybe to any other orientation given the way you hold the tablet, I don't know, I haven't tested it yet).

So for the moment, if anyone knows why charging does not work at the moment, on Ubuntu, and maybe how to patch the kernel to have it back, that's a great feature to have if you're using the tablet as a desktop computer connected to the HDMI for example.
[Shield Tablet Android Development] SuperPichu:
I'm honestly not sure. I re-wrote it because I didn't have space on the Internal so I've only ever used it from the microsd. Nice wallpaper by the way.
[Shield Tablet Android Development] :
Hi! Is it possible to flash new firmware on Shield Tablet (5.2) and replace new bootloader with blob from 3.1.1? Could I boot Nougat and Ubuntu with MultiROM?

Thanks in advance!
[Shield Tablet Android Development] mirhl:
https://www.phoronix.com/scan.php?page=news_item&px=NVIDIA-Tegra-Mesa-2018
[Shield Tablet Android Development] androimax:
Ideas on Linux 4 Shield Tablet

As I was also fascinated about having things like games on the tablet, I think the original use case of having Linux and the tablet got lost, why someone who wants to have a tablet would not change away from Android. This might change if the UI / UX of Linux on a mobile device enhances while supporting still the native linux programs and linux experience which already exist (problem of Android imo).

In the past months I found several things which looked promising to me to have linux on mobile devices.

1. KDE: plasma mobile - plasma-mobile.org

Yes it's for phones but just remove the phone and SMS app and what you get is a linux ui made for touch screen devices.

2. postmarketos - postmarketos.org

This also sounds promising - I tried it on my Samsung Galaxy S3 myself (with plasma mobile). While it was like a hell of unstable I like the idea of replacing a system which is not maintained by the publisher (current situation why everyone I know uses custom roms like linageos) by a linux system where you might use some kind of near-upstream linux with an UI like plasma mobile. This is also especially for old phones which takes into consideration that you still need drivers from android kernels

3. Puri.sm - Pure os / librem 5 puri.sm/shop/librem-5/

A complete gnu/linux phone with a linux system running gnome or plasma mobile - while the devs tell that it will not run on any other phone it will be floss and one could try to bring it on other systems

Having found those alternatives (with different approaches and product readiness states) I have thought that maybe the shield tablet with the linux4tegra could run one of those UIs. So what I imagine is having whatever linux distro running e.g. with plasma mobile or any other linux frontend which is friendly to little touch screens. What I am wondering is if there is a problem with having nvidia not releasing any further linux4tegra builds, because:

1. Did we always have to still have the android kernel (lolipop from what I read in this thread here) to have linunx4tegra on the shield tablet? But it could be reduced to a minimum besides the linux distro I like correct?

2. Without further linux4tegra builds from nvidia, will there be problems staying upstream with linux?

3. are there other frontends which are tablet friendly so that one could substitute basic tablet use cases to a linux tablet? (surfing, mail, watching videos, music, ...)

4. The tutorial on how to build the linux4tegra with init scripts or etc is for someone like me very .... cryptic .... depending on the answers of the above questions it would be worth the effort doing such things, but in that case - did anyone understand how this has to be done and could explain the build progress or better the way from downloading files on the web page to flashing a system of your gusto on your tablet? I am not sure if this whole thing is dead - if this is the case - please don't take the effort on this.

PS: Of cause I forget ubports! I think this one would be interesting too!
[Shield Tablet Android Development] undrwater:
If you haven't, check out the Halium project as well. It's what came out of the cyanogen / ubports death I believe.

I have a lot of interest in the area with limited time and knowledge.
[Shield Tablet Android Development] yeoldeusrename:
FYI as others mentioned, for me the file was:

sudo gedit /usr/share/X11/xorg.conf.d/10-evdev.conf

But still it didn't work. Here's what I did (all in terminal):

xinput (this gives you the touch input device ID, which for me was 7)

xinput list-props 7 (or whatever your touch input device ID is. This shows you the current Coordinate Transformation Matrix for your device)

xinput set-prop 7 "Coordinate Transformation Matrix" 0 1 0 -1 0 1 0 0 1 (this is the matrix that worked for me for 90 deg ccw landscape mode)

Here's where I got the lead:

https://unix.stackexchange.com/questions/328248/screen-detection-and-mouse-reverse-x-y-axis-kali-linux

Here's more info from Ubuntu on the matrices:

https://wiki.ubuntu.com/X/InputCoordinateTransformation

Normal orientation: 1 0 0 0 1 0 0 0 1

90 ccw: 0 1 0 -1 0 1 0 0 1

90 cw: 0 -1 1 1 0 0 0 0 1

180: -1 0 1 -1 1 0 0 0 1
[Shield Tablet Android Development] mirhl:
I would not like to say BS, but I think *by now* you could just throw in latest mainline linux kernel and call it a day.

Maybe with just DTS (and telling build system to use upstream sources rather than nvidia prebuilts?) to be added.
[Shield Tablet Android Development] Mike_1996:
Hi,

The MultiROM filesystem resides in a folder on the internal storage (/data/media/<uid>/multirom/) which is only accessible as root (the parent directory is remounted as user, but the permissions of this folder would prohibit you from reading its contents as non-root). So backing up any of your MultiROMs is as simple as archiving the corresponding folder to a tarball. It's just that the TWRP has no UI for doing this.

However, you might as well try do pack lightweight tweaks into a script to avoid the extra work of typing on the device or with USB debugging, and for generally being more flexible.

Cheers.
[Shield Tablet Android Development] androimax:
Using the actual Linux4Tegra with the Shield Tablet from Scratch

(I had to remove all links due to not having yet 10 posts)

Hi all,

I have followed the topic for a while now. The objectives would be:

* Create a detailled how to for everyone who wants to do this himself (also for different distros?)

* Update the latest build of the Linux4Tegra for the shield tablet

My starting point would be a Post from Bogdacutu (which was outdated, but using the prebuilt installer is kind of a dependency…) on the otherhannd nvidia provides a different guide which seems much simpler for the 21.6 (developer.download.nvidia.com/embedded/L4T/r21_Release_v6.0/l4t_quick_start_guide.txt?yh681fHXH5Ih0mbblDBsVF7Ezm61TZCNXSQN5rCLcT_r_uVVucndjiJdBkgtEZXVEV_20kSA7en9MuyY4iPYCoi9qczKUt_RH7OvY3vE-ctJMEX9AZ-VQYG559Tfhztossq1ugFPmTgsxQ_g_av_BHDTPoRdlg[/url]). Can it be that the nvidia guide would only work for the dev board and not for the tablet?

Preconditions:

* Linux PC

* Shield Tablet (I don't care about dual boot here - let's assume we only want to have it running linux)

* unlocked bootloader

1. Getting the kernel.

Bogdacutu has posted his git repo here: github.com/Bogdacutu/STLinux-Kernel

Unfortunately while looking through it it doesn't seem to easy ro reconstruct what he did there, I just saw that there was a merge with nv-tegra.nvidia.com/linux-3.10.git but in the past there were smaller commits which seem to imply a lot of manual work. Those commits where 3 years ago, so getting the latest 3.10 which was updated by nvidia 3 months ago or even linux-4.4 (nv-tegra.nvidia.com/gitweb/?p=linux-4.4.git;a=summary) seems not to be an option without manual work.

So my assumption would be for the first step would be following his exact orders:

Cloning github.com/Bogdacutu/STLinux-Kernel

using the make to create the kernel.

2. initramfs

As I don't know where we get this from I would also use Bogdacutus orders.

3. for the rootfs we can now use the latest R21.6 developer.nvidia.com/linux-tegra-r216

4. Getting everything to work as instructed:

Now without having this done yet i have the following questions:

* Was there anything else outdated why this tutorial would not work?

* Is there a different way to install those things?

* The topic had "Linux4Tegra R24.1 beta (mirror) (updated on February 18th 2016)" which is not availible for the K1. Can also releases other then the " Tegra K1" be used? E.g. the 28.2 developer.nvidia.com/embedded/linux-tegra

* Once I boot this could I also install e.g. a debian sys with gnome?

* Anything else I did wrong?

* In case I really don't care about Android - would I do something different?

Hope to find some answers.

Max
[Shield Tablet Android Development] mittorn:
Successfully started linux on BitO kernel. Everything works except multirom, including xorg driver, suspend, bt, wifi. Touchscreen works after fixing driver reports. I used fastboot to run kernel, so we need to fix multirom with kexec-hardboot patch to make it work correctly.

Other way is reflash kernel every time, or use it instead of recovery, but both usage is dangerous

Kernel patch:

http://pastebin.com/xdVAm08t

Kernel config:

http://pastebin.com/RSNVw5HG

Based on bito-k10 source (BitO-K10-011,2596fbe41fa94eb894a618243619270295741a33)

Android system partition mounted to /system to make firmwares load correctly

P.S Finally got kexec-hardboot to work, but kexec'ed kernel ignoring initrd image from kexec and trying to boot android.

Found workaround: hard-coded full path to installed multirom root, disabled compressed initrd support to prevent using bootloader's initrd.

==================================================

Working 3.10.106 kernel for Ubuntu

What works:

1. wifi

2. bluetooth

3. touchscreen

4. suspend

5. nvidia drivers

What does not work:

1. Passing any command-line or initrd from kexec-hardboot. Command-line is hard-coded, need recompile to change it. initrd is linked in, external initrd support disabled

2. ext4 ACL is broken, so mount tmpfs to /media to make udisks work

3. loadable modules disabled

4. Suspend while charging. It disabled in dtb, android kernel does not enter deep sleep when charger connected too.

Only installing to /data partition works. You will need to rebuild kernel to run from different partition or change command-line

Kernel binaries, source and Install Instructions:

https://github.com/mittorn/android_kernel_nvidia_shieldtablet/releases

Based on BitO-K10

I only prepared kernel for already released build. Kernel should work with any distro that uses glibc and have xorg-server 1.15 availiable (L4T drivers compatibility), but adding drivers to other distro and configuring it means big amount of work. It's better to spend this time doing something in ubunto than just setting up other distro.

PostmarketOS based on Alpine, which using musl, not glibc. It will be incompatible with nvidia drivers and with android drivers too.

Also, musl does not support some development utilities which i need. For example, address sanitizer will not work under alpine. So postmarketos is not choiсe for me at all

It seems to be a kernel and bootloader issue. Kernel reads initrd from address got from dtb, which is patched by bootloader (nvidia blob). And default initrd from boot.img still present here

But kexec or kernel unpacker/relocator places it to different places. I do not want spend much time now searching what stage actually broken (already spent almost 2 days), embedded initrd/commandline is enough for me, but it is not enough for multirom.

It is better to contact custom kernel developers, they should know.

it is Android 7.0 and non-lte tablet

I think it is not possible. Mainline kernel needs mainline u-boot, but NST has signed nvboot bootloader. If you flash boot loader that not able to start, you will never unbrick tablet
[Shield Tablet Android Development] mirhl:
Cool, for finally getting "something workable" to readily install on.

But I, for one, think ubuntu is by now a dead end.

If I was you, I'd try to get aboard the postmarketOS bandwagon.
[Shield Tablet Android Development] Lyokacanthrope:
So wait, did the initrd issue only crop up when using kexec/multirom or was the bootloader always meddling with the initrd somehow?

That might explain some of my issues getting non-Android OSes to work...
[Shield Tablet Android Development] androimax:
First of all thank you mittorn for the effort you spent!

I received two private messages in the meanwhile on this issue. It seems that I am not the only one having trouble to "simply" install whatever is described here. So once the newest android version was flashed even installing the old versions directly from the nvidia sites doesn't help in flashing the mentioned packages. I guess I have not done sufficient trial and error on that or did not understand the descriptions completely or ran into another thing which I did not understand.

Another issue I see here is the same as mirhl. Ubuntu 14 isn't something you would like to have on your tablet - changing an outdated android (which with linageos maybe is not that outdated) by an outdated ubuntu… So even if I could install it, I would need to upgrade to at least the newest ubuntu - which as I understand would not work.

Would it maybe make more sense instead of debian, ubuntu or postmarketos to port coreboot? The problem with handheld devices (how did we ever get here?) seems to be that only those oses can be flashed which have the exact support from their supplier. Would we ever buy a PC where you could only install Windows 8? Maybe also Windows 10 but only if nvidia / samsung / … supplies you with the installation file? I guess I am wrong and this is a stupid idea with coreboot because it's not an interface which could have all the android drivers but only a starting point for whatever os and all the drivers would be needed in the os anyway. Too sad as the shield tablet always gave me the impression that it has a powerful hardware limited into the android ecosystem.

Nvidia seems to support still android updates and also updates the linux4tegra drivers but never officially supported putting linux distros on the device (once I bought the shield tablet I didn't think of installing real linux there anyway). So I don't expect any miracle - I think in case my shield tablet breaks or I have the real need of a new tablet or just one day am too rich to really care I would by directly a linux tablet - as the one currently in prototype stage at the purism store.

Sorry for the bad mood here :-X

Max
[Shield Tablet Android Development] ayaromenok:
`/dev/mmcblk0p13 /system/ auto ro 0 0`

looks like partitions table was change on some point - it's a `mmcblk0p14` in 5.4 firmware, while before it was 13 for non-LTE version. for LTE +1

can you share you firmware version?