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

Search This thread

ithuestad

Member
Oct 12, 2010
7
1
I've been running ubuntu off an SDcard on the 2017 SATV 16gb model but would like to move to the local emmc drive. The user partition appears to be mmcblk0p33 (is this correct?) and if so I don't think there is an image file provided that will run the OS off this partition (assuming this is the route to running Ubuntu natively). Is there a resource where I can find a built image file for this partition, or will I have to make one (i've never made one before so I'm not sure what I would be getting myself into)?
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
I've been running ubuntu off an SDcard on the 2017 SATV 16gb model but would like to move to the local emmc drive. The user partition appears to be mmcblk0p33 (is this correct?) and if so I don't think there is an image file provided that will run the OS off this partition (assuming this is the route to running Ubuntu natively). Is there a resource where I can find a built image file for this partition, or will I have to make one (i've never made one before so I'm not sure what I would be getting myself into)?
I can make an image for mmcblk0p33 tomorrow.
 
  • Like
Reactions: ithuestad

yahoo2016

Senior Member
Nov 24, 2015
392
88
I've been running ubuntu off an SDcard on the 2017 SATV 16gb model but would like to move to the local emmc drive. The user partition appears to be mmcblk0p33 (is this correct?) and if so I don't think there is an image file provided that will run the OS off this partition (assuming this is the route to running Ubuntu natively). Is there a resource where I can find a built image file for this partition, or will I have to make one (i've never made one before so I'm not sure what I would be getting myself into)?

mmcblk0p33.img can be download from here:
https://drive.google.com/file/d/0Bz5kaPQJx_AgNldIcWxtMXVJS2M/view?usp=sharing

Please try it use "sudo fastboot boot mmcblk0p33.img"
 
Last edited:
  • Like
Reactions: sidthegreatest

xkrys

Member
Sep 30, 2015
6
0
I've been running ubuntu off an SDcard on the 2017 SATV 16gb model but would like to move to the local emmc drive. The user partition appears to be mmcblk0p33 (is this correct?) and if so I don't think there is an image file provided that will run the OS off this partition (assuming this is the route to running Ubuntu natively). Is there a resource where I can find a built image file for this partition, or will I have to make one (i've never made one before so I'm not sure what I would be getting myself into)?

Could explain how did you achieved to boot off an SD Card please ?
I'm also trying to flash L4T on eMMC but I'm wondering how ? Did you successed ?
 

ithuestad

Member
Oct 12, 2010
7
1
mmcblk0p33.img can be download from here:
https://drive.google.com/file/d/0Bz5kaPQJx_AgNldIcWxtMXVJS2M/view?usp=sharing

Please try it use "sudo fastboot boot mmcblk0p33.img"

Thank You. It took me a while, but I could only get the image to properly work for L4T 24.2.0
L4T 24.2.1 worked initially, but wouldn't boot after update/upgrade.
I now have a gen 2 shield booting into ubuntu successfully and running code.
thanks again.

---------- Post added at 12:00 PM ---------- Previous post was at 11:48 AM ----------

Could explain how did you achieved to boot off an SD Card please ?
I'm also trying to flash L4T on eMMC but I'm wondering how ? Did you succeed ?

Hi, there are some great resources in this thread that go through unlocking the bootloader for the shield, using ADB/fastboot, and preparing the L4T sdcard. If you're just getting started I would suggest looking into unlocking the bootloader first. The instructions up to step 3 part 6 in the link ( http://nvidiashieldzone.com/shield-...rial-root-shield-android-tv-2017-16gb-nougat/ ) helped me out immensly before I discovered this forum.
 
  • Like
Reactions: yahoo2016

chtulu

Member
Jul 18, 2017
41
1
mmcblk0p29.img" is for booting to rootfs on partition 29

Hi,

The first page says: "mmcblk0p29.img" is for booting to rootfs on partition 29 (User Data) of internal eMMC of 16GB SATV if only Ubuntu is needed.

What does it mean "if only Ubuntu is needed"?

Can all the other 32 partitions be deleted?

Has the mmcblk0p33.img image made for R24.2.1?

Does the image need to be made for each Linux for Tegra version and why?

What change need to be made for each new version?

Also please note that the user data partition on the shield TV 2017 is mmcblk0p33.img.

Thanks.
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
Hi,

The first page says: "mmcblk0p29.img" is for booting to rootfs on partition 29 (User Data) of internal eMMC of 16GB SATV if only Ubuntu is needed.

(1). What does it mean "if only Ubuntu is needed"?

(2). Can all the other 32 partitions be deleted?

(3). Has the mmcblk0p33.img image made for R24.2.1?

(4). Does the image need to be made for each Linux for Tegra version and why?

(5). What change need to be made for each new version?

Also please note that the user data partition on the shield TV 2017 is mmcblk0p33.img.

Thanks.
(1). If "User Data" partition is overwritten, you won't be able to use Android.
(2). Other partitions are small, SATV can be bricked if some other partitions are deleted.
(3). https://xdaforums.com/showpost.php?p=72587978&postcount=523.
(4). Versions of L4T rootfs must match kernel Image.
(5). To use L4T for SATV, kernel configuration file need to be changed to build kernel for SATV.
 
Last edited:

chtulu

Member
Jul 18, 2017
41
1
(1). If "User Data" partition is overwritten, you won't be able to use Android.
(2). Other partitions are small, SATV can be bricked if some other partitions are deleted.
(3). https://xdaforums.com/showpost.php?p=72587978&postcount=523.
(4). Versions of L4T rootfs must match kernel Image.
(5). To use L4T for SATV, kernel configuration file need to be changed to build kernel for SATV.

Hi,

Thank you very much indeed. So, as far as I understood, the mmcblk0p33.img image, contains the drivers and L4T FileSystem. Is that correct?

Is there any way to just use the eMMC for Linux? 16GB is not much and I would need as much space as possible.

Thanks
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
Hi,

Thank you very much indeed. So, as far as I understood, the mmcblk0p33.img image, contains the drivers and L4T FileSystem. Is that correct?

Is there any way to just use the eMMC for Linux? 16GB is not much and I would need as much space as possible.

Thanks
All images are kernel only which will boot to rootfs on different devices/partitions.
You need to download L4T rootfs from Nvidia and copy it to different devices/partitions as mentioned in the 1st post.
The User Data partition of 16GB SATV is at least 12GB. If 12GB is not enough, you'd need to use external storage such as SD card/USB drive.
I recommend use SATV Pro for Linux development.
 

LM209

Senior Member
Mar 6, 2016
139
21
In Germany!
Hello, does anyone have maybe an image for the Shield 2015 16Gb variant and how to do the correct flash on the memory?
Would be very nice
 

chtulu

Member
Jul 18, 2017
41
1
how to compile the kernel

Hi,
yahoo2016, thank you very much for all the answers.

Could you please let me know how to compiler the kernel and make the boot.img?

Is it ok to use source_release.tbz2 for the source?

Once you got the zImage, how do you get the bootimg.cfg and ramdisk?

Thanks.
 
Last edited:

chtulu

Member
Jul 18, 2017
41
1
how to compile the kernel

Hi,
Well, I finally found the missing link in your first post, to initrd's tar.

Were do I get from, the values for bootimg.cfg, once I modified the init.c file?

"L4T24.2 dtb from L4T24.2 rootfs "/boot" needs to be flashed".

My dtb is: tegra210-darcy-p2894-0050-a04-00.dtb, but I can not find it in the /boot folder of the rootfs. I have three tegra210-jetson...... files there.

thanks.
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
Last edited:

chtulu

Member
Jul 18, 2017
41
1
Hi,
Thanks again.

I'm trying l4t 28.1, so I guess there is no hope for the latest kernel, since there is no dtb.

As for the initrd, I noticed that you have twice the some usb firmware, one in lib/firmware and another in etc/firmware. Is that any reason why? Should it be only in lib/firmware?

Also, in init.c, why /dev is mounted twice? One in /dev/ and one in /dest/dev?

Thanks
 
Last edited:

crnkoj

Senior Member
Feb 16, 2011
1,841
397
The offsets in init.c were from this thread:
https://xdaforums.com/shield-tv/general/ubuntu-utopic-nvidia-shield-tv-t3150352

I only changed rootfs partitions.

