Azkali https://azka.li/ Personal blog of Azkali Tue, 28 Oct 2025 07:54:34 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.4 https://i0.wp.com/azka.li/wp-content/uploads/2023/10/cropped-Forme-1-copy-3-14.png?fit=32%2C32&ssl=1 Azkali https://azka.li/ 32 32 209639549 Tale of the Nintendo Switch hacking scene https://azka.li/tale-of-the-nintendo-switch-hacking-scene/ Sun, 18 Feb 2024 09:41:37 +0000 https://azka.li/?page_id=328 Preamble First and foremost I’d like to mention that this article isn’t aimed at the technically inclined but rather for all the curious out there. Throughout the 4 years of being part of the Switchroot development crew I’ve been faced, IRL and online, with a lot of lack of understanding towards my and also all […]

L’article Tale of the Nintendo Switch hacking scene est apparu en premier sur Azkali.

]]>
Preamble

First and foremost I’d like to mention that this article isn’t aimed at the technically inclined but rather for all the curious out there.

Throughout the 4 years of being part of the Switchroot development crew I’ve been faced, IRL and online, with a lot of lack of understanding towards my and also all the work that has been done on the device and what it means (for me) as a whole for the console hacking scene.

So today I would like to share my vision regarding the meaning and importance of the Nintendo Switch hacking scene, principally surrounding the subject of running other OS (operating system).

Context and history

Running Linux or other OSes is not something new in the console and more generally device hacking scenes.

A very great example of that, and notable one is the original Xbox (2001) and XBMC1

XBMC, now called Kodi, is surely a reference in home media center today and it originated as a Xbox project.

More recently on handheld gaming consoles we can look at Linux ports on the PSVita or 3DS.

As you can see, while the work being done is colossal (Hardware reverse engineering, device tree creation, driver creation, vulnerability exploitation and so on..) the usability of those Linux ports as a daily driver is not possible on those devices for many reasons that I’ll leave to the readers to figure out and research.

So, how is the switch any different compared to those other devices ?

We should take a look at the base for now, namely, the switch hardware, indeed it embeds a Tegra X1 SoC2 made by Nvidia.

Enough of technicalities for now.

What really matters in our case, for the switch, is that unlike all those other devices Nvidia provides Linux kernel sources for this SoC2 which makes a world of difference compared to previous devices where (in the case of Linux or other OS) the work had to be done completely from scratch.

That means we already have a base to start with that is known working and has the hardest part figured out for us (GPU drivers *cough* *cough*)

Why is that important ?

The Nintendo Switch is to me a meaningful representative of modern day SoC and their capabilities.

It’s potential has no equal thanks to it’s versatility and the bonding of multiple communities willing for the device to progress.

Between the ability to use it as a media center, NAS (since it has 3 main storage system, SD, eMMC and USB), AI (thanks to CUDA), pentesting device and very notably emulation capabilities, such that it is able through complex means to emulate some PC games at playable framerates thanks to x86_64 emulators in combination with wine and dxvk and as impressively can emulate the Nintendo Game library inside Linux using Yuzu with various result.

To my knowledge it’s the first device capable of emulating it’s own game library inside an alternative OS at “playable” framerates.

So what’s next ?

The switch still has a long road ahead and lots of room for improvement.

Those who I communicate my work with are already aware of some of the ideas I have to push it beyond anything that’s been currently done while trying to keep devs and advanced user attracted to the platform.

In a nutshell, my current goals are to finish and upstream the mainline work that I resumed 2 years ago, make the L4T OS more static as it’s and will remain our main product.

For the rest I’ll keep some mystery floating since we all love good surprises.

If you’re interested to learn more about the platform and the work done by our community, you can freely join our discord server Linux 4 Switch.

References

Kodi (XBMC) Wikipedia page

SoC – System on a chip

L’article Tale of the Nintendo Switch hacking scene est apparu en premier sur Azkali.

]]>
328
Concrete jungle https://azka.li/concrete-jungle/ https://azka.li/concrete-jungle/#respond Sun, 24 Dec 2023 03:16:27 +0000 https://azka.li/?p=288 Life Back to Paris for work opportunities, family and friends. Been enjoying to do some light carpentry work, thanks to my friend @jean.potonais04 Electronic Back to my domotic and electronic project(s) I’ve been tinkering with relays before moving back here and I’ll use one alongside an esp32 chip to control a lamp + set of […]

