L4T Ubuntu - A fully featured linux on your switch

switchroot.png

L4T Ubuntu 3.4.0
Intro
L4T Ubuntu is a version of Linux based on nvidia's linux for tegra project. It uses a different kernel compared to previous releases which allows it to use features not yet in mainline. Such as audio, docking support and vulkan.

Beware, using high clocks in handheld mode will degrade your batteries capacity a lot faster than at stock clocks

If you can't install an application check this thread, and ask all questions there
https://gbatemp.net/threads/l4t-ubuntu-applcation-install-guides.537579/

https://discord.gg/N9PPYXjWMY

We have a wiki !
To facilitate our work we will only update our wiki from now on in order to avoid multiple outdated references, please refer to the following link instead of this page

https://wiki.switchroot.org/en/Linux/Ubuntu-Install-Guide

3.4.0 update file listed below With the 3.0+ updates. If doing fresh install, install 3.4.0 image.


Big Thanks to CTCaer for 3.4.0, for fixing the final issues in Ubuntu/Linux kernel and all the testers that helped him.

Features

  • Full USB PD/OTG/OTG Docks
  • Bluetooth (both controllers and audio)
  • Full Joycon Support(Excluding NFC, and IRcamera)
  • Nvidia GPU drivers - Vulkan and OpenGL
  • Audio - Headphones, speakers and over HDMI when docked.
  • Touchscreen(more fixes)
  • Display
  • WiFi(sleep fixes/stability fixes)
  • CPU frequency scaling - The CPU scales from 200mhz to 1.7ghz (what switch is binned for) depending on the load its under. Fans are adjusted to account for this
  • Full sdcard speed
  • Hardware video acceleration when using the built in videos app (means you can watch videos without battery draining massively)
  • Overclocking
  • LP0 Sleep mode
  • IMU/Ambiant Light sensor support
  • reboot2payload
  • Minerva Memory Training
  • Support for Moonlight-QT
  • Initramfs updates(fix partition resize, add boot logo, and error screens)
Prerequisites
  • Minimum of 8 GB.
Downloads
Torrent Links can be found here:
https://torrents.switchroot.org/ubuntu/

Updates for previous 3.0+ installs. 3.4.0 link below.

https://download.switchroot.org/ubuntu/switchroot-ubuntu-3.4.0-update_only-2021-07-23.7z
1. Remove l4t-ubuntu folder and bootloader\ini\01-ubuntu.ini from fat32 partition on sdcard.
2. Extract zip to fat32 partition on sdcard.(if you have no space, try removing all ubuntu related files from fat32 partition on sdcard, and try again.)
3. Dump joycon pairing info in hekate.(Only needs to be done if you havnt already done this)
4. Boot.

How to install:
  1. Download the image (standard non cuda is probably what you want) you want from the downloads section.
  2. Partition with hekate, make sure to leave enough room on fat32 to extract chosen image.
  3. Extract 7z to fat32 partition, now labeled SWITCHSD
  4. Flash image in partition manager in hekate to linux partition.
  5. Go to NYX tools, and dump joycon pairing data, with joycons connected to console, after being paired in hos.
  6. Launch ubuntu through hekate.
  7. Wait for around 2-4 minutes while it initially loads.
  8. Enjoy, you now have fully featured Ubuntu on your switch!
Notes:
  • Pair procons by opening the bluetooth menu in settings and pressing the + button in the bottom left corner. Then press the sync button on the controller and select its name in the pairing window.
  • To update the system run "sudo apt update", "sudo apt upgrade". This will apply all switch and ubuntu updates aside from kernel updates, they will be posted here if ever needed.
  • CPU/GPU/Fan profiles and Overclocking are now handles in NVPmodel.
  • Disabled sandboxing in Chromium in order to enable GPU acceleration
    Night and day difference. Existing users can add --no-sandbox to their desktop shortcut.
