L4T Ubuntu - A fully featured linux on your switch

switchroot.png

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

Join our discord: https://discord.gg/53mtKYt

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

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
34
XP
581
Country
United States
@bylaws. Sorry if these are useless now. I've made bandaid tier macros to deal with the annoyances and forgot to upload.

One bug I can't avoid is the sleepy gpu (I think) After a few hours uptime only the display will die.

Also thank you! I've learned a lot from this.
I have ran gentoo for days without reboot, while compiling with dpms off, and the it has always come back. Sometimes it is a bit slow due to cpu load(Because I am compiling), but I am not sure what you mean by die.

Also, I have a new kernel, with kali patches, and a test version of coreboot/atf that I hacked together that add minerva support(Removes binary blobs, and seems to fix some loading issues I was having.) There is also a new patch for the touchscreen driver from the android kernel, which seems to help, a little, but still isnt perfect.
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
34
XP
581
Country
United States
Here you go, an unofficial kernel/coreboot update for l4t-ubuntu:https://www.dropbox.com/s/bzb6pzptzsemwz1/update-1.4-unofficial-l4t-ubuntu-switchroot.zip?dl=0

This is my build:
Coreboot includes switchroot patches for: SC7Sleep(Lp0 is still broken,as it doesnt resume gpu properly), Minerva Training Cell.
Kernel includes a lot of new patches, which I will list here, with details on what they are:

1. Kali-wifi-injection-4.9.patch - Add support for monitor mode channel change, and monitor mode packet injection(This doesnt work with internal wifi card though)
2. 0001-wireless-carl9170-Enable-sniffer-mode-promisx-flag-t.patch - patch to add back support for sniffer mode promisx flag, which is needed in monitor mode for packet injection with that card(Driver not built in though.) lol.
3. usb_gadget_bashbunny_patches-l4t_4.9.patch - Personal patch set, created b me, to add bashbunny style metric spoofing to rndis and ecm gadgets(ECM metric spoofing isnt included on the actual bash bunny for some reason, but whatever, I did both.)
4. fix-usb0-rndis0-name.patch - rename local interface for rndis gadget from rndis0 to usb0 which is inline with mainline kernel, and is needed for my ATTACKMODE(Rewrite of official bashbunny version, using configfs instead of preconfigured gadgets) script.
5. stmfts-disable-input-tuning.patch - Touchscreen fixes from android kernel(It still isnt perfect, but it helps a bit)
6. read-mtc-table-addr-from-atf.patch - allow reading Minerva table address from ATF, basically coreboot runs minerva, and passes the table to ATF, then the kernel uses ATF with this patch to access it.

Feel free to test, and use this kernel/coreboot update. Let me know if you find any bugs, an once lp0 is stable, I will push that version as well, if switchroot doesnt. I may even push a more updated kernel, as this is stock 4.9.109 and we were able to patch the kernel up to 4.9.112 without it breaking. Something about 4.9.113 breaks booting.

EDIT: After further testing by me, this breaks resume from lp0 sleep, so maybe the issue I was having with deepsleep(lp0) is because of minerva. will run more tests later today, and will probably revert minerva changes.
 
Last edited by Gavin_Darkglider,

globalc

Member
Newcomer
Joined
Jun 14, 2019
Messages
21
Trophies
0
Age
49
Website
fluxcoil.net
XP
116
Country
Japan
Can I resize the initial 500mb partition to something higher? It always makes the SD card unreadable to my Switch when I resize it.

I keep all my CFW files on the first partition so I need it to be at least 1.5gb. I try to take it away from the 2nd partition (the 8gb Linux partition) while adding the space back at the end of the SD card but it always says the the card is corrupt and must be formatted when I put it back in the switch. I need some assistance, is this possible? I want an SD card with enough space for retroarch games, maybe OpenMW or OpenRTC2, L4T Ubuntu, and a 29.1gb emunand. I should be good on all of this if I could just resize the first partition without it breaking.
You already got ideas for 2 approaches, let me add a third idea.
You could just normally install L4T as per instructions, and boot it. Then extend the second partition, but not to span the whole device, but leave 1.5GB free at the end. Create an additional partition there.

