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,

Mouser X

Well-Known Member
Member
Joined
Aug 26, 2009
Messages
101
Trophies
0
XP
546
Country
United States
I dont know where you get your information, but it is wrong. If you connect to the console using ssh, you can mount an ext4 partition. This is linux afterall, and ext4 is the standard for most distro's at this time, so building a kernel without support for it would be strange. Even if it doesnt support it, you can add support, by compiling your own kernel. If you want to automount an ext4 partition with lakka, you would need to extract the initrd and modify the /etc/fstab file, and add your partition and rules there.
I have no idea what SSH is, other than that it involves networking. The only Linux machine I have is my Switch. Prior to that, about 10-15 years ago, I had a craptop with 128 MB of RAM (how they ever got Windows working on it, I'll never know) that I installed xubuntu to. As for Lakka, it probably does support ext4 (as you said, it is Linux after all). However within Lakka I couldn't see any way to access the ext4 partition on my SD card. Therefore, for a common layman, effectively, Lakka doesn't support ext4 "out of the box." Can it be set up? Apparently so, but everything you said went way over my head. Since the person asking the original question (which was if they can use the ext4 partition for Lakka) couldn't even figure out how to resize their fat32 partition, it seems doubtful they'll figure out how to set up Lakka to use the ext4 partition. Of course, I could be wrong. It certainly wouldn't be the first (or last) time. But for me, with poor Linux experience, the SSH stuff is very confusing. :wink:
 

TheZander

1337
Member
Joined
Feb 1, 2008
Messages
2,126
Trophies
2
Location
Level 7
XP
3,665
Country
United States
I have no idea what SSH is, other than that it involves networking. The only Linux machine I have is my Switch. Prior to that, about 10-15 years ago, I had a craptop with 128 MB of RAM (how they ever got Windows working on it, I'll never know) that I installed xubuntu to. As for Lakka, it probably does support ext4 (as you said, it is Linux after all). However within Lakka I couldn't see any way to access the ext4 partition on my SD card. Therefore, for a common layman, effectively, Lakka doesn't support ext4 "out of the box." Can it be set up? Apparently so, but everything you said went way over my head. Since the person asking the original question (which was if they can use the ext4 partition for Lakka) couldn't even figure out how to resize their fat32 partition, it seems doubtful they'll figure out how to set up Lakka to use the ext4 partition. Of course, I could be wrong. It certainly wouldn't be the first (or last) time. But for me, with poor Linux experience, the SSH stuff is very confusing. :wink:
  1. Download putty

  2. Make sure ssh is selected

  3. Put in your switch ip

  4. Put in your username and password for linux and click connect
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
I have no idea what SSH is, other than that it involves networking. The only Linux machine I have is my Switch. Prior to that, about 10-15 years ago, I had a craptop with 128 MB of RAM (how they ever got Windows working on it, I'll never know) that I installed xubuntu to. As for Lakka, it probably does support ext4 (as you said, it is Linux after all). However within Lakka I couldn't see any way to access the ext4 partition on my SD card. Therefore, for a common layman, effectively, Lakka doesn't support ext4 "out of the box." Can it be set up? Apparently so, but everything you said went way over my head. Since the person asking the original question (which was if they can use the ext4 partition for Lakka) couldn't even figure out how to resize their fat32 partition, it seems doubtful they'll figure out how to set up Lakka to use the ext4 partition. Of course, I could be wrong. It certainly wouldn't be the first (or last) time. But for me, with poor Linux experience, the SSH stuff is very confusing. :wink:

SSH is like telnet, fairly simple, and there is a nice windows client for it called putty. Once you are there, you need to mount the drive like any other drive to somewhere in the filesystem. eg mount -t ext4 /dev/sda1 /external_storage

Obviously these values are subject to change, if it is on an sdcard, or external hdd/flashdrive, and if the mount point exists. if it doesnt create it with mkdir /external_storage.

Then you can find your roms in lakka in the external storage folder. Or, you could go one better, and mount --bind /external_storage /path/to/lakka/rom/dir/, then it will also be fake mounted to the lakka rom path, and lakka will automatically scan it. Unfortunatly, you will have to do this every time, with out modifying the initrd, which hosts all of lakka.
 

octopus

Custom Title
Member
Joined
Sep 6, 2013
Messages
428
Trophies
0
Location
/
XP
1,634
Country
Somalia
Yeah, I have noticed this bug too. Quick fix, change your resolution a few times till the output looks correct. Doesnt happen often but thats what i do when i see it.
Hm, does not work for me. The only docked resolution that works without this output bug is 1280x720, everything else has it. My display is 1080p. Tried changing it a lot of times, did not help. Actually, it makes it worse sometimes, like, even the usable resolution gets wrong DPI or something, it becomes blurry and I have to change it to 1080p and back to 720p to make it readable.
And this bug was present right after the first launch on a new mSD. And I docked only after the initial setup and a reboot as per OP.
 

Qubarf

Well-Known Member
Member
Joined
Dec 14, 2018
Messages
233
Trophies
0
Age
32
XP
854
Country
Pakistan
how do i have joycons pair automatically???
Also how do I stop chromium icon from appearing every boot?
And @bylaws why don't you release the android build you have currently to the community so everybody can work and help you, i mean i am sure there is a reason but just wanted to know.
Thx
 
Last edited by Qubarf,

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
how do i have joycons pair automatically???
Also how do I stop chromium icon from appearing every boot?
And @bylaws why don't you release the android build you have currently to the community so everybody can work and help you, i mean i am sure there is a reason but just wanted to know.
Thx

First and foremost, I would think a broken android build wouldnt be much use, the code to the broken, but working android build might be. the problem isnt android the problem is the video card drivers not supporting frame buffer acceleration. The nvidia android drivers are broken, so it is a matter of waiting on the mainline to catch up. Until then there isnt much point. That, and if you are asking for the build, instead of building it yourself, you probably arent going to be much help. IMHO. ;)
 

IbnRami

Member
Newcomer
Joined
May 19, 2019
Messages
8
Trophies
0
Age
35
XP
51
Country
Brazil
Has any one tryed Open X-ray or the S.T.A.L.K.E.R. games though Wine on the switch?

I plan on buying a new SD card to use a dual boot set up (with dongle) but I won't manag to spare the money this month and I am sure that as a linux noob myself it will take quite some time for me to set it up correctly. Specially building OpenX-ray or configuring Wine the right way.

Enviado de meu SM-T585 usando o Tapatalk
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
Has any one tryed Open X-ray or the S.T.A.L.K.E.R. games though Wine on the switch?

I plan on buying a new SD card to use a dual boot set up (with dongle) but I won't manag to spare the money this month and I am sure that as a linux noob myself it will take quite some time for me to set it up correctly. Specially building OpenX-ray or configuring Wine the right way.

Enviado de meu SM-T585 usando o Tapatalk

Not that I know of, I dont think wine would work for the switch, unless the apps were maybe for windows 10 arm. You might be able to get qemu and wine working together, but that is iffy at best.
 
  • Like
Reactions: IbnRami

Qubarf

Well-Known Member
Member
Joined
Dec 14, 2018
Messages
233
Trophies
0
Age
32
XP
854
Country
Pakistan
First and foremost, I would think a broken android build wouldnt be much use, the code to the broken, but working android build might be. the problem isnt android the problem is the video card drivers not supporting frame buffer acceleration. The nvidia android drivers are broken, so it is a matter of waiting on the mainline to catch up. Until then there isnt much point. That, and if you are asking for the build, instead of building it yourself, you probably arent going to be much help. IMHO. ;)
LOL, I didn't say i was going to do anything! I meant other people ;)
 

dotmick

Member
Newcomer
Joined
Oct 7, 2018
Messages
23
Trophies
0
Age
39
XP
128
Country
United Kingdom
Has any one tryed Open X-ray or the S.T.A.L.K.E.R. games though Wine on the switch?

I plan on buying a new SD card to use a dual boot set up (with dongle) but I won't manag to spare the money this month and I am sure that as a linux noob myself it will take quite some time for me to set it up correctly. Specially building OpenX-ray or configuring Wine the right way.

Enviado de meu SM-T585 usando o Tapatalk

S.T.A.L.K.E.R. might be a bit too much for the Switch IMO :/
 

Qubarf

Well-Known Member
Member
Joined
Dec 14, 2018
Messages
233
Trophies
0
Age
32
XP
854
Country
Pakistan
@bylaws as you instructed here is my syslog after the fore-mentioned sleep bug occurred: http://ge.tt/82ACvVw2
Bugs i encountered:
Switch was able to turn back on but it was in the state it is when freshly booted up. Everything closed etc.
Wifi was broken but was able to fix that by restarting network-manager
It only happens after switch is left on sleep mode for more that 10 minutes, from what i can tell.
 

spotanjo3

Well-Known Member
Member
Joined
Nov 6, 2002
Messages
11,106
Trophies
3
XP
5,964
Country
United States
This is going to be great but I will wait a little bit longer because I want to play Wii games and Game Cube games without overclocked.
 
General chit-chat
Help Users
    A @ abraarukuk: :rofl2: