DebianOn is an effort to document how to install, configure and use Debian on some specific hardware. Therefore potential buyers would know if that hardware is supported and owners would know how get the best out of that hardware. The purpose is not to duplicate the Debian Official Documentation, but to document how to install Debian on some specific hardware. If you need help to get Debian running on your hardware, please have a look at our user support channels where you may find specific channels (mailing list, IRC channel) dedicated to certain types of hardware. |
Contents
What's not working
- USB OTG and camera do not work
- Should work with tweaks:
- Sensors (accelerometer, light sensor, proximity sensor)
- Bluetooth
- Suspend + wake on calls
Works with tweaks (see Notes:)
- Speakers (volume is too low)
- Audio calls
Support
If something isn't working for you, you can get in contact with Mobian developers and the Mobian community in various ways. All of them are listed here.
Installation
Obtain the Image
Pre-built images for your device will be packed in a file named mobian-<family>-<graphical_shell>-YYYYMMDD.tar.xz and can be downloaded from here https://images.mobian.org/qcom/weekly/. Same images are available both under folders sdm845 and qcom of https://images.mobian-project.org. Effective 2024-01-25, sdm845 and sm7225 images have been replaced by qcom ones: please refer to qcom images for newer images targeting these devices.
Verifying the images
Mobian images come with multiple files:
- .tar.xz: The archive containing the flashable images
- .sha256sum: A file containing the SHA256 hash of the archive.
- .sha256sum.sig: A detached signature for the .sha256sum file.
To verify the download, use the following steps:
Import the Mobian signing key from here. Once downloaded, the key can be imported with gpg --import mobian.gpg.
Verify the signature with gpg --verify <downloaded file>.sha256sum.sig.
If the signature is valid, check the other files with shasum -c <downloaded file>.sha256sums
- If this prints OK for all files the download is verified.
Preparing the Device
As you would do before installing a custom Android ROM, the bootloader needs to be unlocked. The exact procedure varies depending on the device you own, so we suggest you search the Internet for an unlock guide aimed at your specific device.
We also recommend that you upgrade Android to the latest available version and install all system updates before installing Mobian.
Flashing the Image to the Target Device
WARNING: Flashing Mobian to your device will wipe your Android installation! Please install a recovery software such as TWRP and make sure you understand how to recover your system before proceeding.
Those devices being Android smartphones in the first place, they have secure boot enabled, meaning we can't replace their bootloader and need to rely on Android tools in order to flash Mobian.
In practice, this means we can't flash a single image file, and the downloaded tarball will contain:
an Android bootimg containing the kernel, device-tree and initramfs named mobian-<processor>-phosh-YYYYMMDD.boot-<model>.img
an Ext4-formatted rootfs (using Android's sparse image format) named mobian-<processor>-phosh-YYYYMMDD.rootfs.img
Note: Up until 2023-10-22 the archives used to contain an additional image file named mobian-<processor>-phosh-YYYYMMDD.boot.img meant to be flashed to the system partition. This is no longer the case starting with the 2023-10-29 set of images.
As these devices have several variants, which differ only by the device-tree they need, and the DT being part of the bootimg, we provide one bootimg for each variant. You have to flash the one matching your device:
- SDM845:
Pocophone F1: use the beryllium-tianma variant first; if the touchscreen doesn't react to swipes, then switch to the beryllium-ebbg variant. If you know your display variant, you can pick this directly.
Note: If you are booting a weekly image, make sure it is at least 20240915 or newer. Older weekly images will not boot unless you remove console=ttyMSM0,115200 from cmdline in bootimg.cfg
Once you have extracted the files from the tarball, boot your device into fastboot mode, connect it to your computer using a USB cable and run the following commands to install Mobian:
fastboot flash boot mobian-<processor>-phosh-YYYYMMDD.boot-<model>.img
fastboot -S 100M flash userdata mobian-<processor>-phosh-YYYYMMDD.rootfs.img
fastboot erase dtbo
If all steps above succeeded, reboot your phone.
Fastboot mode
When the device is shut off, the xiaomi-beryllium can be put in fastboot mode by pressing and keeping pressed the power and volume down buttons, until a screen with a bunny and an android with a blue 'FASTBOOT' writing appears.
Notes:
General:
- If the device becomes unresponsive after a fastboot command succeeded, power it off and boot into fastboot mode again, then execute the remaining commands.
Audio
Instructions adapted from Debian on Oneplus6#Audio
Audio volume is too low. To make it work:
mask alsa-restore: sudo systemctl mask alsa-restore
Create /etc/wireplumber/wireplumber.conf.d/ if it does not exist and add a file named 51-qcom-sdm845.conf with the contents from https://gitlab.com/sdm845-mainline/linux/-/issues/48
monitor.alsa.rules = [ { matches = [ { # Matches all sources node.name = "~alsa_input.*" }, { # Matches all sinks node.name = "~alsa_output.*" } ] actions = { update-props = { audio.format = "S16LE" audio.rate = 48000 api.alsa.period-size = 4096 api.alsa.period-num = 6 api.alsa.headroom = 512, # session.suspend-timeout-seconds = 0 # dither.method = "wannamaker3", # add dither of desired shape # dither.noise = 2, # add additional bits of noise } and } } ]
Installing to an SD Card
The installation above is to the internal memory (UFS). There can be many reasons why you want to install to an SD card:
- You want to swap an installation between different phones.
- The **installation to internal memory might be broken**.
- For old versions: The UFS implementation might be broken for your combination of kernel and device and lead to IO errors.
Before proceeding you must have installed the same version to the internal memory, as described above, but flashing the rootfs.img should be left out (can lead to confusion with the root image that will be installed to the SD card). The steps for installing to an SD card (recommended at least 16 GB):
- On a PC, add a partition number 1 with filesystem ext4 to your SD card.
Convert the root image from sparse to non-sparse format: simg2img mobian-<processor>-phosh-YYYYMMDD.rootfs.img mobian-<processor>-phosh-YYYYMMDD.rootfs.raw
Write the .raw file to partition 1, determine which letter you should use as N in sdN1 to access the mentioned SD card: sudo dd if=mobian-<processor>-phosh-YYYYMMDD.rootfs.raw of=/dev/sdN1 bs=1M status=progress
- Move the SD card from the PC to the phone.
- Start the phone.
Default pin and password
The default user is **mobian** and has the password: **1234**. It is also used as PIN on the unlock screen.
The root-user is locked by default.
You should change the user password - please see ?changing password about the right way to do so. If you want to access your phone via ssh, you need to ?set it up to do so.
Automatic resizing of your filesystem on first boot
After flashing the image and booting for the first time, Mobian will resize the root filesystem to take all possible space on the disk. This can take a while and will only happen on first boot. So grab a ${DRINK_OF_CHOICE} and be patient.