Later versions (27.x and 28.x) of L4T may have removed the other dtbs, L4T24.2.x should have dozens of dtbs including dtbs for SATV ("foster") in rootfs/boot after run "apply_binaries.sh".
Also there should be "foster" dtb in "Linux_for_Tegra/kernel/dtb", see link:
https://xdaforums.com/showpost.php?p=64722818&postcount=84
Is it not so that we can compile the dtb while compiling the kernel?
 

demotomohiro

Member
Jan 21, 2016
7
7
Is it not so that we can compile the dtb while compiling the kernel?

I can find /arch/arm64/boot/dts/tegra210-foster-e-*.dts files in linux-3.10 which is the kernel used in L4T R24.2.1.
http://nv-tegra.nvidia.com/gitweb/?p=linux-3.10.git;a=tree;h=6132d7a86f3e38e77848bbf59280d10f0e19bfff;hb=4206e3f9c9b3a1757c36bb798ca751c09e2db8c5

In linux-4.4.git, dts files are moved to other repository.
dts files for Jetson TX1 were moved to:
http://nv-tegra.nvidia.com/gitweb/?p=device/hardware/nvidia/platform/t210/jetson.git;a=tree;h=refs/heads/l4t/l4t-r28.1;hb=l4t/l4t-r28.1
And following repositories have dtsi files.
[device/hardware/nvidia/platform/tegra/common.git]
[device/hardware/nvidia/soc/t210.git]
[device/hardware/nvidia/platform/t210/common.git]

I cannot find tegra210-foster-*.dts files in their repository.
This dtsi file looks like related to Shield.
[device/hardware/nvidia/soc/t210.git]/kernel-dts/tegra210-soc/tegra210-soc-shield.dtsi

If there is no dts files for Shield and dtb files in prevous l4t are not compatible to linux-4.4, there is no way to use l4t 28.1 in Shield?
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
I can find /arch/arm64/boot/dts/tegra210-foster-e-*.dts files in linux-3.10 which is the kernel used in L4T R24.2.1.
http://nv-tegra.nvidia.com/gitweb/?p=linux-3.10.git;a=tree;h=6132d7a86f3e38e77848bbf59280d10f0e19bfff;hb=4206e3f9c9b3a1757c36bb798ca751c09e2db8c5

In linux-4.4.git, dts files are moved to other repository.
dts files for Jetson TX1 were moved to:
http://nv-tegra.nvidia.com/gitweb/?p=device/hardware/nvidia/platform/t210/jetson.git;a=tree;h=refs/heads/l4t/l4t-r28.1;hb=l4t/l4t-r28.1
And following repositories have dtsi files.
[device/hardware/nvidia/platform/tegra/common.git]
[device/hardware/nvidia/soc/t210.git]
[device/hardware/nvidia/platform/t210/common.git]

I cannot find tegra210-foster-*.dts files in their repository.
This dtsi file looks like related to Shield.
[device/hardware/nvidia/soc/t210.git]/kernel-dts/tegra210-soc/tegra210-soc-shield.dtsi

If there is no dts files for Shield and dtb files in prevous l4t are not compatible to linux-4.4, there is no way to use l4t 28.1 in Shield?
There are ways to use L4T28.1 for SATV, e.g., comparing dtsi in L4T24.2.1 for SATV and Jetson TX1 and use the differences to modify dtsi in L4T28.1 for Jetson TX1 or compile and try the "tegra210-soc-shield.dtsi".

Since replacing dtb could brick SATV 16GBs, I'd recommend back up HDD of SATV Pro and try new kernel and dtb on SATV Pro.
 

chtulu

Member
Jul 18, 2017
41
1
Well, I guess that the dtb is only needed for the old shield tv. The sda1 boot.img 28.2 works fine on mine shield tv 2017, using fastboot boot boot.img and I did not flash the dtb file, but I must have made a mistake and now I got a bootloop for android.
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
Well, I guess that the dtb is only needed for the old shield tv. The sda1 boot.img 28.2 works fine on mine shield tv 2017, using fastboot boot boot.img and I did not flash the dtb file, but I must have made a mistake and now I got a bootloop for android.
Did you make sda1 boot.img 28.2 from L4T 28.x source?
I do not have SATV 2017, but as you described, dtb of SATV 2017 may be compatible with L4T 28.x.
 

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://xdaforums.com/showpost.php?p=69202451&postcount=421

    or internal eMMC or HDD (of SATV Pro):
    http://xdaforums.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://xdaforums.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://xdaforums.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.