Ubuntu Bionic 3.4.0 Short Changelog:
- Better performances in many scenarios (As always that should affect apps/games/emus/etc)
- Significant better deep sleep. (Measured at 582 hours. 440% better).
- Faster wake up from sleep.
- Saved 240MB ram (fb and active file page pool, aka always used pool)
- Memory remapping 800%-2000% speed up. Mostly used by emulators and VMs (and lot in android).
- Some other memory optimizations, plus enabled huge ram pages
- Faster kernel and OS boot.
- Fixed tearing issues for NVDEC/NVENC. (video hw accel)
- Lower latency for frame end calcs for builtin display
- Fixed Hori pads for joycond
- Fixed an issue where it would make railed jc to disconnect on rumble
- Joycon/Procon rumble was improved and intensity tuned for better user experience
- Kernel now uses the proper display panel init/deinit by checking panel id
- Improved dock/undock script
- Touch stays enabled now in dock mode. Users that use docks that do not cover the screen can use it as alternative input.
- Added low ram protection. Now instead of hanging for minutes it will only stutter for seconds until oom occurs and recovers ram
- Better seamless display on boot
- uenv.txt changed, read uenv_readme.txt. It's simple to transfer over custom settings.
- Reboot action can now be defined in new uenv.txt. Reboot back into Linux by changing `reboot_action=` from `bootloader` to `via-payload`.

Apps Changes:
- Full video HW decoding via new SMPV Player app (also supports youtube links)
- Full video HW encoding via ffmpeg-l4t
- Added L4T-Megascript app
You can get or build various essential stuff, apps or emulators with a single click. All configured and optimized for Switch.
- Nvpmodel was updated to include Battery charging protection limits options
Useful when you are constantly docked and want to protect battery's life.
Limit gets saved and applied on boot.
Reminder that discharging can't happen when plugged in. Even when charging is off, usb power is used to supplement system.
So you need to discharge first if you want the battery % to go inside the limit.
That also disables charging in sleep in order for the feature to work.
If you reboot/shutdown, it gets disabled and re-enabled at the next L4T boot.
As always the source is public and all L4T based projects for Switch will benefit (L4T linux distros/Lakka/Android)



Sources
They can all be found at https://gitlab.com/switchroot with the other kernel repos on http://nv-tegra.nvidia.com

Use these scripts if you want to build your own kernel: https://gitlab.com/switchroot/kernel/l4t-kernel-build-scripts/tree/test


Credits
Bylaws,
Langerhans,
Ave,
Natinusala,
CTCaer(most of the hard stuff),
Gavin_Darkglider,
DanielOgorchock(Joycon drivers/joycond),
stary2001 (reboot2payload),
NVIDIA,
Azkali
Everyone else in switchroot - more info on that in the future.
 
Last edited by azkali,

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
I tried installing the "noob" version a couple times in different cards and never got it to boot. No idea why I did that since it really isn't much easier.

Upon getting the switchroot image and the 1.5 update (cause why not be bleeding edge,) it boots no problem on a card that only black screened before.

Other items I noticed:
1. Touching the top menu doesn't work. Like ever.
2. Uninstalling stuff via the software menu (like libreoffice) while connected to a network resulted in it reinstalling after it uninstalled. No idea why. Disconnected and it worked.
3. Sudo apt-get upgrade looks like it says almost everything is no longer required and can be autoremoved. This can't be normal.....
4. Touchscreen freezes up on me randomly.


Haven't tried playing with joycons yet and still need to resize the partition and add a swap file.

Any one have directions to dual boot atmosphere? Seems like another boot folder on the same fat32 would conflict. Unless hekate can recognize another fat32 partition?
Yeah, their were some sdcard fixes for u-boot included in the 1.5.0 update I didnt document, because I didnt think they would make a difference after the kernel booted. I am happy they got you up and running though.
@Gavin_Darkglider how goes the other distributions?
Gentoo and Arch are done(At least basic hardware support) Just waiting on me to get off my ass and release them. lol. I will bootstrap debian next, which should go stupid quick(and have full hardware support like ubuntu). That being said, I am currently waiting on my sdcard RMA from samsung, so development has come to a halt for me until that comes in. As for the rest of the hardware support for arch and gentoo, it is a matter of installing debs from jetpack, which is the easy part, as most of that is just extract and place. lol. It is just the idiosyncrasies between distros. lol.
 