All of that can be done with the graphical disk utilities, but from here maybe fdisk or parted have to be used directly. You should open the disk-device, and look at the start/end data of your 3 partitions. The partitions which are in the partition table stored as 1/2/3 do not have to be in that order on the disk. So the idea is to record the data of partition 1 and 3, then "remove" both (which just removes them from the partition table, but is not touching their real data), and then create 1 and 3 again. Just this time, when creating partition 1, you use the start/enddata of the former partition 3. And for 3 the data from partition 1. After that you should be able to mount 1 and 3, and copy over the data (that could also be done before modifying the partition table).
 

parkerlreed

Active Member
Newcomer
Joined
Sep 6, 2018
Messages
26
Trophies
0
Age
30
XP
100
Country
United States
There is an xbox emulator someone was testing and it wanted a bridge device to connect to, so the module was included in the kernel to bridge the emulator to the wifi. It was added as a request in this thread.

It also appears to be used for the USB RNDIS to a computer. I can SSH on a computer it's connected to via USB.

Code:
[parker@stealth ~]$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: wlp1s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 9c:b6:d0:0e:0d:cd brd ff:ff:ff:ff:ff:ff
3: enp8s0u1u1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:05:6b:00:57:1a brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.90/24 brd 192.168.0.255 scope global dynamic noprefixroute enp8s0u1u1
       valid_lft 84132sec preferred_lft 84132sec
    inet6 fe80::71a:46a2:903:7140/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
4: enp0s20f0u2i5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether be:32:f0:a9:ec:1a brd ff:ff:ff:ff:ff:ff
5: enp0s20f0u2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether 22:fc:9d:9a:11:b5 brd ff:ff:ff:ff:ff:ff
    inet 192.168.55.100/24 brd 192.168.55.255 scope global dynamic noprefixroute enp0s20f0u2
       valid_lft 13sec preferred_lft 13sec
    inet6 fe80::d8f3:6be6:8ef6:805e/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
[parker@stealth ~]$ ssh [email protected]
Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.9.109+ aarch64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

Last login: Mon Jul 15 14:09:48 2019 from 192.168.55.100
parker@switch:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether d2:96:c4:01:3d:a9 brd ff:ff:ff:ff:ff:ff
3: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 2e:69:8d:30:bd:79 brd ff:ff:ff:ff:ff:ff
4: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:90:4c:1a:a0:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.214/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp1s0
       valid_lft 85942sec preferred_lft 85942sec
    inet6 fe80::c13c:422d:89a1:c66c/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
5: tunl0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1
    link/ipip 0.0.0.0 brd 0.0.0.0
6: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1
    link/sit 0.0.0.0 brd 0.0.0.0
7: rndis0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master l4tbr0 state UP group default qlen 1000
    link/ether be:32:f0:a9:ec:19 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::bc32:f0ff:fea9:ec19/64 scope link
       valid_lft forever preferred_lft forever
8: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master l4tbr0 state UP group default qlen 1000
    link/ether be:32:f0:a9:ec:1b brd ff:ff:ff:ff:ff:ff
    inet6 fe80::bc32:f0ff:fea9:ec1b/64 scope link
       valid_lft forever preferred_lft forever
9: l4tbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether be:32:f0:a9:ec:19 brd ff:ff:ff:ff:ff:ff
    inet 192.168.55.1/24 brd 192.168.55.255 scope global l4tbr0
       valid_lft forever preferred_lft forever
    inet6 fe80::1/128 scope link
       valid_lft forever preferred_lft forever
    inet6 fe80::30eb:52ff:fe89:5b0a/64 scope link
       valid_lft forever preferred_lft forever
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
34
XP
581
Country
United States
It also appears to be used for the USB RNDIS to a computer. I can SSH on a computer it's connected to via USB.

Code:
[parker@stealth ~]$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: wlp1s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 9c:b6:d0:0e:0d:cd brd ff:ff:ff:ff:ff:ff
3: enp8s0u1u1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:05:6b:00:57:1a brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.90/24 brd 192.168.0.255 scope global dynamic noprefixroute enp8s0u1u1
       valid_lft 84132sec preferred_lft 84132sec
    inet6 fe80::71a:46a2:903:7140/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
