Ubuntu Utopic for nvidia shield tv

Search This thread

yahoo2016

Senior Member
Nov 24, 2015
392
88
Thanks for the link and the really nice and detailed tutorial. Now, I think I have some more hints to go ahead and will use your post.
The only kernel source worked for me is CM source. I tried L4T kernel source and OP's config file but could not have Shield TV boot.
I believe the kernel source for Shield TV is more Android than mainline Linux, even the rootfs is Linux.
 

dieter.reuter

Member
Aug 3, 2015
13
1
The only kernel source worked for me is CM source. I tried L4T kernel source and OP's config file but could not have Shield TV boot.
I believe the kernel source for Shield TV is more Android than mainline Linux, even the rootfs is Linux.

That's good to know, I will try your tutorial and scripts later when I'm back home from work. For me it's just important to get first an own build kernel running on the ShieldTV and tweak some kernel settings as well. Then I can try the hard way and will incrementally move to an 4.x upstream kernel.

Do you think, it's possible to install uBoot on the ShieldTV, maybe as a special boot.img? Then it's easier to use an own kernel, and it's more like the common Linux style.
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
That's good to know, I will try your tutorial and scripts later when I'm back home from work. For me it's just important to get first an own build kernel running on the ShieldTV and tweak some kernel settings as well. Then I can try the hard way and will incrementally move to an 4.x upstream kernel.

Do you think, it's possible to install uBoot on the ShieldTV, maybe as a special boot.img? Then it's easier to use an own kernel, and it's more like the common Linux style.
U-boot has been installed on Android phones:

http://forum.xda-developers.com/galaxy-s2/general/uboot-bootloader-true-multiboot-t1680898

I believe it's possible.
 

DroidMahn

Senior Member
Feb 6, 2012
123
25
Fresno
Anyone know how to increase the storage on the Ubuntu image? It's partition for two gigabytes by default but I have a 200 gigabyte SD card and I'd like to at least use 80 of it. Don't have access to a computer right now and I've been using it for word processing but it would be cool to download some TV shows
 
Anyone know how to increase the storage on the Ubuntu image? It's partition for two gigabytes by default but I have a 200 gigabyte SD card and I'd like to at least use 80 of it. Don't have access to a computer right now and I've been using it for word processing but it would be cool to download some TV shows

I would boot into a http://gparted.org/ live cd/usb on a pc and extend the partition that way. How well does this run cant see any vids on youtube?
 

Thanks_Meter

Member
Feb 1, 2013
44
6
Anyone know how to increase the storage on the Ubuntu image? It's partition for two gigabytes by default but I have a 200 gigabyte SD card and I'd like to at least use 80 of it. Don't have access to a computer right now and I've been using it for word processing but it would be cool to download some TV shows
Procedure to increase the partition size:
1.) sudo fdisk <device>
2.) delete partition (option 'd')
3.) create new partition with required size (option 'n')
4.) write new partition table (option 'w')
5.) reboot
6.) sudo resize2fs <partition>
 

jagger11

Member
Dec 22, 2011
12
27
Hi,

The OP here. Didn't know so many people were interested in this exercise :)

In any case - I prepared a new image - this time based on upcoming Ubuntu Xenial (16.04LTS). As previously, available here - goo.gl / sl6rMu

The Xorg driver seems a bit more stable, and doesn't disconnect HDMI after some minutes. I also added restart of LXDE after initial boot, so you should see the LXDE login screen most of the times now (previously, it was very random, probably due to HDMI subsystem code). The image itself is also <2G, so it fits on 2G cards (but, there's only ~300MB free space left).

I skimmed through this thread, and it seems that people are trying to work more on this problem, including compiling the kernel. This seems to be solved now (in some other thread), but out of curiosity I tried to compile the newest available kernel from the nvidia's git, and even if it had compiled (btw, it requires a lot of manual patching), it doesn't work well: the HDMI constantly reports plugged/unplugged events, and the CPU voltage regulator goes crazy. So, the kernel in nvidia_boot.img is pretty much the same.

If you have any question of requests, please feel free to post it here, and I'll check the thread today and tomorrow, but I'm not sure how I could help you more at this point. I'm too lazy to work on dual boots, and other such shiny features, and I'm not really interested in CUDA (although having an accelerated gfx driver would be really cool), so.. that's it :)
 

Thanks_Meter

Member
Feb 1, 2013
44
6
Hi,

The OP here. Didn't know so many people were interested in this exercise :)

