Build kernel from source and boot to Ubuntu using L4T (Linux for Tegra) rootfs

Search This thread

wejgomi

Senior Member
Dec 22, 2011
141
89
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.

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..
 

zigguratt

Member
Jan 10, 2007
9
1
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.
 

Mogster2K

Senior Member
Jun 25, 2011
381
79
Moto G 5G
OnePlus 9 Pro
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.

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.
 
  • Like
Reactions: zigguratt

zigguratt

Member
Jan 10, 2007
9
1
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.

Thank you, @Mogster2K. 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, @Mogster2K.
 

crnkoj

Senior Member
Feb 16, 2011
1,835
397
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
 

guertler

Member
Sep 16, 2017
5
0
Hi
  1. 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?
  2. Do you know about any other Linux distributions supporting Nvidia Shield TV (e.g. postmarketos)?
  3. 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
 

guertler

Member
Sep 16, 2017
5
0
Hi
  1. 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?
  2. Do you know about any other Linux distributions supporting Nvidia Shield TV (e.g. postmarketos)?
  3. 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
 

Top Liked Posts

  • There are no posts matching your filters.
  • 18
    Update (08/26/2017) Update:

    I updated my SATV Pro 2015 to ROM 5.x, I did not have to replace dtb file. The img files from link below seem still working.


    The following have been tested for SATV ROM 3.x.

    Latest boot images based on L4T24.2 for external SD card, USB drive, internal EMMC and internal HDD can be downloaded from:
    https://drive.google.com/file/d/0Bz5kaPQJx_AgZ3lvWWZFNmJFcmM/view?usp=sharing

    Where,
    "mmcblk1p1.img" is for booting to rootfs on external SD card.
    "sda1.img" is for booting to rootfs on external USB drive (or SD card in USB adapter), or internal SATA HDD of modified 16GB SATV.
    "mmcblk0p29.img" is for booting to rootfs on partition 29 (User Data) of internal eMMC of 16GB SATV if only Ubuntu is needed.
    "mmcblk0p1.img" is for boot to rootfs on partition 1 of internal eMMC of SATV Pro.
    "sda32.img" is for booting to rootfs on partition 32 (User Data) of HDD of 500GB SATV Pro if only Ubuntu is needed.
    "sda33.img" is for booting to rootfs on partition 33 of HDD of 500GB SATV Pro for Ubuntu (modification of HDD partition table is needed).
    "sda34.img" is for booting to rootfs on partition 34 of HDD of 500GB SATV Pro for Ubuntu (modification of HDD partition table is needed).


    You will need to download L4T24.2 driver package and rootfs from Nvidia (https://developer.nvidia.com/embedded/linux-tegra), apply binary drivers to rootfs and copy it to external SD card/USB drive, see this post:

    http://forum.xda-developers.com/showpost.php?p=69202451&postcount=421

    or internal eMMC or HDD (of SATV Pro):
    http://forum.xda-developers.com/showpost.php?p=69202672&postcount=422

    L4T24.2 dtb from L4T24.2 rootfs "/boot" needs to be flashed. To find dtb name for your SATV, type the following in recovery mode:
    sudo fastboot oem dtbname

    Flash the wrong dtb will likely brick the SATV!!!

    To have Wifi working, "/lib/firmware/brcm/fw_bcmdhd.bin" need to be replaced with the one from SATV (in /system/vendor/firmware/bcm4354).

    To build kernel from source, download the latest L4T kernel source, modify tegra21_defconfig by adding "CONFIG_ANDROID=y", example configuration file can be downloaded from the following link

    https://forum.xda-developers.com/showpost.php?p=69078331&postcount=417
    4
    I was able to build kernel using cm13.0 source and boot to L4T R23.1 rootfs.

    Configuration file for CM13.0, kernel image, and "boot.img" can be downloaded from the following link:

    https://drive.google.com/file/d/0Bz...0Bz5kaPQJx_AgT1ZTWGxtQzBzSW8/view?usp=sharing

    To have wifi working, the following 2 files from your SATV need to be copied to linux rootfs:

    CONFIG_BCMDHD_FW_PATH="/data/misc/wifi/firmware/fw_bcmdhd.bin"
    CONFIG_BCMDHD_NVRAM_PATH="/data/misc/wifi/firmware/nvram.txt"


    Maybe someone is interested.

    I got a functional kernel from the official resources for the shield 3.0 version.

    How to get it, see here:
    http://nv-tegra.nvidia.com/gitweb/?p=manifest/android/binary.git;a=blob_plain;f=README_SHIELD;hb=rel-24-foster-r2-partner

    You need to install 'repo' on your computer. Be careful, you get the full android sources. You need a lot
    of space.

    You can go into the kernel-subdirectory and compile a kernel (same procedure and Enviroment-Variables
    as usual).

    But you can use 'tegra21_defconfig' without corrections to get a kernel, that boots Ubuntu from L4T 23.1 or 23.2. I don't know if wifi or bluetooth is running.

    My experience is, the main thing is to find a Kernel that fits to 'tegra210-foster-e-p2530-0930-e02-00.dtb' from the new 3.0 Version, if you like to use android and linux (from recovery partition or vice versa) together.
    3
    Hello yahoo2016,

    you are right, if you use the kernel and tegra210-foster-e-p2530-0930-e02-00.dtb from L4T24.1 64bit over SATV ROM 3.1, you can successfully start the ubuntu desktop with 4k resolution But at this point android is broken. But you can switch back to SATV ROM 3.1 without a problem. That was differnt with version 2.1.

    Maybe you are interested to know this.

    One correction,

    I made a mistake. SATV ROM 3.1 works with the tegra210-foster-e-p2530-0930-e02-00.dtb from L4T24.1.

    So you can run android and ubuntu from sd-card parallel without a problem.
    2
    Thank you very much for sharing how to install L4T on Shield TV!
    I found this post and I'm using this boot.img, because I am lazy.
    http://forum.xda-developers.com/showpost.php?p=64589752&postcount=53
    It worked very well and I can run CUDA samples and develop my CUDA program on it.

    I'm using my Shield TVwith lastest update 2.1.
    I flashed linux boot.img to boot partition and boot.img in NVIDIA SHIELD ANDROID TV Recovery OS Image 2.1.0 to recovery partition.
    So I can boot both Ubuntu and Android.
    When I use ubuntu, just turn on Shield TV or reboot.
    When I use android, I boot fastboot and select "boot recovery kernel".
    This is how to get fastboot menu with update 2.1.
    1. Turn off shield
    Touch and hold about 10s in android or "sudo shutdown -h now" in ubuntu.
    2. Tap power button once to turn on. Don't keep touching.
    3. Wait for about 1 second.
    4. Touch and hold power button until you see fastboot menu.
    Shield TV need to be connect to PC with use-otg cable.
    I can get fastboot menu without unpluging power supply.
    It works in 1 or 2 tries.
    2
    I read first post in this thread, built my boot.img and flashed it to my shield TV.
    I could connect to my shield using ssh, but it couldn’t display a desktop.
    And “sudo shutdown -h now” didn’t work.
    The boot.img built by yahoo2016 can display desktop and shutdown/reboot worked fine.
    My display is “SEIKI SE39UY04” and it supports 3840x2160@30Hz mode.

    I compared shieldTv_defconfig and cyanogenmod_foster_defconfig, and I found that some framebuffer options are set in shieldTv_defconfig.
    CONFIG_FB_NVIDIA=y
    CONFIG_FB_NVIDIA_BACKLIGHT=y
    CONFIG_FB_SIMPLE=y
    They are set yes in shieldTV_defconfig, but they are not set in cyanogenmod_foster_defconfig.
    They are also not set in Jetson TK1, but it displays console message to my display before desktop screen comes.
    I remember that Gentoo wiki for x86/64 says in-kernel nvidia framebuffer driver conflicts with the nvidia binary driver.
    I don’t know wether it also true or not in arm64 CPU or Shield TV, I removed these options and rebuilt the kernel.
    But I still didn’t see desktop and shutdown deosn’t work.
    Then, I removed “CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y”, but no change.
    Then, I removed following options:
    CONFIG_DUMMY_CONSOLE=y
    CONFIG_FRAMEBUFFER_CONSOLE=y
    CONFIG_FONT_8x8=y
    CONFIG_FONT_8x16=y
    They are enabled in Jetson TK1 but I disabled them.
    It worked! I got desktop and shutdown/reboot worked from a ssh client.
    But I found a problem. When I connect display to my shield TV but don’t connect mouse and keyboard, my shield TV displays NVIDIA logo forever and I cannot connect to my shield TV from a ssh client.
    When I connect display, mouse and keyboard, I can get the desktop.
    When I disconnect both display, mouse and keyboard, I can use shield from ssh client and my console CUDA program works.
    No matter if framebuffer related options are set yes or not, I don’t see console message from my display.

    I should try more combinations of kernel options to find out which options do wrong.
    But I will do it later.
    I'm going to talk about L4T on Shield TV on Jetson meet up event in Japan next week.
    I have to make the slide which compare shield TV and jetson TX1, explains why installing linux on shield tv, and how to do it in Japanese.
    I will put link to this topic on my slide.
    I think there are many people who are interested in shield TV as linux machine in my country.