4: enp0s20f0u2i5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether be:32:f0:a9:ec:1a brd ff:ff:ff:ff:ff:ff
5: enp0s20f0u2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether 22:fc:9d:9a:11:b5 brd ff:ff:ff:ff:ff:ff
    inet 192.168.55.100/24 brd 192.168.55.255 scope global dynamic noprefixroute enp0s20f0u2
       valid_lft 13sec preferred_lft 13sec
    inet6 fe80::d8f3:6be6:8ef6:805e/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
[parker@stealth ~]$ ssh [email protected]
Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.9.109+ aarch64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

Last login: Mon Jul 15 14:09:48 2019 from 192.168.55.100
parker@switch:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether d2:96:c4:01:3d:a9 brd ff:ff:ff:ff:ff:ff
3: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 2e:69:8d:30:bd:79 brd ff:ff:ff:ff:ff:ff
4: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:90:4c:1a:a0:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.214/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp1s0
       valid_lft 85942sec preferred_lft 85942sec
    inet6 fe80::c13c:422d:89a1:c66c/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
5: tunl0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1
    link/ipip 0.0.0.0 brd 0.0.0.0
6: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1
    link/sit 0.0.0.0 brd 0.0.0.0
7: rndis0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master l4tbr0 state UP group default qlen 1000
    link/ether be:32:f0:a9:ec:19 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::bc32:f0ff:fea9:ec19/64 scope link
       valid_lft forever preferred_lft forever
8: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master l4tbr0 state UP group default qlen 1000
    link/ether be:32:f0:a9:ec:1b brd ff:ff:ff:ff:ff:ff
    inet6 fe80::bc32:f0ff:fea9:ec1b/64 scope link
       valid_lft forever preferred_lft forever
9: l4tbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether be:32:f0:a9:ec:19 brd ff:ff:ff:ff:ff:ff
    inet 192.168.55.1/24 brd 192.168.55.255 scope global l4tbr0
       valid_lft forever preferred_lft forever
    inet6 fe80::1/128 scope link
       valid_lft forever preferred_lft forever
    inet6 fe80::30eb:52ff:fe89:5b0a/64 scope link
       valid_lft forever preferred_lft forever

It is only attached to the bridge, because the bridge device attaches all available network cards, unless configured differently. I have removed the bridged device, and still used rndis ethernet. If you notice my build above, which I found out after I released it that it breaks sleep mode, it has custom patches I made just for this module.
 

RealSlimSquiddy

New Member
Newbie
Joined
Jul 16, 2019
Messages
3
Trophies
0
Age
27
XP
58
Country
United States
I tried launching L4T, but my console's screen only stays lit for a few seconds and the console is sent back into RCM mode. Yes, I followed all of the instructions.
 

Worldblender

Well-Known Member
Member
Joined
May 27, 2019
Messages
321
Trophies
0
Age
26
XP
2,188
Country
United States
For the past three days, I've had my Switch unit taken into a repair store in hopes of trying to get it to work again. I was hoping that reflowing the solder of the wi-fi chip would solve all my problems - but nope! :sad: Nothing really changed, except that I no longer receive orange screens, and that even booting up CFW will cause my unit to hang without displaying anything. I really think that I'm holding a defective unit now, to the point that I want to just recycle it :hateit: (but I will never do that in reality as it is still usable in some way). However, booting up L4T Ubuntu still works like before, but it gives me no access to the console-exclusive games I so want to try. Given this situation I am in now, I am considering selling (or even giving away my unit as a last resort) my unit to let others experiment with L4T Ubuntu, or even convert it into a useful PC. Some caveats here:
  • Wi-fi and Bluetooth will not be detected, and thus be unusable.
  • An official dock is recommended to get the most out of this unit, as using one is the only other way to get another method of internet access.
  • AutoRCM is enabled on this unit for convenience purposes.
  • No other accessories are included with this unit; just the bare console (one screw on the bottom is missing).
I made a backup of the eMMC just in case; I'm trying to see if restoring it will fix all my problems. If not, I will make an update, and begin selling the unit to someone who is interested, most likely on eBay.

NEW: Restore went okay, and I have been able to successfully use Hekate 5.x.x, but the situation did not change one bit. Using Atmosphere, whether in sysNAND or emuNAND mode, always results in getting stuck at the Switch logo (if I wait long enough, I can get an orange or blue screen again). This leaves me with no choice but to get rid of my current Switch unit somehow (either by selling it or giving it away), so that I can replace it with another working Switch unit that I can enjoy hacking in the near future. (Private) Message me if interested in buying this unit, or wait until I make a listing for it.
 
