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

Search This thread

praveenonwww

Member
Feb 26, 2016
10
2
Is it possible to downgrade SATV Pro 500GB (2015) from 5.x firmware to 3.x?
I have SATV Pro 500GB (2015) and SATV 16GB ( 2017) with 5.x firmware, I tried using the boot provided in first thread for SATV 16GB ( 2017) with 5.x, it just shown the ubuntu UI but after that it disappear.

Is there any boot image available for 5.x firmware or is there any way to downgrade these devices to 3.x firmware. Thanks
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
Is it possible to downgrade SATV Pro 500GB (2015) from 5.x firmware to 3.x?
I have SATV Pro 500GB (2015) and SATV 16GB ( 2017) with 5.x firmware, I tried using the boot provided in first thread for SATV 16GB ( 2017) with 5.x, it just shown the ubuntu UI but after that it disappear.

Is there any boot image available for 5.x firmware or is there any way to downgrade these devices to 3.x firmware. Thanks
If you have SATV Pro, you should back up your HDD first following this link:
https://xdaforums.com/shield-tv/general/guide-migrate-to-ssd-hdd-size-satv-pro-t3440195

Then you can try down grade using ROM 3.x images from the following link:

https://developer.nvidia.com/shield-developer-os-images

According to the following thread, SATV Pro can always be unbricked:
https://xdaforums.com/shi...v-ssd-t3402580
And link to SHDD image of SATV Pro 2015:
https://xdaforums.com/sho...2&postcount=23
 
  • Like
Reactions: praveenonwww

abdul.malek

Member
Apr 2, 2017
9
0
This is pretty awesome. I own a Shield Pro 2017 edition and now I've copied the filesystem to a Samsung UHS-grade sdcard, placed it into the internal sdcard slot and booted the Shield with your "mmcblk0p1.img" boot image and the system runs Ubuntu soo smooth. Thought "Full Android" was the way to use the Shield, but this is might end up as my prime OS! :good::good::good:

Question, are you also not seeing the internal mmc when you run lsblk on the pro 2017 or do i have something weird going on?
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
Does it work with the last Shield TV 2017 ?
I don't have SATV 2017, I'd recommend SATV 2017 Pro which will not brick if you clone the HDD and keep the original HDD.
With HDD backup, you could try downgrade to ROM 3.x and use the images from the OP.

Downgrading SATV 1027 16 GB could brick it. If you brick one SATV 16 GB, it'd be more expensive than SATV Pro.
 

Afeld88

Member
Apr 28, 2016
9
0
Hello yahoo2016, thank you for your work, First off I was wondering if there is any way to get to a command line from the login screen for ubuntu, had been working fine for weeks as my primary os, flashed to the user data partition of my 2015 emmc 16gb, however a couple of days ago , trying to login to ubuntu gives me failed to start session message in red under the password dialog box, ctrl+alt+f1 only puts shield tv to sleep instead of opening a command line, so I cannot reinstall a broken ubuntu desktop, I have tried several times to enter HW recovery mode with usb plugged into pc as well as otg cable, is there anyway to get a cli or recovery mode via my Linux pc thru an ssh?
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
Hello yahoo2016, thank you for your work, First off I was wondering if there is any way to get to a command line from the login screen for ubuntu, had been working fine for weeks as my primary os, flashed to the user data partition of my 2015 emmc 16gb, however a couple of days ago , trying to login to ubuntu gives me failed to start session message in red under the password dialog box, ctrl+alt+f1 only puts shield tv to sleep instead of opening a command line, so I cannot reinstall a broken ubuntu desktop, I have tried several times to enter HW recovery mode with usb plugged into pc as well as otg cable, is there anyway to get a cli or recovery mode via my Linux pc thru an ssh?
You should be able to connect SATV to a PC/laptop using a micro USB to USB cable and hold power button while plug in power until SATV enter recovery mode.
 

Afeld88

Member
Apr 28, 2016
9
0
Hello yahoo thanks for the quick reply , I have tried that method multiple times, however it just boots up into Linux, however a couple of tries it will briefly show the nvidia splash screen for a split second as if it's trying to enter recovery but continues with boot up to Linux, however when I try to switch from ubuntu username to kodi desktop environment with same password I can boot into kodi, perhaps you have some insight ? Maybe recovery mode is taking longer or Linux has suppressed it? Or maybe there is a way to get to terminal from kodi?
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
Hello yahoo thanks for the quick reply , I have tried that method multiple times, however it just boots up into Linux, however a couple of tries it will briefly show the nvidia splash screen for a split second as if it's trying to enter recovery but continues with boot up to Linux, however when I try to switch from ubuntu username to kodi desktop environment with same password I can boot into kodi, perhaps you have some insight ? Maybe recovery mode is taking longer or Linux has suppressed it? Or maybe there is a way to get to terminal from kodi?
What was your ROM version when you flashed Ubuntu? ROM 3.x should be able to boot to recovery mode reliably using the above method. I did not update my SATVs to 5.x and wasn't aware behavior of ROM 5.x.

