mobile-nixos
mobile-nixos copied to clipboard
Can this project support a jailbroken Nintendo Switch?
Hello!
In my megalomaniac mind, I think: "If Linux then Nix". When I see a cool project that either
- runs on Linux (any package in ~~Debian~~ ~~AUR~~ ~~Slackbuilds~~ ~~Gentoo~~ Nixpkgs)
- runs Linux on (e.g. a cellphone)
my first thought is "what about running this on Nix?".
Recently I bought a jailbroken Nintendo Switch OLED.
Since there is a Fedora Linux that runs on Nintendo Switch, so I ask: is it possible to port mobile-nixos to my Nintendo Switch?
Almost definitely yes.
It just requires to put the time into making it work.
(NOTE: I literally have a spare early model switch set aside for that purpose, but never got around to it...)
I am very interested, then! Please tell me how can I help - and what I should know in order to help :)
First, I'll note that I won't have the time or energy to handle that in any predictable time frame. Though I can answer precise questions.
So, I guess the first thing I would do is learn about all the components involved into booting the kernel and initrd/stage-1, and make a strong mental model.
Since you'll maybe need some help, you should probably make a write-up so one can follow your mental model.
When I say learn about all the components, this would map what basically is "the bootloader" stage, and then knowing the format of kernel+initrd expected to be used by Hekate and other parts of the tooling.
Is that providing enough hints to start? Do ask additional questions, the more precise they are, the more likely I'll be able to help providing an answer quickly :).
Why do I care only about kernel+initrd?
Because anything else after is 99.99% likely to be squarely and entirely managed by the Linux distro with the semantics they want. That's not limited to Nintendo Switch, but basically to all targets. With the caveat that sometimes (e.g. android devices) you have to contend with some limitations (pre-specified partitions) but nothing outright problematic.
My expectation here is that the rootfs of linux distros on switch is just a partition on the SD card. So pretty much the most trivial scenario.
My impression is that there is some gap between what is said and how it happens.
The mental model I can think of is more or less like "installing a barebones distro" like Slackware:
- Pick the storage device
- Fill it with the files you need
- Write specific sequences of bytes at specific physical places on the storage device
- especially the bootloader, that should transfer the control to the OS
- Plug the configured storage device on a machine and push the power button
In my limited knowledge (looking at tutorials for exotic hardware), sometimes this is a 1-1 correspondence.
Anyone looking into this, please note that you'll need an old, unpatched model of Switch so you can make it boot from the sd card.
https://www.reddit.com/r/SwitchPirates/wiki/before/
The modchip does not work?
https://wiki.switchroot.org/wiki/faq
Switchroot does not endorse the manufacture of or provide user support for modchips, but a chipped unit can run Switchroot Android 11, L4T Ubuntu Bionic & Jammy 5.0.0 and up, L4T Fedora, and L4T Lakka (in beta)
@AndersonTorres My understanding is that such chips are illegal, and are hard to find for cheap. My whole purpose for wanting nixos on a Switch was to be able to run a server OS on dirt cheap / easy hardware, for educational purposes. Requiring students to buy extra hardware that's expensive, difficult to set up, and possibly illegal is a no-go.
But sure, if your use case does not require things to be cheap or easy, then yeah I guess you can try a mod chip :)
Then your issue is with the hardware. I do not believe the software stack will be affected by this modchip.
Obviously I am not talking about the legal conundrums with that firm that sells cards.
Yes, I'm just letting people know before they start hacking that they have to buy an unpatched Switch in order to even begin on this.
I stupidly bought a Switch thinking any Switch would be moddable, not noticing that "jailbroken" applies to only some very old Switches, or Switches that have been illegally(?) modified at the hardware level.
Just trying to save others from making the same dumb mistake :)