Dual Boot Linux and Android on spes

canute
3 min readSep 28, 2023

--

Disclaimer : All your data will be erased ! Make sure to backup.

Step 1 :

  • Process — Flash MIUI (strictly Android 11) Fastboot ROM
  • Link or similar— (dont worry spes and spesn ROMs are inter-compatible; make sure to download the fastboot type = 5.8 GB not the recovery type)
  • Details —
  • 1. Go to Fastboot mode (Power + Volume Down)
  • 2. extract the .tgz file, then use sudo ./flash_all.sh on linux (for windows, you can find guides to flash Xiaomi fastboot roms online). The process will take several minutes
  • 3. MIUI will soon try to boot, let it boot or not idc, Go Again to Fastboot Mode

Step 2 :

  • Process — Flash Android
  • In Fastboot mode, boot TWRP : fastboot boot Location_to_twrp.img
  • TWRP will boot, Go to Mount -> Mount everything you can (USB-OTG will fail ofc). Then tap back, Go to Wipe -> Advance Wipe -> Format Data -> type yes
  • TWRP -> tap home button -> Go to Reboot -> At bottom, you will see your current active slot.
  • Assuming you have your Android ROM in your SD card or OTG Cable, Flash the zip file using the Install section on TWRP home.
  • During Flashing, the terminal will inform you that it is flashing the Android ROM to inactive Slot. Wipe Dalvik after flashing.

Step 3 :

  • Process— Flash DFE
  • Go to Reboot -> Power Off -> Go to Fastboot mode again ! -> Boot twrp from fastboot again -> Go to Install -> Flash DFE (put the zip file in Internal storage or sd card etc)
  • When Flash DFE, it will ask you to select language and config, use default config
  • Now Boot to your Android ROM ; on TWRP Home-> Reboot -> Reboot to system
  • Now Go to Fastboot mode again and boot twrp again :(

Step 4 :

Step 5 : bootctl

  • You are already dual-booting but In order to boot the other OS, changing slots via Fastboot or TWRP can be time consuming. Thus, we will use bootctl tool to change slots from withing the OS.
  • Droidian comes preinstalled with bootctl ; use android_bootctl set-active-boot-slot 0 or android_bootctl set-active-boot-slot 1 in Droidian’s terminal where 0 = A and 1 = B.
  • For android we will use a magisk module (magisk is already installed with dfe on your Android, you need to set it up) named bootctl. Flash this magisk module using the magisk app.
  • We can use a gui app to switch slots on android, install this apk, give root access and switch slots with one tap !

Step 6 :

  • Process — Resize storage for droidian
  • Go to fastboot -> TWRP -> Advance -> Terminal
  • use :
  • e2fsck -fy /data/rootfs.img
    resize2fs /data/rootfs.img 40G
  • to give 40 GB or any number you like to droidian !

--

--