L’article Concrete jungle est apparu en premier sur Azkali.

]]>
Life

Back to Paris for work opportunities, family and friends. Been enjoying to do some light carpentry work, thanks to my friend @jean.potonais04

Hotel de Ville – Paris IV
Canal saint Martin – Paris X

Electronic

Back to my domotic and electronic project(s)

I’ve been tinkering with relays before moving back here and I’ll use one alongside an esp32 chip to control a lamp + set of leds strip.

The trigger is going to rely on the presence detector I showed in my previous post, upon entrance and AI body detection, a counter is incremented and decremented which will keep track of the entrance in the room.

I decided to gift myself a Sovol SV06, I was lurking at their “KlipperScreen” but figured I could use my switch running Linux to get the same result.

My poor JGAurora A5 which I bought 2y ago got it’s thermistor broke due to bad cable management on my end. I’ll fix it and sell it.

I took the Sovol SV06 due to it’s high compatibility with Klipper.

And that all will go well with the ChromaPrint set I took for my birthday (backed a month ago)

Impatient to get back at AM (additive manufacturing) more seriously.

Software

Still preparing the release of Fedora 39 on switch. With the help of @Graph’it

We’re resuming a, now old, UI project called MithraUI I plan to use QT6 as a base and possibly ship it for the Fedora 39 release.

Alongside the previously mentioned KlipperScreen software I plan to setup my switch with Octoprint. Obico.io looks like an interesting add-on I could have in that setup.

I am impatient to unveil all the changes I’ve made to the L4S (Linux4Switch) project. Happy to also say that we have 2 new promising members who are helping us, LuRenJias and TechFlash, very happy to have new team members by our side.

Recently took some interest in NFC in order to clone my badge (MiFare classic 1k ISO-14443-3A) on my phone and emulate it, little success so far.

Next on the list has been to resume my work on Ubuntu Touch port for the Z Fold 3 and trying to debug RILd which just falls appart.

Looking forward to setup LLama on my switch for some AI assistance in my daily tasks.

L’article Concrete jungle est apparu en premier sur Azkali.

]]>
https://azka.li/concrete-jungle/feed/ 0 288
September – November https://azka.li/septembre-november/ https://azka.li/septembre-november/#respond Tue, 12 Dec 2023 20:41:36 +0000 https://azka.li/?p=263 3D printing So I got back to 3d printing in September and decided to get back to modelism with the desktop Fusion 360, although I’ve been dis recommend to use it for CAD, but I plan to use it for PCB creation. The end goal was to equip my desk and help fix the inefficiencies […]

L’article September – November est apparu en premier sur Azkali.

]]>
3D printing

So I got back to 3d printing in September and decided to get back to modelism with the desktop Fusion 360, although I’ve been dis recommend to use it for CAD, but I plan to use it for PCB creation.

The end goal was to equip my desk and help fix the inefficiencies in me setup at low cost, with my new 3d printer, the Dremel 3d45.

House automation

Recently I started to do some small house renovation where I live.
I ended up starting to mock up a ~~now quite heavy~~ house automation project, it interconnects with my work on Switch thanks to AI/CUDA and other embedded devices.

Human presence detetcor wired to an ESP32-S3 with Cam/Mic from XIAO (face detection at low costs enabled hourray

Nintendo Switch

Been preparing the release of L4S Fedora 39 as F37 is hitting standard support this month 12/23.

Sneak peak at Fedora 39 KDE closed RC1

Recently resumed Ubuntu Touch port on the Switch, we’ll see how it goes.

Also ended up back porting Mariko DT support to my Mainline fork as well as updating it to v6.6.

L’article September – November est apparu en premier sur Azkali.

]]>
https://azka.li/septembre-november/feed/ 0 263
Anime review: The eminance in shadow https://azka.li/anime-review-the-eminance-in-shadow/ https://azka.li/anime-review-the-eminance-in-shadow/#respond Wed, 25 Oct 2023 04:42:45 +0000 https://azka.li/?p=239 Hey, it’s been a while since I last posted on my personal blog/website.I decided to take a new direction and express myself more about the things I like to listen, do, watch and possibly more. So today I am here to share with you my opinion about The Eminence in Shadow. Almost spoiler-free Summary Our […]