CalcProgrammer1

Member
Newcomer
Joined
May 4, 2019
Messages
19
Trophies
0
Age
33
XP
137
Country
United States
Glad to hear you're working on a Debian port. I started creating my own with debootstrap but never got around to finishing it, and I know I'd get stuck with the drivers. I already run Debian arm64 on a bunch of other boards as well as my desktop/laptop systems so I'll definitely be switching to it on my Switch.
 
  • Like
Reactions: SwordfishII

Ryab

Well-Known Member
Member
Joined
Aug 9, 2017
Messages
2,501
Trophies
1
XP
3,320
Country
United States
switchroot.png

L4T Ubuntu 1.3.1
Intro
L4T Ubuntu is a version of Linux based on nvidia's linux for tegra project. It uses a different kernel compared to previous releases which allows it to use features not yet in mainline. Such as audio, docking support and vulkan.

Beware, using high clocks in handheld mode will degrade your batteries capacity a lot faster than at stock clocks

If you can't install an application check this thread, and ask all questions there https://gbatemp.net/threads/l4t-ubuntu-applcation-install-guides.537579/

Features
  • Dock support with USB
  • Bluetooth (both controllers and audio)
  • Nvidia GPU drivers - Vulkan and OpenGL
  • Audio - Headphones, speakers and over HDMI when docked.
  • Joycons and pro controllers are supported fully when not attached to the the console
  • Touchscreen
  • Display
  • WiFi
  • CPU frequency scaling - The CPU scales from 200mhz to 1.7ghz (what switch is binned for) depending on the load its under. Fans are adjusted to account for this
  • Full sdcard speed
  • Hardware video acceleration when using the built in videos app (means you can watch videos without battery draining massively)
Prerequisites
  • A dedicated 16GB+ sdcard
Downloads
Updates
  • 1.1:
  • Download:
  • https://download.switchroot.org/updates/update-1.1-for-switchroot-l4t-ubuntu-2019-04-28.tar.gz
  • Installation Instructions:
  • apt update && apt upgrade is NOT enough for this update
  • Extract this to the first partition of your sdcard, making sure to overwrite Image and tegra210-icosa.dtb.
  • Changelog:
  • Enabled USB mass storage and binfmt in kernel.
  • Fixed touch sensitivity and it not reaching bottom edge.
  • Fixed issues with joycon/procon right stick and y axis
  • Potentially fixed issues with sdcards, if someones didnt work before please try again, if still no then pm me.
  • 1.2:
  • Download:
  • https://download.switchroot.org/upd...1-for-switchroot-l4t-ubuntu-2019-04-28.tar.gz
  • Installation Instructions:
  • apt update && apt upgrade is NOT enough for this update
  • MAKE SURE TO DELETE THE boot FOLDER AND boot.scr BEFORE EXTRACTING THIS UPDATE
  • Extract this to the fat32 partition of your sdcard, making sure a l4t-ubuntu folder is created and the L4T ini is overwritten.
  • Changelog:
  • Enabled ntfs, nfs, squashfs (snaps may work now), ethernet drivers in kernel.
  • Added 2.0ghz overclock.
  • Enabled android ashmem drivers, needed for anbox (need arm64 ver of it and may run)
  • Potentially fixed issues with sdcards, if someones didnt work before please try again.
  • No longer conflicts with lakka.
  • Check misc info section on how to activate 2ghz mode.
  • 1.3.1:
  • Download:
  • https://download.switchroot.org/updates/update-1.3.1-for-switchroot-l4t-ubuntu-2019-04-28.zip
  • Installation Instructions:
  • apt update && apt upgrade is NOT enough for this update
  • MAKE SURE TO DELETE THE boot FOLDER AND boot.scr BEFORE EXTRACTING THIS UPDATE
  • Extract this to the fat32 partition of your sdcard, making sure a l4t-ubuntu folder is created and the L4T ini is overwritten.
  • Changelog:
  • 1.3
  • Enabled all iptables and bridge stuff in kernel.
  • Added SLEEP support (press power button), note the device may randomly wake up and log out if sleep is activated while logged i n, if this happens to you please ssh in and upload the contents of /var/log/syslog .
  • Sped up sdcards, broken ones still wont work though.
  • Charging now happens faster.
  • Probably more stuff I can't remember.
  • 1.3.1
  • Reduced battery usage in sleep
