yashsingh1/xdaforums huggingface dataset:
[Shield Android TV General] wejgomi:
Yes, that's how I also do, preparing the rootfs stick directly from Ubuntu 18.04, with a single partition(ext4) created through GParted, then uploading everything found in ./rootfs.

I'm actually trying to set this up in recovery partition, so can cycle through OS'es with adb commands, I also tried to fastboot boot either.

Maybe I'm asking too much, but is it possible for you to dump image(dd then zip) from your working rootfs ?

Thanks for all your troubles.
[Shield Android TV General] Mogster2K:
It's a huge image. I don't think my connection could take it. If you really need it, I could set up a new image from scratch, but I think it'll be a day or two before it's ready.
[Shield Android TV General] wejgomi:
Would be great, I'm really banging my head on this, 3 different microSD and 4 USB flash, GPT/MBR partition table, all single partition, always ends up with the same kernel panic. I'm attaching an SS of output, perhaps someone could comment.

I've also seen a mention on forum creating an ESP partition right before the ext4 side, but I wouldn't think that to be the culprit as almost everyone has success with one single partition.
[Shield Android TV General] Mogster2K:
Hmm, it might take more time than I thought. I just tried making an image from 24.2.3 and it also crashed. :eek: I'm not sure which version I used to make my working image. Have you already tried using 24.2.2 or 24.2.1?

Also, the kernels in this thread are outdated - probably from 24.0.x or 24.1.x. Unfortunately I don't know how to modify a newer kernel to change the boot device.
[Shield Android TV General] wejgomi:
I've given 24.2.1 and 24.1(boot.img&rootfs attached in forum) a try to no avail. There's also this("Ubuntu 16.04 on Shield TV"), mix&match kernel-rootfs build I believe, which again is not working.

Could you share the boot.img working for you ? Perhaps the kernel is the cause as you mention.
[Shield Android TV General] Mogster2K:
The kernel I use is mmcblk1p1.img from the first link in the initial post.

Something else to try: when you unpack the archives and copy the rootfs, be sure you use root or sudo. Most of the files need to be owned by root.
[Shield Android TV General] wejgomi:
Yes, I'm a network administrator, so pretty much every other day spent on Unix, rendering this practically a mission to me(lol). Could you try and see which sample rootfs you're currently using, did you use a QEMU container, I believe the first post is built for 24.2, could you see whether 24.2/24.2.1 is booting if possible ?

Thanks.
[Shield Android TV General] Mogster2K:
Okay, I think I've got it this time. R24.2.3 copied using dd on partition /dev/sdc1 or whatever the sdcard was:

R24.2.3

Should I have used dd on the device rather than the partition? I don't know if that would make a difference. Anyway, copying the rootfs directly to the sdcard just doesn't work for me. I don't know why. I ended up compressing it with "sudo tar cpjf ../rootfs.tbz2 *" (I think) and then decompressing it directly to an sdcard using a live CD. IIRC it's how I made the previous working installation.

BTW the rootfs was built in a Mint Linux virtual machine. I'm also assuming you know how to use 7-zip. ;)
[Shield Android TV General] wejgomi:
Worked :)

Just when I was about to throw in the towel on lack of time. I really don't know how much I can thank you for this, I've wasted hours and hours researching, digging into every post avail, and even trying different ARM builds. After a simple pv clone of this img, everything just seems to work.

I'm still unsure of the cause, perhaps it was something related to the permissions of the files/folders when copied, the mystery still holds, but I have to tell you that I'm very glad that I finally can get this out of my mind. By the way, dual partitioning scheme works perfectly with Android/Ubuntu, and I can use same HDD for UNIX(ext4) and as media server(exfat) too. Flashing the boot.img to recovery partition is also a go, can cycle OS'es with simple adb commands using ADB ethernet.

Thx again for all your effort and time, hugely appreciated ! ;)
[Shield Android TV General] Mogster2K:
Glad it worked out for you. Yeah, I have no idea why tar works and "cp -a" doesn't... maybe it screws up the links? Anyway, enjoy. Unfortunately this may be the last version of Linux4Tegra that we get; Nvidia seems uninterested in supporting the ShieldTV alongside the Jetson dev boards.
[Shield Android TV General] wejgomi:
Yeah, they pretty much did the same for when they introduced older revisions like Tegra3-4, even failed to see one major update. Gotta use it while we can I think..
[Shield Android TV General] Mogster2K:
Note: the 7.2 update breaks the sdcard boot image! The sdcard device has somehow changed from mmcblk1 to mmcblk2. Not sure how to fix it yet.
[Shield Android TV General] fruithat:
Does Linux4Tegra work on the 2017 shield TVs?