In any case - I prepared a new image - this time based on upcoming Ubuntu Xenial (16.04LTS). As previously, available here - goo.gl / sl6rMu

The Xorg driver seems a bit more stable, and doesn't disconnect HDMI after some minutes. I also added restart of LXDE after initial boot, so you should see the LXDE login screen most of the times now (previously, it was very random, probably due to HDMI subsystem code). The image itself is also <2G, so it fits on 2G cards (but, there's only ~300MB free space left).

I skimmed through this thread, and it seems that people are trying to work more on this problem, including compiling the kernel. This seems to be solved now (in some other thread), but out of curiosity I tried to compile the newest available kernel from the nvidia's git, and even if it had compiled (btw, it requires a lot of manual patching), it doesn't work well: the HDMI constantly reports plugged/unplugged events, and the CPU voltage regulator goes crazy. So, the kernel in nvidia_boot.img is pretty much the same.

If you have any question of requests, please feel free to post it here, and I'll check the thread today and tomorrow, but I'm not sure how I could help you more at this point. I'm too lazy to work on dual boots, and other such shiny features, and I'm not really interested in CUDA (although having an accelerated gfx driver would be really cool), so.. that's it :)

I'm not interested in CUDA either but accelerated GPU is for me a must-have. The L4T drivers work quite nice since nvidia published them for the tx1 in November. Another interesting approach would be nouveau - even if the performance will be much worse. Nouveau for tx1 should be part of the upcomming Linux 4.4 kernel. Remember that you need the Linux compatible dtb for non Android kernels (see other thread).
 

jagger11

Member
Dec 22, 2011
12
27
I'm not interested in CUDA either but accelerated GPU is for me a must-have. The L4T drivers work quite nice since nvidia published them for the tx1 in November. Another interesting approach would be nouveau - even if the performance will be much worse. Nouveau for tx1 should be part of the upcomming Linux 4.4 kernel. Remember that you need the Linux compatible dtb for non Android kernels (see other thread).
Understood, but as far as I understand, the nvidia's rootfs is 32bit, and my specific goal was to play with 64bit user-land. I tried to boot it with vanilla kernels, but no luck so far, hence no nouveau.

BTW, I think older kernels worked better than the one from L4TX1 - both source and the pre-compiled versions. They boot for me, but HDMI doesn't work ("plugged/unplugged HDMI" repeats in dmesg - I have a 4k display), and Xorg causes kernel to crash with NULL-ptr dereference somewhere in gfx subsystem when switching VT. Also, there seems to be bug somewhere in the kernel, which locks listing /proc - all processes hang on that from time to time.

So, in short - I think nvidia's kernel for TX1 needs still a lot of work to consider it stable.
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
Understood, but as far as I understand, the nvidia's rootfs is 32bit, and my specific goal was to play with 64bit user-land. I tried to boot it with vanilla kernels, but no luck so far, hence no nouveau.

BTW, I think older kernels worked better than the one from L4TX1 - both source and the pre-compiled versions. They boot for me, but HDMI doesn't work ("plugged/unplugged HDMI" repeats in dmesg - I have a 4k display), and Xorg causes kernel to crash with NULL-ptr dereference somewhere in gfx subsystem when switching VT. Also, there seems to be bug somewhere in the kernel, which locks listing /proc - all processes hang on that from time to time.

So, in short - I think nvidia's kernel for TX1 needs still a lot of work to consider it stable.
Glad to see you again. I'm the OP of the other thread for building kernel from source. It took me and others many trial and error to find the combination of kernel from CM source and L4T rootfs is most stable. I believe everything works including Cuda except BT is not enabled. Nvidia has promised to have 64bit L4T rootfs with many improvements this month.

I was wondering how did you have Linux work for Shield TV in the first place, e.g., how did you come out the kernel configuration files and the init.c file.

I'll try your latest configuration file to build kernel. It appears you are using Linux kernel source tree, but I can only have kernel working with modified Android kernel source tree (CM1.21) with your original configuration file.

I could not have L4T kernel source compiled using your original configuration file, there were too many errors.

I just checked, it seems the kernel configuration file has not changed.
 
Last edited:

jagger11

Member
Dec 22, 2011
12
27
I was wondering how did you have Linux work for Shield TV in the first place, e.g., how did you come out the kernel configuration files and the init.c file.
IIRC I installed TWRP, used adb, dumped /proc/config, downloaded kernel sources from that time from nv-repo...., and compiled it. I think that over time nvidia was changing the kernel sources, and the problems started to mount (unresolved symbols, problems with CROSS32 etc.) over time. I can see that now when compiling newer sources.

