yashsingh1/xdaforums huggingface dataset:
[Shield Android TV General] yahoo2016:
It appears the rootfs (nvidia-shield-tv-utopic.arm64.img) from OP is a single compressed file,

I assume fastboot decompresses "nvidia-shield-tv-utopic.arm64.img" and creates rootfs directory structure during boot.

The new rootfs from L4T has directory structure, that's the way ubuntu for Chomebook implemented. (dd kernel to the first partition and copy rootfs directories to partition 2 of ext4).

I was able to build new "nvidia_boot.img" using "Image" from L4T following instructions from raubtier2.

I'm wondering if "nvidia_boot.img" can be installed on the first partition of external SD card.
[Shield Android TV General] Thanks_Meter:
I wonder why your kernel is so small. The file "Image" from "Tegra210_Linux_R23.1.1_armhf.tbz2" is 19.003.224 bytes so it must be 0x19e8000 for me to get abootimg working.
[Shield Android TV General] yahoo2016:
I also have "Image" size 19.003.224 bytes, 0x19e8000 did not work for me,

I got "updated is too big for the Boot Image (34195456 vs 27164672)

I had to use "bootsize = 0x209c800".
[Shield Android TV General] Thanks_Meter:
I did it exactly this way but I end up in fastboot when I flash it to the boot partition. :crying:
[Shield Android TV General] yahoo2016:
It turned out all files in nvidia_initrd directory are included in boot.img. After I deleted zImage, 0x19e8000 worked.

---------- Post added at 01:07 AM ---------- Previous post was at 01:03 AM ----------

What command did you put in fastboot?

Did you type in "fastboot flash recovery nvidia_boot.img"?
[Shield Android TV General] Thanks_Meter:
Actually I used dd from the already running Ubuntu to flash mmcblk0p18 which is the boot partition. When I use "fastboot flash boot nvidia_boot.img" I get the message that flash failed.
[Shield Android TV General] yahoo2016:
Can you use fastboot from another PC to flash stock boot image to boot partition?
[Shield Android TV General] raubtier2:
Hello all,

I don't calculate the bootsize value in bootimg.cfg for myself.

My way:

(1) mv bootimg.cfg bootimg.cfg.tmp