It's important to make sure recovery mode always works, otherwise SATV could be bricked.

I have not installed Kodi on SATV. There are ways to add serial console port to SATV by soldering thin wires to some pads. If you want to try it, the photos and instructions should be in this thread or maybe another threads.
 

Afeld88

Member
Apr 28, 2016
9
0
Yes I was on the upgraded rom to 5.x on a 2015 16gb shield, I had made sure that recovery mode worked and was able to get into it after I installed ubuntu, the whole Linux install is fine and didn't cause any issue this came about out of the blue , kodi had worked prior on ubuntu and still works , I even try to switch to the account named nvidia and I also get failed to start session , but Can boot into kodi from ubuntu login , since I can get into kodi and my boot log is not showing any errors there should be a water me to get to a terminal or task manager to reinstall my ubuntu desktop.is there a way to ssh into a system and command it from my pc?
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
Yes I was on the upgraded rom to 5.x on a 2015 16gb shield, I had made sure that recovery mode worked and was able to get into it after I installed ubuntu, the whole Linux install is fine and didn't cause any issue this came about out of the blue , kodi had worked prior on ubuntu and still works , I even try to switch to the account named nvidia and I also get failed to start session , but Can boot into kodi from ubuntu login , since I can get into kodi and my boot log is not showing any errors there should be a water me to get to a terminal or task manager to reinstall my ubuntu desktop.is there a way to ssh into a system and command it from my pc?
I consider recovery mode non-working a bug of boot loader. Nvidia screwed up boot loader for ROM version 2.x and caused many bricked SATVs. Nvidia was kind enough to replace my bricked SATV 16GB.

Nvidia seems fixed boot loader bug for ROM version 3.x, but introduced new bug on ROM5.x which couldn't be fixed by downgrading to 3.x.

I recommend contact Nvidia from the following link for boot loader recovery mode bug:

http://www.nvidia.com/object/support.html

It may be a known bug.
 

xkrys

Member
Sep 30, 2015
6
0
I don't have SATV 2017, I'd recommend SATV 2017 Pro which will not brick if you clone the HDD and keep the original HDD.
With HDD backup, you could try downgrade to ROM 3.x and use the images from the OP.

Downgrading SATV 1027 16 GB could brick it. If you brick one SATV 16 GB, it'd be more expensive than SATV Pro.

Actually I already got a SATV 16GB 2017 with a 5.x rom.

As of now I did the following:

- unpack L4T rootfs from https://developer.nvidia.com/embedded/dlc/l4t-sample-root-filesystem-24-2-1
- apply binaries
- copy rootfs (cp -a) to a ext4 usb stick
- unlock the shield bootloader
- flash the corresponding dtb from L4T
- enter bootloader with shield controller
- unplug the controller and plug the usb stick instead (usb port near HDMI)
- do a "fastboot boot" with the sda1.img from the OP

No success so far...

I'm stuck on NVIDIA logo. I guess that's because the images from the OP is for 3.x ROM

Any idea what to do from there ?
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
Actually I already got a SATV 16GB 2017 with a 5.x rom.

As of now I did the following:

- unpack L4T rootfs from https://developer.nvidia.com/embedded/dlc/l4t-sample-root-filesystem-24-2-1
- apply binaries
- copy rootfs (cp -a) to a ext4 usb stick
- unlock the shield bootloader
- flash the corresponding dtb from L4T
- enter bootloader with shield controller
- unplug the controller and plug the usb stick instead (usb port near HDMI)
- do a "fastboot boot" with the sda1.img from the OP

No success so far...

I'm stuck on NVIDIA logo. I guess that's because the images from the OP is for 3.x ROM

Any idea what to do from there ?
Can you still boot to recovery mode? From what I read, I believe other users can only boot to Ubuntu after downgrading to ROM 3.x. But downgrading ROM could cause other issues, such as recovery mode not working. I can try to upgrade my SATV 2015 Pro to ROM 5.x and install Ubuntu when I find some time.