I created init.c mostly blindly, i.e. using __NR_reboot syscall to indicate that some other syscall succeeded or not - in the absence of any other feedback that was my best chance :). Then I had to modify it a bit to make it usable (DEVTMPFS, android paranoid security). Once I got shell it was easy.
 
  • Like
Reactions: yahoo2016

yahoo2016

Senior Member
Nov 24, 2015
392
88
IIRC I installed TWRP, used adb, dumped /proc/config, downloaded kernel sources from that time from nv-repo...., and compiled it. I think that over time nvidia was changing the kernel sources, and the problems started to mount (unresolved symbols, problems with CROSS32 etc.) over time. I can see that now when compiling newer sources.

I created init.c mostly blindly, i.e. using __NR_reboot syscall to indicate that some other syscall succeeded or not - in the absence of any other feedback that was my best chance :). Then I had to modify it a bit to make it usable (DEVTMPFS, android paranoid security). Once I got shell it was easy.
Thanks. That's important hint to dump "/proc/config". I found I had to used some files from Shield TV, e.g., the WIFI firmware files.

The latest posts by deerish and Thanks-Meter from the other thread indicate when kernel source was from Linux (L4T), dtb partition has to be replaced with dtb from L4T. Is this a Linux/Android issue or version issue?

Is it true that, you don't need to replace stock dtb when using kernel from old Linux kernel source?
 
Last edited:

jagger11

Member
Dec 22, 2011
12
27
Is it true that, you don't need to replace stock dtb when using kernel from old Linux kernel source?
I just checked and it's somewhat random. Some kernels will work with any dtb (e.g. from the current nv repo, or the prebuilt one from L4T), some with original dbt only (early Android kernel, similar to TWRP's).

PS. I just YOLO and uploaded incorrect DTB from L4T, and my shield tv is bricked. Was fun though :).
 
  • Like
Reactions: yahoo2016

yahoo2016

Senior Member
Nov 24, 2015
392
88
I just checked and it's somewhat random. Some kernels will work with any dtb (e.g. from the current nv repo, or the prebuilt one from L4T), some with original dbt only (early Android kernel, similar to TWRP's).

PS. I just YOLO and uploaded incorrect DTB from L4T, and my shield tv is bricked. Was fun though :).
It's good to know the randomness of kernel/dtb combinations.

What ROM version do you have? ROM 2.1 bootloader is time bomb can be triggered by many events.

Do you still have Nvidia logo? If yes, it may be recoverable by tapping power buttons as posted by Thanks-Meter in the link below:

http://forum.xda-developers.com/showpost.php?p=64723006&postcount=85
 
Last edited:

Thanks_Meter

Member
Feb 1, 2013
44
6
Do you still have Nvidia logo? If yes, it may be recoverable by tapping power buttons as posted by Thanks-Meter.

Don't get me wrong: I don't have experience with wrong dtbs. I just made the experience that if holding the power button does not work then tapping can be a solution.

I can verify that tegra210-foster-e-p2530-0930-e02-00.dtb which is 231260 bytes and which has sha256 7738251d3d5ce0e46377bc5709baea706e1c5bf99ee648df5ebc181197baccfe will work with standard Linux kernels (but not with Android kernels) and will not brick your shield tv - don't use anything else!
 
Last edited:

crnkoj

Senior Member
Feb 16, 2011
1,835
397
we really need to get u-boot on it working, than we can use it as a second/third stage bootloader and we can load whichever dtp, kernel we want and have rootfs on usb without issues....
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
we really need to get u-boot on it working, than we can use it as a second/third stage bootloader and we can load whichever dtp, kernel we want and have rootfs on usb without issues....
I agree. I have thought of putting u-boot in Boot partition and put kernel/rootfs/dtb on SD or USB drive.

I have built u-boot's for Jetson TK1 and TX1 and tested on TK1. The problem is none has figured out how to add serial console port for SATV (Shield Android TV) and it's difficult to test u-boot without console logs.

I have read netconsole and OTG console for some ARM processors, but u-boot's for Jetson TK1 and TX do not have netconsole or OTG console implemented.
 

dieter.reuter

Member
Aug 3, 2015
13
1
I agree. I have thought of putting u-boot in Boot partition and put kernel/rootfs/dtb on SD or USB drive.