L’article Anime review: The eminance in shadow est apparu en premier sur Azkali.

]]>
Hey, it’s been a while since I last posted on my personal blog/website.
I decided to take a new direction and express myself more about the things I like to listen, do, watch and possibly more.

So today I am here to share with you my opinion about The Eminence in Shadow.

Almost spoiler-free Summary

Our protoganist, Cid, an earthling like you and I thrust for power.

What type of power you may ask ? A power so immense that no human could equal. A power so great, that even the most powerful being could only dream of.

But as a simple mortal and despite his efforts, his dream is unreachable.

That is until he gets reincarnated in another world where we’ll follow his progress toward the completion of his goal, his rise and eventually his fall ?

Yet another isekai ?

My fellow weebs and otakus anime enjoyers would ask me and rightfully so, what does this serie, yet another isekai *cough* *cough* has to bring to the table ?

The Eminence in Shadow takes the code of the isekai genre while making great fun of them and it does it well.

The narration is unraveled like an old parchment, even though the reader/watcher may already know where the story wants to lead them, they will be surprised almost certainly by how the plot unfolds.

The narration is not the only strong point, the hero reflects very well what the anime is, a melange of comedy and action as such, the action scenes gets us hooked at the screen and the comedy phases makes us laugh or cheer.

Leaving a veil between what we know, what the anime wants us to know and the reality, if it even exists, is exactly the goal of the show.

Final note

Plot

Rating: 4.5 out of 5.

Originality

Rating: 4 out of 5.

Execution

Rating: 4 out of 5.

Animation

Rating: 3 out of 5.

Final score

15.5/20

While the animation is well made, it doesn’t outstand the other point neither brings something more to the intrigue in my opinon. I still highly recommend to watch it if you like action filled anime with a simple but well rounded plot.

L’article Anime review: The eminance in shadow est apparu en premier sur Azkali.

]]>
https://azka.li/anime-review-the-eminance-in-shadow/feed/ 0 239
Crap, I accidentaly deleted ibdata1.. https://azka.li/crap-i-accidentaly-deleted-ibdata1/ https://azka.li/crap-i-accidentaly-deleted-ibdata1/#respond Fri, 06 Jan 2023 00:47:05 +0000 https://azka.li/?p=177 0. Preamble Administrating multiple wordpress/websites can be cumbersome at times. While wordpress is pretty complete and provides a lot of features via its plugin system, it can get messy pretty quickly. One of the main concerns about website administration is the database. There are, at least, two important rules for any serious web admin: My […]

L’article Crap, I accidentaly deleted ibdata1.. est apparu en premier sur Azkali.

]]>
0. Preamble

Administrating multiple wordpress/websites can be cumbersome at times. While wordpress is pretty complete and provides a lot of features via its plugin system, it can get messy pretty quickly.

One of the main concerns about website administration is the database. There are, at least, two important rules for any serious web admin:

  • Always have multiple backups
  • If possible, add some redundancy

My setup is pretty straight forward, a VPS running in cluster using docker swarm, and a few containers.
The topic of today is about recovering from an accidental removal of ibdata1 (InnoDB file) when working with MySQL (or other database) using InnoDB engine.

1. How did it happen ?

After a restart of my VPS, the MySQL container refused to startup due to a misalignement of the InnoDB file.
While trying to debug the issue, I acted too fast while I was searching for a potential solution, and, sadly, proceeded to remove the ibdata1 and ib_logfile0 files in MySQL directory WITHOUT A PRIOR BACKUP…
Thankfully for me, MySQL/MariaDB is smart and by default on newer versions it keeps single .frm and .ibd files containing, respectively, the DB tables and their data.

2. Recovering

First and foremost, we’ll use a nifty tool called dbsake which will parse the .frm files in order to recreate the tables structure:

curl -s http://get.dbsake.net > dbsake
chmod u+x dbsake
sudo cp dbsake /usr/local/bin/

Now that dbsake is installed we’ll create a temporary database, which we’ll call recovery in order to recover the old tables

mysql -p -e "CREATE DATABASE recovery;"

While dbsake has a recursive option for parsing a folder containing .frm files, it doesn’t follow the latest MySQL specification and fails parsing some of the tables. We’ll use a for loop to parse the .frm files instead, but you are free to create the missing tables yourself after this step.

for frm in *.frm; do dbsake frmdump ${frm} >> frm-create-tables.sql; done

