Skip to content

Installing

Oscar Allegro edited this page Oct 2, 2025 · 9 revisions
-* WARNING!!! *-

This tutorial involves modifying
patitions and working with Linux
as a whole.
I am not responsible for any
damage made to said device,
and I will not take responsibility.

-* WARNING!!! *-

Part 1: What we'll do

In this tutorial I'll show you how we can install RedDeb, aka Redmi Debian, on a device. This tutorial is able to install, but not limited to: Ubuntu, Debian, Alpine and more, all on your phone (Altought we will be installing Alpine). To do this, you'll need:

  1. Your phone (we'll cover the Redmi Note 11 with the spesnd kernel here).

  2. An USB-C hub with charging capabilities. Any will work fine.

  3. A USB keyboard and mouse (you can use a wireless dongle if you have one).

Part 2: The setup

To start, you'll need Termux. You should already be comfortable using it, or at least be comfortable using Linux.

First, type in this command:

sudo bash -c 'bash - <(curl --silent https://raw.githubusercontent.com/moby/moby/master/contrib/check-config.sh)'

This will spit out some things. What you wanna look for are these:

- CONFIG_NAMESPACES: enabled
- CONFIG_NET_NS: enabled
- CONFIG_PID_NS: enabled
- CONFIG_UTS_NS: enabled
- CONFIG_CGROUPS: enabled
- CONFIG_CGROUP_CPUACCT: enabled
- CONFIG_CGROUP_DEVICE: enabled
- CONFIG_CGROUP_FREEZER: enabled
- CONFIG_CGROUP_SCHED: enabled

If one of them is set to missing, then you'll need to find a kernel that supports it or you'll need to build it yourself (remember, this tutorial is for spes only, but it can be used for other devices as well if some thinkering it put into it).

Then type in:

sudo zcat /proc/config.gz | grep "CONFIG_EXFAT_FS=y"
sudo zcat /proc/config.gz | grep "CONFIG_EXT4_FS=y"

This should give output for both, if not, then you'll need to find a kernel that supports it or you'll need to build it yourself.

After checking, type in:

apt update && apt upgrade && apt install exfatprogs parted git root-repo && apt install lxc

This will install mkfs.exfat and LXC, which will be needed.

-* WARNING!!! *-

The following repo we will be using
has a chance of freezing the
device after exiting Termux,
this is not the kernel's fault,
and it will not break your device.
A forced-reboot by holding the power
button until the screen turns black
should be enough to un-freeze it.
This is because of CGroups2,
the thing that Android uses
by default, but this repo
automatically unmounts it.

-* WARNING!!! *-

Execute these commands in order:

git clone https://github.com/George-Seven/Termux-LXC-Guide
bash ~/Termux-LXC-Guide/setup-termux-lxc.sh
lxc-create --name alpine -t alpine -- --release edge
sudo chroot $PREFIX/var/lib/lxc/alpine/rootfs usr/bin/env - passwd root

Type in a password you would like for the root user, this is necessary and you'll need to remember it. Then do:

lxc-start -Fn alpine

Let it start for a while. Then type in root, press enter, and then your password that you choose. You should now be logged in.

First thing you need to do:

apk update
apk upgrade
apk add make clang lld coreutils bash git e2fsprogs exfatprogs command-not-found shadow
chsh

A list should come up, type in bash, enter, and then type in exit. Re-login into root and you should have bash now. It is very similar to ash so you need to check by doing:

help echo

There should lot's of text, if there isn't, then something went wrong.

After this, clone RedDeb:

git clone https://github.com/SCOS100/RedDeb
cd RedDeb

This part is where it gets tricky, you need an SD-Card of at least 16GB, and you need to acknowledge the fact that it needs to be formatted, there isn't a way to just drop in exFAT, so backup all the data on it or copy it somewhere else.

Next with one finger hold onto the top part of the screen (where the clock is) and slide from the right side of the screen to the other with another finger. A menu in Termux should slide into view. In there, press NEW SESSION and then type in:

sudo bash

This should get you into root mode, identified with the # symbol next to the pointer (the white block). Next type in

parted /dev/block/mmcblk0

This should open up parted, if it errors with No such file or directory. or anything similar to that, then check that the SD-Card is inserted correctly. Now, with all the courage you have, do:

mklabel gpt

and type in yes, and press enter.

Congratulations, you have just erased your SD-Card! Now, type in:

mkpart data fat32 0 100%

Press enter, then type in i and press enter again. You can now quit parted with q and enter.

Remove the SD-Card from your phone and put it in again, this should refresh the partitions. Now type in:

mkfs.exfat /dev/block/mmcblk0p1

This should finally make the partition usable for us. Next type in exit, enter, and then exit again. This should get you back into LXC. Here, type in:

make

It will prompt you to insert the device's codename if your SoC is supported, if not, check Porting. Let it do it's thing, it will take a long time, around 20-30 minutes, even with the fastest of SD-Cards.

It will then show this:

New password:

This will be your user password, type in one, and confirm it by typing it again.

With that done, it should now finish up and prompt you to install the installer.zip from the SD-Card in OrangeFox Recovery. (Note: RedDeb requires OrangeFox, which is provided for spes on the official website)

Rebooting into OrangeFox, you need to press the tiny text on the bottom of the search bar, and press SD-Card. This will get you to the SD-Card. Press installer.zip and then Install.

It will take a few seconds or minutes depending on how much data you are holding in Android (I know, weird thing).

After that, press Back, go into the Options menu using the bottom menu buttons, press Reboot and then on the bottom press the slot that is black/unactive. You'll know it's unactive as the other one is filled with white. After a few seconds press Reboot System when it appears, and you'll reboot.

Congratulations, you successfully installed RedDeb! After 10 seconds you'll boot and you can plug in the phone to a computer for ADB or Serial Console, or you can use the USB-C Hub with the Keyboard to login.

The username for RedDeb is reddeb, and the password is the one you chosen.

This environment does not have Wi-Fi, but you can use reverse tethering for it. There are tons of tutorials for this on the internet.

Part Extra: Next?

Now that you have RedDeb you can do a lot of things, remember, this is real Alpine, no tricks, so everything works (and surprisingly NFC does too).

You could make it a Server, a portable PC, anything you can imagine.

Clone this wiki locally