I have built u-boot's for Jetson TK1 and TX1 and tested on TK1. The problem is none has figured out how to add serial console port for SATV (Shield Android TV) and it's difficult to test u-boot without console logs.

I have read netconsole and OTG console for some ARM processors, but u-boot's for Jetson TK1 and TX do not have netconsole or OTG console implemented.

u-boot would be really great. Maybe anybody can find out, if there are the UART pins available on the mainboard. I've just opened my Shield months ago, but wasn't able to see any UART pins. But I guess, it could be there - one have to dismount the mainboard, maybe the UART pins are hidden below...:fingers-crossed:
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 16
    Hi,

    It's available here (sorry, I'm not allowed to post links):

    goo.gl / sl6rMu (you only need nvidia-shield-tv-utopic.arm64.img.2G.gz and nvidia_boot.img, the remaining files are used for development)

    OS: Ubuntu Core Utopic ARM64
    Packets: typical: sshd plus LXDE

    How to:
    1. root/unlock your nvidia shield tv
    2. unpack the disk image: nvidia-shield-tv-utopic.arm64.img.2G.gz (zcat nvidia-shield-tv-utopic.arm64.img.2G.gz >nvidia-shield-tv-utopic.arm64.img.2G)
    3. save it to a microsd card (min ~2.5GB): dd if=nvidia-shield-tv-utopic.arm64.img.2G of=/dev/sdh bs=4194304 oflag=sync
    4. Put your minisd card into nvidia shield tv
    5 Boot into linux
    a). (in bootloader) fastboot boot nvidia_boot.img
    or
    b). save it permanently as a recovery image (fastboot flash recovery nvidia_boot.img) and boot into it (3 sec tap during shield tv boot, then choose 'boot recovery kernel')

    user: android pass: changeme
    user: root pass: changeme

    What works:
    - eth card
    - usb hub
    - wifi (probably, firmware is there and the card is able to scan networks)
    - virtual terminal / framebuffer (you should be able to log in with an usb keyboard)

    What doesn't work:
    - bluetooth (probably, I haven't tested it)
    - sometimes xorg doesn't display anything after boot, and it's necessary to restart lxdm: stop lxdm; start lxdm
    - accelerated gfx driver (nvidia hasn't released aarch64 drviers yet)

    There are also scripts and the kernel config I used to build the boot image on the drive
    5
    I unfortunately won't have time to try this until later next week, so I want to ask a quick question. What kernel is this? Mainline or a modified Nvidia? I tinkered with a Fedora kernel a little while back and couldn't get it to boot.

    It's a compiled kernel from nvidia's repo

    nv-tegra.nvidia.com / gitweb / ?p=linux-3.10.git;a=summary

    The config is here: nvidia_shield_tv_root -> kernel_config -> 3.10.config-foster_e.txt

    From what I remember the changes (to the stock config) were not extensive, things like disabling "Android paranoid sockets", enabling "Mount devtmpfs at boot", adding some features like namespaces
    2
    Looking for a little more help on building the kernel. I am having problems with the usb 3.0 getting deadlock and want to turn on more kernel info to find the problem. I cloned the git repo you mentioned and then checked out the branch rel-22r2-golden-fostermp. I used your config and your ubuntu image on the shield tv to compile the kernel and then made a boot img with your Makefile. However, the kernel will not boot. Is there another step I am missing? Everything looks like it should work but does not. I only have limited debug because my img only makes the nvidia logo flash on the screen.
    IIRC you need to use arch/arm64/boot/Image and not arch/arm64/boot/zImage - i.e. the one which is 15-20MB in size. The naming of zImage in the makefile is confusing.

    One more thing, the initrd doesn't need to include the kernel, you can safely remove the kernel from the dir, which is used as root for initramfs, my mistake to put it there.
    1
    I unfortunately won't have time to try this until later next week, so I want to ask a quick question. What kernel is this? Mainline or a modified Nvidia? I tinkered with a Fedora kernel a little while back and couldn't get it to boot.

    In any case, next week I need to dive back into getting multirom working here, things like this is what I need it for.
    1
    First link is missing img for step 2, second link has img but cannot be downloaded due to it not being a public file.
    Thanks, I fixed the goo.gl link

    Files should be 'downloadable' now.

    BTW, you only need nvidia-shield-tv-utopic.arm64.img.2G.gz and nvidia_boot.img - the remaining files are used for development