This should produce most of the CREATE TABLES statements. Now let’s make the DISCARD and IMPORT statements, in order to sync the tables

awk '{if(/CREATE TABLE/) print $3}' frm-create-tables.sql | sed 's/`//g' 's/^/ALTER TABLE /g; s/$/ DISCARD TABLESPACE;/g' > discard-tables.sql
sed 's/DISCARD/IMPORT/g' discard-tables.sql > import-tables.sql

Before importing the tables into the newly created database, we want to fix timestamp statements generated by dbsake.

sed -i 's/timestamp DEFAULT NULL/timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP/g' frm-create-tables.sql

We can now import the tables into the newly created database

mysql -p recovery < frm-create-tables.sql

Once that is done, we’ll discard the tablespaces

mysql -p recovery < discard-tables.sql

We’ll copy the BACKED UP *.ibd files to the new database folder and fix their ownerships

sudo rm -rf /var/lib/mysql/recovery/*.ibd
sudo cp *.ibd /var/lib/mysql/recovery/
sudo chown -R mysql:mysql /var/lib/mysql/recovery/

Let’s sync the newly imported *.ibd files

mysql -p recovery < import-tables.sql

Finally, we can create a sql dump of the recovered tables using the following command

mysqldump -p recovery > recovered-tables.sql

Now everything is prepared and ready to be pulled into the damaged database and complete the recovery.

mysql -p <damaged_database_name> < recovered-tables.sql

The moral of the story is to always create multiple backups and make automated jobs to dump your database.

L’article Crap, I accidentaly deleted ibdata1.. est apparu en premier sur Azkali.

]]>
https://azka.li/crap-i-accidentaly-deleted-ibdata1/feed/ 0 177
Porting Ubuntu Touch on the Z Fold 3 https://azka.li/porting-ubuntu-touch-on-the-z-fold-3/ https://azka.li/porting-ubuntu-touch-on-the-z-fold-3/#respond Fri, 14 Oct 2022 06:02:33 +0000 https://azka.li/?p=148 Porting ubuntu touch on the Z Fold 3

L’article Porting Ubuntu Touch on the Z Fold 3 est apparu en premier sur Azkali.

]]>

0. Prerequisites

Before getting started with the port, a few things needs to be sorted out, either because they are mandatory or will get very useful down the road.

  • Unlock the bootloader
  • Rooting with magisk
  • Flashing TWRP
  • Decrypting userdata

I’ll only cover the parts that weren’t clear for me at first glance and leave as an exercise to the reader to figure the rest.

Make a backup here. Not later.

Unlock the bootloader follow this tutorial

You can download samsung FW update here.

Create a tar archive containing boot.img and vbmeta.img exracted from the FW update you downloaded previously.

In magisk app, patch the tar archive, reboot to download mode then use odin (or heimdall if your PC is running Linux) and flash your tar archive in the AP slot.

Download my TWRP image from here then flash it in the AP slot.

Boot TWRP (poweroff -> plug to a computer + press volume up + power button)

In TWRP, first go to Advanced->Terminal and run multidisabler then format /data make sure to have it decrypted.

You can restore your backup here.

1. GKI in a nutshell

During the port I had a lot of trouble understanding how the GKI (Generic Kernel Image) was supposed to work and what was going where.

As far as my understanding goes, the GKI is supposed to be a base that manufacturers / vendor use and apply their changes on top of.

The kernel Image gets to the boot.img while the modules go into vendor_boot.img, both partitions contains a ramdisk, boot.img contains a first_stage_ramdisk and the vendor_boot.img the second stage.

2. Halium boot

Once I had this figured out I began editing the main boot.img, I choose to have all the drivers builtin instead of repacking the vendor_boot.img.

Since the device should support it, I decided to follow the standalone kernel porting method.

This method consist of repacking a new boot.img containing the edited kernel Image with halium changes and halium ramdisk. The ramdisk is responsible of preparing the partitions, mounting the ubuntu touch GSI (Generic System Image) as well as ubuntu touch rootfs. Both are contained within the userdata partition (this is why we had to decrypt it in TWRP so halium ramdisk can access it).

The first issue I stumbled upon was that the kernel cmdline is set and enforced by the bootloader, but ubuntu touch requires console= to be set to an actual tty to boot, where in this case the console parameter was set to null. After discussing with @NotKit on UBport telegram channel I picked a printk commit which enforces console but since I don’t like editing kernel libraries, I ended up having the kernel enforce the full cmdline including my changes.

Second issue, vndkservicemanager doesn’t work well when SELinux is not prepared by the first stage ramdisk (which we don’t have anymore since halium-boot.img was flashed in place of android’s boot.img), @NotKit shared an edited vndkservicemanager which overrides android’s.

A few firmware issues later (which I embedded into the kernel directly) I finally see Unity8 splashscreen BUT since the Fold has 2 displays, and, unity8 doesn’t currently support multiple displays properly, @NotKit shared an edited version of unity8 shell that works around this issue.

3. Fixing issues – Ubuntu touch overlay

At first glance many things where not working… No WiFi, no GSM, no cameras, no cellular data, no audio, wrong orientation, defaulting to desktop modemintead of tablet and so on. As of now I haven’t got around all of those issues but I’ll share how I fixed some of them.

For audio and GSM, a few configuration files overlayed on the system where enough (see the relevant link for the halium overlay sources) and those issues where gone.

Making WiFi works was a troublesome experience. By checking similar SoC overlays with existing ubuntu touch ports, the first thing required is to load the IPA firmware, good, but that’s not enough, in AOSP a kernel module is loaded responsible for setting up the wlan chardev (/dev/wlan) but this module isn’t built by the kernel. It turns out that the module was simply missing in the kernel sources distributed by samsung… After searching github I came across this kernel for an asus device with the same SoC and it turns out that it pulls a few commits for the wlan driver.

WiFi works, but bluetooth was lost in the battle….

And that’s all I got working for now.

4. Remaining issues

Ubuntu touch requires apparmor in order to function properly, cameras are likely to be affected by apparmor not working. Since the second stage ramdisk in vendor_boot requires SELinux for it’s setup, but, LSM (Linux Security Module) can’t stack multiple major modules Apparmor is currently disabled because SELinux is loaded first.

After pulling the driver to make wlan work, bluetooth isn’t starting anymore.

Cellular data doesn’t work, I am currently thinking that it could be caused by a setup issue or a missing driver issue (like the wlan one) or both.

Orientation and desktop mode are likely due to the system image build.prop being set to Generic/halium_arm64 but since ubuntu-session and deviceinfo requires build.prop to be set to a specific device so they can use the proper device configuration files.

5. Additional Notes

Special thanks to :

@NotKit for his precious help with the port.

Everyone involved with Ubuntu Touch.

Useful links and sources

Samsung Z Fold 3 sources (kernel, TWRP and ubuntu touch overlay)

L’article Porting Ubuntu Touch on the Z Fold 3 est apparu en premier sur Azkali.

]]>
https://azka.li/porting-ubuntu-touch-on-the-z-fold-3/feed/ 0 148
ChromiumOS on Switch part. 1 https://azka.li/chromiumos-on-switch-part-1/ https://azka.li/chromiumos-on-switch-part-1/#respond Mon, 15 Aug 2022 14:19:10 +0000 https://azka.li/?p=97 Porting ChromiumOS on the Switch

L’article ChromiumOS on Switch part. 1 est apparu en premier sur Azkali.

]]>
Why chromiumOS ?
  1. Xorg + Desktop Environments on touch based devices are not mature enough, especially when paired with Nvidia hardware (greatly limited by bugs in their BSP).
  2. As ChromiumOS is based on Gentoo, this port has a base I can take advantage of, thanks to the previous work of bell07 and Gavin_Darkglider on their gentoo overlay for the switch.
  3. Google provides solid tools when it comes to creating an easy experience for the end user (akin to what Microsoft can do with Windows) a few examples are CROSVM (virtualization tool) , ARCVM (android container), Linux container.. etc.. etc..

Building the base

Starting from the gentoo overlay, adaptations need to be made to the base.
We’ll start from by creating a new profile called base which will reflect chromiumOS guidelines.

For this project I’ll start from ChromeOS kernel 5.15 and pick my mainline fork patches for the switch on top.

We’ll also need to use our own mesa package and to take advantage of nouveau OpenGL support and upcoming NVK (nouveau vulkan support).

Sources

ChromiumOS overlay
ChromiumOS kernel
Gentoo switch overlay

L’article ChromiumOS on Switch part. 1 est apparu en premier sur Azkali.

]]>
https://azka.li/chromiumos-on-switch-part-1/feed/ 0 97