Can you boot it from a USB sd card? Maybe a USB stick?
[Shield Android TV General] Mogster2K:
No idea, I only have a 2015 Shield.
[Shield Android TV General] fruithat:
Can your 2015 model boot from a USB stick?
[Shield Android TV General] Mogster2K:
No, it just hangs at the Nvidia logo.
[Shield Android TV General] zigguratt:
I haven't read through all 666 previous messages so if I missed something I apologise. I have a 2015 Shield Pro. I'm about to swap the HDD for an EVO 500GB SSD. I also want to run Linux.

I'm thinking that booting Linux from a MicroSD and using the SSD as storage makes the most sense. From what I did read here, booting Linux from MicroSD is a solved problem. If I do that, is there anything special I need to do to the SSD? Or can I just use it from Linux as I would normally? I won't be using the Shield for anything else, so I don't care about the contents of the HDD.

I want a small, attractive Linux machine with a good GPU and an SSD. I'm hoping the Shield can be that machine.
[Shield Android TV General] Mogster2K:
It's been a while, but IIRC Linux and Android won't play nice with external storage. Linux wants a 1MB gap before the first partition like PCs do, but Android wants no gap. (Or it might be the other way around. I don't remember and my Shield is bricked.) You should also be aware that Shield L4T is stuck at Ubuntu 16.04 and will likely never get an update.
[Shield Android TV General] zigguratt:
Thank you, [MENTION=4148780]Mogster2K[/MENTION]. In my poking around I saw a few threads on installing alternate Linux distributions, even Arch Linux, my distro of choice. L4T may be stuck in the past, but perhaps I would have success with another one?

All I need is SSH access to a Linux that can drive the Shield's GPU and can read/write the SSD. From there I can install the software I need. No fancy desktop or mouse/keyboard access.

I think I need to do more research. Thanks again, [MENTION=4148780]Mogster2K[/MENTION].
[Shield Android TV General] crnkoj:
did anyone try to install the jetson nano software onto the shield tv? Since its basically the same system, just with reduced gpu and downclocked, it should work nice
[Shield Android TV General] guertler:
Hi

Did you also try newer version of L4T recently?

According to https://developer.nvidia.com/embedded/linux-tegra-archive also newer version support Jetson TX1.

How would you recipe change for new versions?

Do you know about any other Linux distributions supporting Nvidia Shield TV (e.g. postmarketos)?

What is the content of these bootimages you provide a link to? Could you link/provide a tutorial how they are to generated?

Many thanks in advance
[Shield Android TV General] guertler:
Hi

Did you also try newer version of L4T recently?

According to https://developer.nvidia.com/embedded/linux-tegra-archive also newer version support Jetson TX1.

How would your recipe change for new versions?

Do you know about any other Linux distributions supporting Nvidia Shield TV (e.g. postmarketos)?

What is the content of these bootimages you provide a link to? Could you link/provide a tutorial how they are to generated?

Many thanks in advance
[Shield Android TV General] jmtatsch:
Even got wifi to work, thank you very much yahoo2016!

Is

sudo apt-mark hold xserver.xorg.core

still recommended?
[Shield Android TV General] yahoo2016:
You are welcome.

"sudo apt-mark hold xserver.xorg.core" was from a post at Nvidia forum to prevent Nvidia driver for Tegra X1 being overwritten by "sudo apt-get update" or "sudo apt-get upgrade"
[Shield Android TV General] jmtatsch:
I mostly use linux now, so I would like to flash it to boot.

Can someone give me a hint how to backup the old android and flash it to recovery?

With

adb backup

I don't get an image to flash, right?
[Shield Android TV General] yahoo2016:
Since you only need to replace boot and recovery partitions, you can always recover them by using "sudo fastboot flash boot(recovery) boot(recovery).img" with any version of rooted or stock boot/recovery.img from Nvidia web site.

https://developer.nvidia.com/shield-open-source

Be careful to flash other partitions, flash bootloader partition could (and very likely for later ROMs) brick the shield, I bricked mine by following the instructions to flash ROM 2.1.
[Shield Android TV General] deerish:
You can boot 'Image' from "Linux_for_Tegra/kernel". I generated 'boot.img' with it and a modified 'l4t_initrd.img' from "Linux_for_Tegra/bootloader".

You also need to flash the device tree blob for your device from "Linux_for_Tegra/kernel/dtb".

WiFi isn't working.
[Shield Android TV General] yahoo2016:
That's very interesting. I was only able to have it working with modified Android kernel source (CM). Do you mind to post details?

Will Android still work after dtb is replaced?
[Shield Android TV General] deerish:
Android does not work with the replaced device tree blob.

Quick and dirty, replace references to "/dest" with "/mnt" in 'init.c' and overwrite 'init' [shell script] in 'l4t_initrd.img'.
[Shield Android TV General] yahoo2016:
Did you use "sudo fastboot flash dtb xxx.dtb" to replace Android dtb with L4T dtb?

That helps to understand the black magic of Shield TV's fastboot bootloader and why Android kernel source is needed when dtb is not replaced.
[Shield Android TV General] deerish:
Yes, I flashed via fastboot.
[Shield Android TV General] Thanks_Meter:
The reason why an Android kernel is required is because in Android the dtb is placed in a separate partition is this is not the way a mainline Linux handles dtbs.
[Shield Android TV General] yahoo2016:
It seems deerich can run L4T kernel and use dtb from separate partition.
[Shield Android TV General] Thanks_Meter:
Yes, I see - cool :good:

[MENTION=7191545]deerish[/MENTION]: I guess tegra210-foster-e-p2530-0930-e02-00.dtb (231.260 bytes) is the dtb I must flash when I have installed version 1.3 on my non pro shield tv. Do you still have access to fastboot menu?
[Shield Android TV General] deerish:
Yes, you can still access the fastboot menu.
[Shield Android TV General] deerish:
I have been able to boot a kernel built from the L4T source package. WiFi works with firmware from the OP.
[Shield Android TV General] yahoo2016:
That's very promising. I'll try it after I receive my Shield TV back from RMA repair.

I guess it's fastboot forcing dtb to the Android dtb partition and there is no easy way to be able to boot to L4T kernel while keeping stock Android.

It appears u-boot can be configured through environment variables to change boot options (e.g., partitions for kernel, dtb), but fastboot can't be configured.
[Shield Android TV General] crnkoj:
Was it not so, that replacing the dtb, meant a bricked shield?
[Shield Android TV General] yahoo2016:
I'm not sure if fastboot uses dtb partition. If yes, replacing dtb in dtb partition could brick the Shield. If recovery mode still works, the Shield is not bricked. I don't want to brick my Shield just in days after it's returned from RMA.
[Shield Android TV General] deerish:
Sublime ignorance, I guess. I've only had the Shield for a few days and nothing I've done has bricked it.
[Shield Android TV General] yahoo2016:
From what you have posted so far, I believe you know what you are doing.

I did some searches, it appears bootloader itself doesn't need dtb, but it passes dtb to kernel. If dtb is bad, kernel won't be loaded, but bootloader should be working, i.e., recovery mode should still be working.
[Shield Android TV General] Thanks_Meter:
I tried it with tegra210-foster-e-p2530-0930-e02-00.dtb (231.260 bytes) and prebuild l4t kernel. Everything works for about 20 seconds but then ubuntu freezes and I cannot do anything. I'm now back on android kernel.
[Shield Android TV General] yahoo2016:
Thanks for trying, I'm sure deerish can help.

My Shield delivery was delayed by FEDEX to next Monday.

From what I read from the following link:

ftp://download.nvidia.com/tegra-public-appnotes/t210-nvtboot-flow.html

There are 2 parts of dtb to pass to kernel, the dtb from "tegra210-foster-e-p2530-0930-e02-00.dtb" and dtb generated by boot loader with SDRAM training:

*****************************************************************************************************************************************************

nvtboot/cboot were originally designed to support an Android boot model where nvtboot loads the DTB and edits it to contain various runtime-generated data such as LPDDR4 training parameters, and cboot simply passes this DTB on to the Linux kernel. This data flow can be supported with U-Boot, but would invalidate one of the prime benefits of using such a flexible bootloader; namely, being able to load the kernel, DTB, and initrd from flexible and easily updatable sources such as regular filesystem files, or network servers. Such a data flow would also be rather inconsistent with the flow used on previous Tegra chips.

To work around this, L4T U-Boot includes a feature that allows certain device tree nodes to be copied from the nvtboot "kernel DTB" over the top of the DTB that U-Boot will pass to the kernel it boots. This allows the best of both worlds; U-Boot can still acquire the DTB from a flexible source, yet any data generated by nvtboot can still be passed to the kernel as required for proper operation. This feature is controlled by U-Boot environment variables $fdt_copy_node_names and $fdt_copy_src_addr.

****************************************************************************************************************************************************

I'm wondering if ubuntu freezes was due to SDRAM training dtb not passed to kernel.
[Shield Android TV General] raubtier2:
Hello yahoo2016,

be cautious. I bricked my shield today. I tried the method from deerish.

I use this dtb:

With this dtb, I can't boot into linux.. I don't try to ssh from another box, if it booted without screen. Maybe deerish can tell us, which dtb he really uses. But fastboot was still possible afterwards.

Then I used the dtb for the tx1-development-board: tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb.

For the first time from the fastboot-menu I could log into my shield.

Output of uname -a

Linux tx1 3.10.67-gcdddc52 #1 SMP PREEMPT Mon Nov 9 13:16:26 PST 2015 aarch64 aarch64 aarch64 GNU/Linux

I was happy for a very short time. Problem, when I tried to reboot the shield via recovery, I don't

get into fastboot mode.. Fastboot was gone and my board bricked.

If somebody knows, how I can give my board new life, I would be very happy.

So my advice: Be very careful with the change of any dtb-file.
[Shield Android TV General] Thanks_Meter:
As far as I know the dtb is loaded by the bootloader so you must reboot your shield tv to get the new dtb loaded. My suspicion is that at that time you were able to boot linux you actually used tegra210-foster-e-p2530-0930-e02-00.dtb which was still in the ram. I guess tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb is the device tree for the jetson tx1 so this will not work. Do you still get the nvidia logo or just black screen?
[Shield Android TV General] raubtier2:
I see the nvidia boot-logo, but nothing more.

---------- Post added at 06:05 PM ---------- Previous post was at 05:53 PM ----------

But you are right, the first time I used tegra210-foster-e-p2530-0930-e02-00.dtb, it was not loaded,

because I used the old dtb.

For the second time, I used the right dtb (tegra210-foster-e-p2530-0930-e02-00.dtb) and I could

boot into l4t. But I flashed the wrong dtb, very very stupid.

So the method from deerish is running nicely.
[Shield Android TV General] Thanks_Meter:
OK, if you can see the nvidia logo then the bootloader seems not to depend on the dtb in the dtb partition (this was an open question). When I changed the dtb the hold technique did no longer work to get into fastboot (maybe I was just too stupid) but the tapping one did (when you see the nvidia logo it's too late -> try again). Since I downgraded to version 1.3 I only needed 3 attempts to get into it (compared to ~50 attempts with version 2.1).
[Shield Android TV General] deerish:
sha256: 7738251d3d5ce0e46377bc5709baea706e1c5bf99ee648df5ebc181197baccfe tegra210-foster-e-p2530-0930-e02-00.dtb

... for the 16 GB Shield TV.
[Shield Android TV General] raubtier2:
Can you describe your tapping method a little bit more. Thanks in advance.
[Shield Android TV General] Thanks_Meter:
It's like the hold method but with tapping instead of holding. Connect the shield tv via usb-otg with your pc. Then plug in the power supply and immediately start tapping the power button (maybe a little slower than you would do for a double click) for about 4 seconds. If everything works you will get into fastboot menu. If not you will get the nvidia logo -> try again.
[Shield Android TV General] raubtier2:
thank you for your help, but till now no success. :(
[Shield Android TV General] Thanks_Meter:
I suppose you understand german. Maybe this can help you:

http://www.pro-linux.de/artikel/2/1802/4,booten-des-linux-systems.html
[Shield Android TV General] yahoo2016:
Thanks for letting us know replacing dtb could render Shield into unusable state.

This is different from the state when I and many others tried to flash bootloader and dtb from official ROM 2.1 , in that state, there is not Nvidia logo, just black screen doesn't matter how the power button is pushed or taped.

Which ROM version do you have? ROM 1.3 may not have the recovery mode bug. I'll flash ROM 1.3 when I get my Shield back.

I always plug Shield in a separate power strip so I can turn on/off power quickly while holding or typing Shield power button.

As long as you have Nvidia logo, there is a chance you can get into recovery mode by tapping Shield power button as Thanks_Meter suggested.

If everything fails, you can contact Nvidia Customer Care, they are helpful and will issue RMA in most case, but the process is very slow, it took 3 weeks in my case, mostly due to bad FEDEX services in US. Nvidia issued RAM after 1 week (due to holidays), received my Shield in Friday afternoon and shipped repaired or replaced Shield the next Tuesday morning. FEDEX tracking showed delivery by end of day yesterday and signature is needed, I came home early and waited until 8PM then found delivery was delayed to next Monday.

I believe Nvidia is aware so many Shield devices got bricked due to bug in their later bootloaders.
[Shield Android TV General] yahoo2016:
I started to think dtb needs to be replaced for L4T kernel not because Android/Linux issue but kernel version issue. Hopefully the next Shield TV ROM update will fix many issues including bootloader issue and make L4T kernel work without replacing dtb.

I'll hold on trying L4T kernel until next ROM update.

jagger11 (the OP of the other thread) reported his Shield was bricked by loading different dtb. There are bugs in latest Shield TV bootloader and can be triggered by dtb replacement.
[Shield Android TV General] jmtatsch:
reboot not working?

Is it just me or are

sudo reboot
sudo shutdown -r now

not working with the op's kernel?

sudo reboot -f

works though...
[Shield Android TV General] yahoo2016:
I do not have my Shield to confirm but I believe you mentioned above are true. Can you try from Android shell the above?

When Shield is shut down, power button may be needed to resume. This may be hardware or driver limitation.

I understand "sudo shutdown -r now" is very useful for remote access. I use remote power switches to power cycle PCs and single board computers in order to hard reset them. Most Intel CPU BIOS's allow setting power up state, I'm not sure if Shield TV power up state can be configured.
[Shield Android TV General] verbosetextfile:
Is there any particular reason not to use "-j<n>" (where <n> is a number, e.g. "-j9") as parameter for make? (This parameter specifies the amount of threads to use; using a few threads for compilation is much faster on my machine than just using one (which seems to be the default)).
[Shield Android TV General] yahoo2016:
Thanks for the input, I'll try it on my laptops.

Which Makefiles did you change, only at top level, or in all the sub directories?

I tried to rebuild kernel on my HP Z-book, "System Monitor" seems to indicated all 8 cores are used.
[Shield Android TV General] verbosetextfile:
I didn't change any Makefiles, I just used "make O=$TEGRA_KERNEL_OUT zImage -j9" instead of "make O=$TEGRA_KERNEL_OUT zImage".

Random side notes:

As far as I can remember I somewhere read the suggestion to use -j<core count +1> for make. (I'm not sure why this was recommended somewhere, but I found out that even -j100 doesn't seem to make any problems.)

If there's an error the message might not be in the end but somewhere between a few other messages. (The easiest way to get the message to the bottom probably is to re-run make without the -j<n>.)
[Shield Android TV General] Thanks_Meter:
You can also just type -j (without number) which means full power. Sometimes I get linker errors when linking starts before object files had been build but it seems that there are no such problems with the Linux kernel.
[Shield Android TV General] verbosetextfile:
Ah, that's good to know, thanks!
[Shield Android TV General] yahoo2016:
I took me about 9 minutes to build kernel without "-j". CPU usage for all 8 cores was about 20%.

When I tried "make O=$TEGRA_KERNEL_OUT zImage -j" without "9", CPU usage for all 8 cores was solid 100%, memory usage increased to 100% (16GB) and my HP Z-book locked up.

When I tried "make O=$TEGRA_KERNEL_OUT zImage -j9", CPU usage for all 8 cores was near 100%, memory usage was less than 1GB and build finished in 2 minutes without error.
[Shield Android TV General] verbosetextfile:
"make O=$TEGRA_KERNEL_OUT zImage -j" seems to use up to all <available RAM - ~800MB> on my machine which means that when I e.g. open Firefox before compiling I run into memory issues (a lot of programs are swapped to disk and therefore my system becomes very unresponsive (luckily there's the magic sysrq key for that :) )). However, when I don't have other programs open it seems to work (right after a reboot at least). In this case make started ~4500 Processes (in order to try the "-j" option I had to remove the maximum process limits in /etc/security/limits.conf) and used (nearly) all available memory. Both "-j" and "-j9" took ~2m40s on my machine, so I'll simply stick with using "-j9".

(Edit: It seems that having 4500 CPU cores (and perhaps even more) could actually be useful (for a short time at least) to compile the Linux kernel ^^)
[Shield Android TV General] yahoo2016:
I updated my first post to include your inputs so other members can take the advantage of "-j9" without searching through all posts:

****************************************************************************************************************************************

As suggested by verbosetextfile, adding "-j9" to "make" in "first.sh" could significantly increase build speed (e.g., by factor of 4):

http://xdaforums.com/showpost.php?p=64764700&postcount=97

*****************************************************************************************************************************************