How to install
  1. Download the image from the downloads section and extract.
  2. Write it to your sdcard using a program such as etcher or dd
  3. Apply any updates from the updates section in the thread, IMPORTANT as images don't EVER come with them
  4. Boot hekate and select L4T from the configs menu.
  5. Wait for around 2-4 minutes while it initially loads
  6. Go through the setup process - make sure not to dock the console in this period.
  7. Once the initial setup is finished and you are on the login screen it is advisable to reboot:
  8. Hold the power button for 10 seconds.
  9. Load hekate again and select L4T as a payload.
  10. Log in and open the "Disks" app
  11. Select the second partition of your sdcard and click the gears icon
  12. Choose resize and change the size to the full amount of available space.
  13. Enjoy, you now have fully featured Ubuntu on your switch!
Bugs
  • Wired joycons do not work (connected to console)
  • Docking while having a ssh session open can cause the display to not turn off correctly
  • USB OTG - works fine in dock though
  • Vulkan is buggy in dolphin
  • Touch randomly freezes sometimes
  • The real time clock gets messed up in horizon
Misc Info
  • Pair (joy/pro)cons by opening the bluetooth menu in settings and pressing the + button in the bottom left corner. Then press the sync button on the controller and select its name in the pairing window. Once both joycons are paired press each of their shoulder buttons to use as one controller
  • To update the system run "sudo apt update", "sudo apt upgrade". This will apply all switch and ubuntu updates aside from kernel updates, they will be posted here if ever needed.
  • To limit cpu freq, run cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies. Find the one you want, then run: echo <freq you want> | sudo tee /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq
  • To force max freq run echo performance | sudo tee /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
  • A gui to configure overclocks and fan profiles is coming soon
  • NEW: To activate 2 ghz mode run
    Code:
    echo 1 | sudo tee /sys/kernel/tegra_cpufreq/overclock
    echo 2091000  | sudo tee /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq
    then run the command to force max freq if you want to use anything intensive.
  • To always use 2.0ghz mode copy
    Code:
    #!/bin/bash
    echo 1 > /sys/kernel/tegra_cpufreq/overclock
    echo  2091000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq
    exit 0
    to /etc/rc.local (you'll need root to create)

Sources
They can all be found at https://gitlab.com/switchroot with the other kernel repos on http://nv-tegra.nvidia.com

Credits
Langerhans,
Ave,
Natinusala,
CTCaer,
NVIDIA,
Everyone else in switchroot - more info on that in the future.
Now to wait for arch
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
LP0 is working. It only took 180 Days, and hours of stairing at code for coreboot/atf, but it all payed off in the end.

Will push fixes later today so stay tuned.

20191012-011030.jpg
is there something wrong with my switch

--------------------- MERGED ---------------------------

im stuck on this screen

Nothing wrong with your switch, just the sdcard driver in the kernel. Use a samsung evo card, and it should work.


But YEAH. LP0....
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
LP0 is deep sleep, correct?
Yes, lp0 is deepsleep, unfortunatly, something about ubuntu is breaking it. So, I am working on porting ubuntu 18.04 from the nvidia samplefs to see if it makes a difference. Arch is having the same problems, so I dont know why it works *perfectly*(with a few workarounds) in gentoo.
 
  • Like
Reactions: stick267

DominoBright

Well-Known Member
Member
Joined
Sep 21, 2009
Messages
301
Trophies
1
Age
40
XP
2,133
Country
United States
Dang, guess deep sleep will take a while if it ever comes.

This has done so much to prevent me from installing Flash, while using Cinnamon makes the touch screen inputs hit other spots. (A rotation thing. I suppose that's fair though, it's made for Unity.)
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
Deep sleep issue has been found, and is being worked on as we speak. New touch driver should fix your issues there, rotation isnt working for me in rel30, probably something stupid I missed. lol. Ambiant light sensor is working though, and I am waiting on new joycon rail driver. Once that is done, and deepsleep issue is fixed, I will push an update for ubuntu, but really, I want to push a new image all together, because there are a lot of things userspace side of things that need to change to make everything work properly. Dont worry ubuntu people I havnt forgotten you. ;)
 