(maybe its standard to load bootimg.cfg from abootimg, I don't know)

(2) abootimg --create /tmp/nvidia_boot.img -k Image -r /tmp/nvidia_initrd.gz

(without the -f-option)

Use this size (in hex) of nvidia_boot.img for bootsize in bootimg.cfg
[Shield Android TV General] crnkoj:
Guys this is great, I just ordered one shield yesterday during black Friday sales, as I saw the progress, I ordered a second one, as soon as I get them, I will try this and than probably try to get gentoo booting on it.
[Shield Android TV General] Thanks_Meter:
Still no success: "FAILED (command write failed (Bad file descriptor))" :crying:
[Shield Android TV General] Thanks_Meter:
I discovered that the recovery partition is just 25.5 MB but my boot image is >26MB. So what did you do to shrink the boot image?
[Shield Android TV General] yahoo2016:
I tried abootimg --create /tmp/nvidia_boot.img -k Image -r /tmp/nvidia_initrd.gz (without the -f-option), still got the same size of 27,162,624 bytes.

What is size of your "Image" from L4T?
[Shield Android TV General] Thanks_Meter:
I tried to compile the kernel with size optimization flags but I also get the vdso32 error like hausi14 on page 2.
[Shield Android TV General] raubtier2:
Hello yahoo2016,

I checked my bootimage again. And in the end I found out, that I used the zImage

(which is a normal Image-File) from the link in the first post.

So I must correct me,

I use the kernel from the link in the first post and the L4T-rootfs. This system runs fine. Excuse me

yahoo2016, if you try a lot. But that is my mistake. Sorry again. But you will get a nice system with

that kernel.

Hello Thanks_Meter:

that was my problem too, but if you look at the name vdo32 it looks that it has something to do with 32bit. And indeed you must use a 32bit-armgcc-compiler here. If you read the documentation from nvidia:

ht tp://developer.download.nvidia.com/embedded//L4T/r23_Release_v1.0/Tegra_Linux_Driver_Package_Documents_R23.1.1.tar

you will see, that you need 4 definitions (values defined for my system)

(1) export CROSS_COMPILE=aarch64-linux-gnu-

(2) export CROSS32CC=arm-linux-gnueabihf-gcc

(3) export TEGRA_KERNEL_OUT=./tegra_kernel_out

(4) export ARCH=arm64

If you define (2) vdso32 will compile and the compiling continues, if you have the right 32bit arm cross-compiler installed on your system.

If I remember correctly there are 2 more errors in compiling the source.. But I can't remember, where

in the source tree. If you will have additional error messages post the error messages. Maybe I can

tell you, what I have done to compile to the end. But I don't test this kernel till now, because my

system runs nicely.

Because of yahoo2016, who find out, that I don't use the official tx1-developement-board-Image, I

will try to shrink this Image and try to use it.

Sorry again for my false information. But the main thing is a nice running system.
[Shield Android TV General] yahoo2016:
I was reading Shield TV unlock/root instructions and have a question.

It seems unlock will allow flashing unsigned ubuntu kernel to recovery partition and boot to linux, do I need to root Shield TV to run ubuntu?
[Shield Android TV General] dieter.reuter:
I'm already trying to get my ShieldTV working with Ubuntu, but until now without any luck.

I was stucked a long time to figure out, that using "fastboot boot nvidia_boot.img" doesn't work at all with my ShieldTV (16GB) which is already running the latest firmware 2.1. Every time the boot menu gets frozen and I have to hard reboot the device with switching off power.

Luckily I followed the instructions at ht tp://nvidiashieldzone.com/index.php/shield-android-tv/root-shield-android-tv/ and was able to flash their boot.img and I'm able to boot into the recovery kernel.

My main problem is solved by using "fastboot flash recovery twrp-shieldtv.img" instead of "fastboot boot nvidia_boot.img", the later one doesn't seems to work any more on a newer firmware!

Now, I'm getting stuck again. When I'm flashing with "fastboot flash recovery nvidia_boot.img" and using a SD card with the image from page 1, the ShieldTV does not boot at all into the recovery kernel. HDMI screen still keeps black, nothing on the network and nothing to see with adb.

Did anyone have a working set of "boot.img" and SD card image which work together with firmware 2.1 and can share it?

It's really annoying that there is no serial console available on the ShieldTV which could be really helpful in debugging those low-level problems.

Any help or pointer are greatly appreciated!
[Shield Android TV General] verbosetextfile:
Is there a way to get debug messages from the booting kernel? It seems that I'm doing something wrong since my shield hangs at the fastboot screen whenever I try to boot nvidia_boot.img. The only visual feedback I get is "please wait..." while the kernel is loaded on the device using fastboot, but after that, the screen just stays the same and I can't switch forwards/backwards through the boot options anymore (in fact, it seems as if the button was entirely ignored).

I tried

fastboot boot nvidia_boot.img -c "nosplash debug"

but that didn't change anything.

I might have a faulty SD-Card, but before I buy a new one I'd like to find out whether it could be something else...
[Shield Android TV General] dieter.reuter:
Just try

fastboot flash recovery nvidia_boot.img

and then select "Boot recovery kernel" from the fastboot menu.

I had the same problem with "fastboot boot nvidia_boot.img", it freezes the fastboot menu.
[Shield Android TV General] yahoo2016:
According to http://nvidiashieldzone.com/index.php/shield-android-tv/root-shield-android-tv/ it seems "fastboot boot" does not work any more for latest FW.

I'll get my Shield TV tomorrow and start flashing kernels/rootfs from OP and from L4T. Sine many people already bricked their Shield TV, I'll do it carefully, e.g., check partition and image sizes to make sure no other partitions except recovery is written.

The more people join the effort, the sooner and better we can have ubuntu working.

---------- Post added at 03:00 PM ---------- Previous post was at 02:59 PM ----------

I'll open my shield to see if there is serial console port inside.
[Shield Android TV General] dieter.reuter:
I already opened my ShieldTV a few weeks ago, but couldn't find any serial console connectors or pins which looks like it so far. For opening the case you just have to use a plastic credit card, there are no screws and it's just clicked together.
[Shield Android TV General] verbosetextfile:
Thanks, that worked! :D

Is there any way to pass parameters to the kernel? I'd like to change the resolution of the virtual terminals and it seems that I'd need to pass "vga=794" (1280×1024, 16bit colours) to the kernel for my display.

(flashing the kernel with 'fastboot flash recovery nvidia_boot.img -c "vga=794" ' doesn't seem to work...)

EDIT: I found out how to add boot parameters:

I had to change the line 'cmdline =' to 'cmdline = "vga=794" ' in the file bootimg.cfg and then I created a new boot image with abootimage as described in the Makefile.

Now the virtual terminals look as they should on my monitor.
[Shield Android TV General] verbosetextfile:
I used the nvidia_boot.img and the SDcard image from the original post and it worked fine for me... (I got my ShieldTV yesterday and it updated to Firmware 2.1 at boot). (The only thing I changed was to format my 2GB-SDcard to ext4 and then I simply copied the files from the provided SDcard image to my SDcard with the same permissions (I couldn't put the image to the SDcard directly since I don't have a >2GB SDcard))

When I want to boot the nvidia_boot.img I flash it as you told me and then I select "boot recovery kernel" in the fastboot menu on the shield. It seems that per default it will output a 1920x1080 image (like the original kernel in android) regardless of the actual screen size (which is pretty annoying). Maybe that's why your monitor stays black? I've tried two 1280x1024 monitors before I tried a 1920x1080 monitor; one didn't show anything, on the other one I could see the fastboot menu in a strange way (there I got the idea that I might need a 1920x1080 monitor).

When I boot the system it waits ~2min for network (it doesn't seem to get the correct LAN-configuration in my network) and then continues to boot to LXDE (which somehow doesn't look right on my monitors, but I wanted to use the command line only anyway).

It seems that when I unplug my ShieldTV that it "forgets" the flashed kernel (it boots the original android recovery kernel). (Right now I always re-flash the kernel when I want to boot the shield, I'll try to figure out what I could do against that later...)

(In case anyone wants to change their virtual console resolution here's a list of vesa-modes to use: ht tps://help.ubuntu.com/community/ConsoleFramebuffer
[Shield Android TV General] Thanks_Meter:
Yeah, I'm writing these lines from L4T on my shield tv! :D

The boot image from the first post also works with the nvidia gpu drivers. Unfortunately the usb-bug (sometimes usb is not working) is annoying, wifi is not working and I only get a glmark2 score of 705 points which is less than what I get on the jetson tk1. But nevertheless no noisy fan and a beautiful case. :good:
[Shield Android TV General] yahoo2016:
Congrats!

So you were able to recover boot partition after it was overwritten?

Have you tried to replace rootfs from OP with L4T rootfs/nvidia_drivers/config (that could fix USB/WIFI)?

Have you tried to install/build and run Cuda 7.5 samples?
[Shield Android TV General] Thanks_Meter:
Yes, fastboot is always accessible by playing this very annoying tapping game at startup. I've never seen such a stupid solution to get into fastboot in any Android device before. It feels like "if you want to save your shield tv you must beat the level boss". I used the boot partition because in recovery the kernel got wiped every time and I had to flash it over and over again. But now I lost Android (can be recovered by reverting the boot partition).

Yes I installed L4T rootfs/nvidia_drivers/config. It is much better than the rootfs from first post but the usb problem still exists.
[Shield Android TV General] dharmaone:
Would it be possible to have a dual boot Ubuntu/Android TV on this?
[Shield Android TV General] yahoo2016:
I received Shield TV yesterday. No problem to unlock SW 1.0 before connected to internet. I could not find settings to prevent SW update.

After connected to Internet, SW automatically updated to 2.1.

Install linux using kernel/rootfs was not smooth, the following worked after unlocking bootloader and turn on USB debug:

(1). copy and install MMC with rootfs (*.2G) from OP.

(2). from another Linux PC using USB/micro USB cable enter: "adb reboot bootloader" to reboot Shield to bootloader mode.

(3) flash kernel (nvidia_boot.img) from OP: "sudo fastboot flash recovery nvidia_boot.img"

(4). Since only power button works in bootloader mode, use power button to select "boot recovery".

(5). Linux booting messages should show on 1920x1080 HDMI monitor connected to Shield (other resolutions may not work).

(6). Screen becomes black likely, hit "ctl+alt+F1" from keyboard to get terminal. Login with "android" and "changeme" as shown by OP.

(7). Enter "sudo stop lxdm" and "sudo stat lxdm" to get desktop.

I had to do the above every time to boot to Linux. If I use "adb reboot recovery" from another PC after power up, I'll get "No Command" on screen and have to power cycle to recovery.
[Shield Android TV General] Thanks_Meter:
I had the same problems apart from point 6. The question is if you want to keep Android or if you prefer a Linux only device. In case of the latter option you can simplify the procedure by "fastboot flash boot nvidia_boot.img". I would recomend to create a backup of the boot partition before. Then you can revert this in Linux with "dd if=boot.img of=/dev/mmcblk0p18 oflag=direct" where boot.img is your backup. If something went wrong with dd the device will directly boot into fastboot - so no problem.

But did you try L4T? The procedure to get it on the SD card is the same as for the CB5-311 - but this time I don't need to send you Kernel modules ;).
[Shield Android TV General] yahoo2016:
I thought you were as helpful as xcvb at nvidia developer site:)

I got my shield less than 1 day, yes, I just tried to copy rootfs/config/nvidi_drv to mmcblk1p1.

After boot, screen showed ubuntu login in terminal and turned black. I could not get terminal by "ctl-alt-F1" and therefore was not able to run "depmod" or "lsmod". I could not find makefile to make module install. How did you load the modules?

I want to keep Android and can live with boot to recovery process.

---------- Post added at 08:04 PM ---------- Previous post was at 07:56 PM ----------

I was still using kernel from OP when tried L4T rootfs.
[Shield Android TV General] Thanks_Meter:
I had the same situation. The login prompt appeared for a split second and then I got a black screen.

To be honest I cannot exactly reproduce what I did but I just pressed several keys on my keyboard and suddenly the Ubuntu desktop appeared. Maybe I also entered "ubuntu" in the keyboard and pressed enter which is the Login password for user "ubuntu". The first thing I did was activating autologin so I don't have this problem anymore. If This all does not work you can at least get a console login if you don't install the nvdia drivers. Then you can setup ssh to see whats going when you get a black screen (maybe you can restart LightDM or X).

BTW: I guess I fixed the USB bug now by using an USB-hub. :D

---------- Post added at 09:43 PM ---------- Previous post was at 09:27 PM ----------

Better idea:

Create a file "/etc/lightdm/lightdm.conf" on the SD-Card with the following content:

[SeatDefaults]

autologin-user=ubuntu
[Shield Android TV General] yahoo2016:
Got my shield only one day, I started to hate it. boot to linux is unpredictable. The same files from OP and same MMCs worked few times in the morning could not get Linux booting using the same procedure since this afternoon. Screen won't show any linux booting message after "boot recovery" button is pushed.

I could not find serial port inside after probing many pads on PCB.

If Android is kept, there is no way to stop SW OTA updating, it appears new SW either make fastboot harder to boot to linux or introduced bugs for booting recovery.

I have to use my Jetson TK1 and Chromebook 13 to do useful work until someone find solution to make linux more reliable for the shield.
[Shield Android TV General] yahoo2016:
There are some issues to make booting linux difficult:

(1). unlike other linux devices such as RPi and Chromebook, Shield does not show boot messages until very late, it's hard to tell if the issue is due to kernel or rootfs. Is there a way to make shield display booting messages?

(2). Boot and recovery partitions are small (25 MB?), new built kernel (26 MB) could not be flashed to recovery. Is there way to shrink kernel or safely expand boot/recovery partition?
[Shield Android TV General] yahoo2016:
I'm more comfortable with shield TV by knowing I can recover it using ROM images from nvidia:

https://developer.nvidia.com/gameworksdownload

I tried "flash_all.sh" to flash SW 1.3 and it worked.

It seems safe to flash linux kernel to "boot" partition using "fastboot". Original "boot.img" could be flashed to "recovery" partition for dual boot.
[Shield Android TV General] Thanks_Meter:
The problem here is to get into fastboot without "adb reboot bootloader". If you are good in tapping the power button then I don't see any risk. If not you still have the possibility to revert the boot image from Linux (provided it runs). Did you create the "lighdm.conf" file to activate autologin on L4T? You can also do this on your pc since it's stored on the sd-card.
[Shield Android TV General] yahoo2016:
I figured out how to reliably get to fastboot by practice: I have Shield plugged into a power strip to power it up, I start push the power button 1 second after power up and hold it for 3 seconds. If I hold it too long, it will continue to boot from fastboot. Tapping doesn't work well, holding works better.

Update:

As another member pointed out, Shield TV must be connected to a PC using OTG cable to bring up bootloader.

I have not created the "lighdm.conf" file since I can't even get any Linux booting message on screen.

I'm looking for the ways to have Linux to display booting messages for shield like majority of Linux systems.

I'm not able to fit new kernel in recovery partition.
[Shield Android TV General] verbosetextfile:
Did you get the following error messages?

arch/arm64/kernel/vdso32/vgettimeofday.c: In function ‘__kernel_clock_gettime’:
arch/arm64/kernel/vdso32/vgettimeofday.c:188:1: error: r7 cannot be used in asm here
}
^
arch/arm64/kernel/vdso32/vgettimeofday.c:188:1: error: r7 cannot be used in asm here

In the line 188 in the file vgettimeofday.c is just a '}'. r7 is used in the file vdso32.h (which is in arch/arm64/kernel/vdso32/) in line 50 ("register long nr asm("r7") = _nr;"). As far as I can tell it seems that nr is only used in the defined wfe() function (in file vdso32.h) which is used by vdso_read_begin([...]) in vgettimeofday.c which is used by the functions do_realtime_coarse([...]), do_monotonic_coarse([...]), do_realtime([...]), do_monothonic([...]) (in vgettimeofday.c) which in turn are used in the function __kernel_clock_gettime([...]) (in vgettimeofday.c) which ends at line 188.

I think I might have found something related: ht tps://tls.mbed.org/kb/development/arm-thumb-error-r7-cannot-be-used-in-asm-here . It seems that gcc might use r7 as "frame pointer" (whatever that is) and there's the suggestion not to use the frame pointer (by adding the "-fomit-frame-pointer" parameter to gcc). Could we do something similar here or would this mess everything up completely? (I'm sorry if this is a stupid question, I don't know much about assembly and kernel developement). If it doesn't work like this, what else could we do? Replace r7 with an unused register? (Although I'd guess that all registers are in use already...)
[Shield Android TV General] toxot:
Hello, can you explain how you install L4T on your device more detailed. Im already boot in linux by OP manual.
[Shield Android TV General] omegastaralpha:
thx
[Shield Android TV General] Thanks_Meter:
Put your sd card to your pc and create it there.

Yes, I get exactly the same error. I'm using the kernel source from nvidia site and the kernel configuration from the corresponding kernel headers archive. No idea what to do.

I got this error when I used arm-none-eabi-gcc compiler. With arm-linux-gnueabihf-gcc compiler I get:

/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: error: required section '.rel.plt' not found in the linker script
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: final link failed: Invalid operation
collect2: error: ld returned 1 exit status

You need config.tbz2, nvidia_drivers.tbz2 and Tegra_Linux_Sample-Root-Filesystem_R23.1.1_armhf.tbz2 from ht tp://developer.download.nvidia.com/embedded/L4T/r23_Release_v1.0 and a ext4 (or maybe ext3 - not sure) formatted sd-card. The archives config.tbz2 and nvidia_drivers.tbz2 are inside Tegra210_Linux_R23.1.1_armhf.tbz2.

Then extract everything in the following way:

cd /<path to sdcard>/

sudo tar -pxvf /<path to tbz2 archives>/Tegra_Linux_Sample-Root-Filesystem_R23.1.1_armhf.tbz2

sudo tar -pxvf /<path to tbz2 archives>/config.tbz2

sudo tar -pxvf /<path to tbz2 archives>/nvidia_drivers.tbz2

sudo echo "[SeatDefaults]">etc/lightdm/lightdm.conf

sudo echo "autologin-user=ubuntu">>etc/lightdm/lightdm.conf

The last two lines will create a lightdm config file which will activate autologin. Create this file on the sd-card and not on your pc (etc/ and not /etc/) !!!
[Shield Android TV General] yahoo2016:
I confirmed USB hub makes mouse/keyboard working when they get stuck.

I'm using kernel from OP, I got nothing listed using "lsmod". Do you have modules listed? If you use kernel from L4T, you should have sound and other drivers loaded.

I do not have those drivers in /lib/modules. I'm still using kernel from OP because I can't make kernel from L4T fit in boot or recovery partitions.
[Shield Android TV General] Thanks_Meter:
Does L4T work now? I'm also just using the kernel from OP and I don't have any modules loaded. Sound does work for me this way but wifi doesn't. I deactivated wifi now since the error messages bombarded my kernel log. If everything is included into the kernel you don't need any kernel modules.
[Shield Android TV General] toxot:
Thank you for information, i done all according to your instructions, linux booting, but sudo and many others standart commands not working.
[Shield Android TV General] yahoo2016:
L4T rootfs works now after I tried different mmcs. L4T is easier to boot than OP's 2G rootfs. I put 2G on the mmc first, it did not boot, I installed L4T on the same mmc, it booted to ubuntu desktop without the lighdm.conf and without entering user/pw.

I have "Analog Output tegra-snd-t210ref-mobile-es755" listed in "Settings", but no sound on HDMI. I have not run the alsamixer set up.

I do see many drivers in L4T/kernel/kernel_supplement.tbz2 which is not part of L4T rootfs.

I can run "sudo apt-mark hold xserver.xorg.core" and "sudo apt-get update" without issue.

Overall shield is very sluggish compared with Chromebook CB5. It takes ~60s to boot while only 10s for Chromebook.

Starting firefox is also very slow. I have 4GB RAM for CB5, that could make difference than 3GB for Shield.

---------- Post added at 01:01 PM ---------- Previous post was at 12:54 PM ----------

How did you turn off wifi? Wifi could be the cause for boot delays.