I tried but was not able to upgrade my SATV 2015 Pro to ROM 5.1. After downloading 5.1, install, restart, it came back as 3.3. I believe update failed because I have cloned 250GB SSD instead of original 500GB SHDD.
 
Last edited:

xkrys

Member
Sep 30, 2015
6
0
Can you still boot to recovery mode? From what I read, I believe other users can only boot to Ubuntu after downgrading to ROM 3.x. But downgrading ROM could cause other issues, such as recovery mode not working. I can try to upgrade my SATV 2015 Pro to ROM 5.x and install Ubuntu when I find some time.

I tried but was not able to upgrade my SATV 2015 Pro to ROM 5.1. After downloading 5.1, install, restart, it came back as 3.3. I believe update failed because I have cloned 250GB SSD instead of original 500GB SHDD.

Yes I can go to recovery mode and after few seconds I got a screen with an opened android robot, a warning icon, and a "No command" message.

---------- Post added at 01:57 PM ---------- Previous post was at 01:46 PM ----------

Hello, I have been playing around with the SATV 2017 for a while now and I've managed to run Ubuntu from the SDcard using a USB to SD adapter, but I want to run linux natively from the emmc. For the 2015 model I believe all it took was copying the contents of the sdcard to mmcblk0p29 and then using fastboot to flash the appropriate image file, however the 2017 model won't mount this partition. Its listed in the \dev directory but I'm not really sure what to do next, can I format the mmcblk0p29 partition or is there a different set of instructions to make linux native on the 2017 SATV?

You were successful booting ubuntu from a SATV 2017 5.x ? 16GB or Pro ?
Did you use the files from the OP ?
 

Afeld88

Member
Apr 28, 2016
9
0
Okay , update. I have yet to contact nvidia, still haven't gotten into recovery mode but I after attempting to login to console with Ctrl alt f1 I was able to reboot and login via terminal console and have apt -f install and removed kodi and auto removed all other unused packages, however attempting to remove and install ubuntu desktop I am running into issues because this is a custom l4t ubuntu release and not regular ubuntu so the packages/versions shield needs are not the standard commands , so I am trying to install all of the unmet dependencies and also having the same issue of not being able to rebuild the desktop/session/nautilus etc... since the console terminal is available to me is there anything you could suggest ? Is it possible to write the rooted to a sd cars from my ubuntu pc and place in shield and use terminal to copy it from ad to internal again?
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
Okay , update. I have yet to contact nvidia, still haven't gotten into recovery mode but I after attempting to login to console with Ctrl alt f1 I was able to reboot and login via terminal console and have apt -f install and removed kodi and auto removed all other unused packages, however attempting to remove and install ubuntu desktop I am running into issues because this is a custom l4t ubuntu release and not regular ubuntu so the packages/versions shield needs are not the standard commands , so I am trying to install all of the unmet dependencies and also having the same issue of not being able to rebuild the desktop/session/nautilus etc... since the console terminal is available to me is there anything you could suggest ? Is it possible to write the rooted to a sd cars from my ubuntu pc and place in shield and use terminal to copy it from ad to internal again?
You could decompress L4T rootfs to SD card, apply binaries to it and use the same "cp -a && sync" command to copy rootfs from SD card to user data partition (you may need to format user data partition first), but if something goes wrong and you do not have recovery mode working, your SATV could be bricked.
 

Afeld88

Member
Apr 28, 2016
9
0
As of now I don't have access to recovery, I believe bootloader bug for ROM 5.1 for satv 2015 16gb is to blame, at this point I consider the shield a brick anyway , rebuilding custom aarch64 Linux packages is quite a task, however thinking now I may not be able to cp -a to userdata since I have it already mounted as rootfs , will give it a shot later and keep the group posted.
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
As of now I don't have access to recovery, I believe bootloader bug for ROM 5.1 for satv 2015 16gb is to blame, at this point I consider the shield a brick anyway , rebuilding custom aarch64 Linux packages is quite a task, however thinking now I may not be able to cp -a to userdata since I have it already mounted as rootfs , will give it a shot later and keep the group posted.
When you downgraded ROM to 3.x did you use Developer ROMs from the link below?
https://developer.nvidia.com/shield-developer-os-images
 

Afeld88

Member
Apr 28, 2016
9
0
update, good news and false alarms, boot loader was accessible after many more tries than usual in different manners, I came to see it was my choice of cord for some reason , I am reinstalling and moving forward , again,the info is a successful installation with a 2015 16gb shield tv with latest firmware 5.1 boot loader working
 

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.