stick267

Well-Known Member
Member
Joined
Dec 17, 2018
Messages
598
Trophies
0
Age
32
XP
1,157
Country
United States
Deep sleep issue has been found, and is being worked on as we speak. New touch driver should fix your issues there, rotation isnt working for me in rel30, probably something stupid I missed. lol. Ambiant light sensor is working though, and I am waiting on new joycon rail driver. Once that is done, and deepsleep issue is fixed, I will push an update for ubuntu, but really, I want to push a new image all together, because there are a lot of things userspace side of things that need to change to make everything work properly. Dont worry ubuntu people I havnt forgotten you. ;)
Great news. I wasn't aware that a Joy Con rail driver was being worked on. Will the updated image include reboot to payload as well? Either way, I can't wait for it. Thanks for all your hard work.
 

Worldblender

Well-Known Member
Member
Joined
May 27, 2019
Messages
307
Trophies
0
Age
26
XP
1,868
Country
United States
Deep sleep issue has been found, and is being worked on as we speak. New touch driver should fix your issues there, rotation isnt working for me in rel30, probably something stupid I missed. lol. Ambiant light sensor is working though, and I am waiting on new joycon rail driver. Once that is done, and deepsleep issue is fixed, I will push an update for ubuntu, but really, I want to push a new image all together, because there are a lot of things userspace side of things that need to change to make everything work properly. Dont worry ubuntu people I havnt forgotten you. ;)
Good that there will be a new image coming out. It will save me from having to download and apply multiple updates at once.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Skelletonike @ Skelletonike:
    3h left until work finishes, bah
  • Skelletonike @ Skelletonike:
    link doesn't work
    +2
  • Skelletonike @ Skelletonike:
    1H left, such a slow week.
  • Sonic Angel Knight @ Sonic Angel Knight:
    Okay, I had spaghetti :P
  • SylverReZ @ SylverReZ:
    Hope they made lots of spaget
  • K3N1 @ K3N1:
    Chill dog
  • SylverReZ @ SylverReZ:
    Chilli dog
  • Skelletonike @ Skelletonike:
    Damn, I'm loving the new zelda.
  • xtremegamer @ xtremegamer:
    loving the new zelda, i started a game, it was so fucking good, so i
    am waiting on my friend to get home so we can start a new one together
  • Skelletonike @ Skelletonike:
    I just dislike that they don't let me choose the voices before the game starts. Happened with botw as well, had to change to japanese and restart.
  • K3N1 @ K3N1:
    But the important question is can you choose gender
  • Skelletonike @ Skelletonike:
    Same way you can choose Gerald's gender.
  • Skelletonike @ Skelletonike:
    *Geralt, damn autocorrect.
  • Psionic Roshambo @ Psionic Roshambo:
    But can he be trans? Lol
  • K3N1 @ K3N1:
    Zelda transforms into link
  • Psionic Roshambo @ Psionic Roshambo:
    Link I'm not the princess your looking for.... *Pulls a crying game*
  • K3N1 @ K3N1:
    *skirt up* it's exactly what I always wanted
  • Skelletonike @ Skelletonike:
    Just scanned all my zelda amiibos, took a while but didn't get anything that cool, did get the lon lon ranch hylian fabrics though.
  • Skelletonike @ Skelletonike:
    It was pretty funny when I scanned wolf link and got a shit load of meat.
  • K3N1 @ K3N1:
    @Skelletonike, btw I ran that custom for mgs4 on the deck I'm amazed it got that far in game
  • K3N1 @ K3N1:
    Plug in*
    K3N1 @ K3N1: Plug in*