Last edited by Worldblender,

skittletop

Member
Newcomer
Joined
Feb 11, 2018
Messages
6
Trophies
0
Age
56
XP
182
Country
United States
I'm getting a network error trying to download the SD card image on the first page (tried on two different networks). Anyone got a mirror or know what's going wrong?
 

lordelan

Well-Known Member
Member
Joined
Jan 4, 2015
Messages
5,758
Trophies
1
Age
44
XP
6,463
Country
Germany
Do I need to apply every single update or just the latest one?

If every single update, is it enough to go from lowest to highest, copy and overwrite everytime and do an
Code:
apt update && apt upgrade
just once after the last one?

Also do I do this once before I copy over all single updates?
MAKE SURE TO DELETE THE boot FOLDER AND boot.scr BEFORE EXTRACTING THIS UPDATE

In other words:
What's the easiest/fastest way to fresh install Ubuntu and get to the latest update (1.3.1 as of now)?
 
Last edited by lordelan,

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
34
XP
581
Country
United States
Do I need to apply every single update or just the latest one?

If every single update, is it enough to go from lowest to highest, copy and overwrite everytime and do an
Code:
apt update && apt upgrade
just once after the last one?

Also do I do this once before I copy over all single updates?


In other words:
What's the easiest/fastest way to fresh install Ubuntu and get to the latest update (1.3.1 as of now)?
Do I need to apply every single update or just the latest one?

If every single update, is it enough to go from lowest to highest, copy and overwrite everytime and do an
Code:
apt update && apt upgrade
just once after the last one?

Also do I do this once before I copy over all single updates?


In other words:
What's the easiest/fastest way to fresh install Ubuntu and get to the latest update (1.3.1 as of now)?

Updating with apt doesnt include the bootchain, that is what the updates are. Really, to update from the image directly to 1.3.1, before even booting it, just erase the stuff that written to the fat32 partition, then extract the file on the fat32 partition. then boot hekate, and launch linux. From there, you can update the userspace, like you would on a computer.
 

lordelan

Well-Known Member
Member
Joined
Jan 4, 2015
Messages
5,758
Trophies
1
Age
44
XP
6,463
Country
Germany
Updating with apt doesnt include the bootchain, that is what the updates are. Really, to update from the image directly to 1.3.1, before even booting it, just erase the stuff that written to the fat32 partition, then extract the file on the fat32 partition. then boot hekate, and launch linux. From there, you can update the userspace, like you would on a computer.
Cool thx.
 

uberloafy

New Member
Newbie
Joined
Jul 18, 2019
Messages
1
Trophies
0
Age
40
XP
48
Country
United States
Is it possible to upgrade L4T's Ubuntu version from the LTS release to the current Disco Dingo version? On my switch, attempting to do so resulted in a black screen.
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
34
XP
581
Country
United States
Is it possible to upgrade L4T's Ubuntu version from the LTS release to the current Disco Dingo version? On my switch, attempting to do so resulted in a black screen.

Yes, assuming you use a 7.x(needed for cuda) gcc compiler for the packages, and use the right version of X11. after that is is a matter of installing the nvidia packages for the drivers and such. Problem is, that you would probably have to rebuild every package in the repository from source to keep linking sane.
 
  • Like
Reactions: Watermelonz

Disco Inferno

Well-Known Member
Member
Joined
Feb 25, 2016
Messages
148
Trophies
0
XP
1,504
Country
United States
I tried forever to get this working on my already CFW switch (XAW1004...) without success, but it worked the first time on my stock switch (XAW1005...) with the same microsd. Not sure what's going on there.
 

W9qI8k5QMf

Well-Known Member
Newcomer
Joined
Feb 11, 2019
Messages
68
Trophies
0
Age
35
XP
1,080
Country
United States
When I put it in the dock, nothing happens. It still shows the image on the Switch screen.
Any ideas?

I had the same problem.

I bought my switch used and the power cable for the dock was some unofficial power adapter.
normal switch usage, the image would show on the screen, but for l4t linux the image wouldnt switch over.

I bought a proper nintendo power adapter cable for the switch and now when I put switch in dock the image shows on tv for L4t linux.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: Sorry for accidentally bending over