[Xiaomi Mi Pad 5] tom.android:
*Thank you very much for your help, MR.TheMagicMojoMan.

* This tutorial is in an early stage, I will hide all complexity as much as possible when we deal with installation.

** Download. V1 images

share/nabu/images/v1 • Directory Lister

Yet another directory listing, powered by Directory Lister.

timoxa0.su

Don't worry about back and forth , back to Stock MIUi or Linux Re-installation.

View attachment 6097763

View attachment 6097765

View attachment 6097766

>Recommended: ( Not founded any error or trouble during installation)

> Unlocked BootLoader

1. Platform & Firmware: MIUI 14 Stock ROM Global ( Fastboot): https://xiaomifirmwareupdater.com/miui/nabu/stable/V14.0.8.0.TKXMIXM/

2. internal memory : 256 GB ( Divided 128 (Android) / 128 ( Linux )

3. computer with Win-11.

4. BootLoader ( fastboot ) driver.

View attachment 6098827

View attachment 6098830​

​

Preparing your device​

# Download platform-tools archive extract it , put (vbmeta_disabled.img & orangefox.img ) into platform-tools folder.

⚠️ Warning

[ Don't use orangefox.img as general custom recovery.]

# Open your computer and store ( platform-tools Folder at C:/ )

# Open your Mipad 5 ,start MIUI Android and enable USB Debugging.( Developer options )

# Connect Computer with Mipad , Open Search and Type "CMD" + run as Administrator. CD to "C:/platform-tools folder.

C:\Windows\System32>cd "C:\platform-tools-linux"

# reboot from Andrid to Fastboot mode.

adb reboot bootloader

# flash mod vbmeta

fastboot flash vbmeta_ab vbmeta_disabled.img

output:

Warning: skip copying vbmeta_ab image avb footer (vbmeta_ab partition size: 0, vbmeta_ab image size: 4096).

Sending 'vbmeta_ab' (4 KB) OKAY [ 0.011s]

Writing 'vbmeta_ab' (bootloader) Partition vbmeta_a flashed successfully

(bootloader) Partition vbmeta_b flashed successfully

OKAY [ 0.006s]

Finished. Total time: 0.071s

# flash orangefox to memory ( For manage partition only)

fastboot boot orangefox.img

output:

Sending 'boot.img' (62256 KB) OKAY [ 1.367s]

Booting OKAY [ 0.356s]

Finished. Total time: 1.837s

#Make new partition

adb shell partition

output:

run the script again!

adb shell partition

output:

The operation has completed successfully.

F2FS-tools: mkfs.f2fs Ver: 1.16.0 (2023-12-07)

Info: Disable heap-based policy

Info: Debug level = 1

Info: Trim is enabled

Info: Set conf for android

Info: Enable Project quota

Info: [/dev/block/sda31] Disk Model: SDINFDK4-256G

Info: Segments per section = 1

Info: Sections per zone = 1

Info: sector size = 4096

Info: total sectors = 28351488 (110748 MB)

Info: zone aligned segment0 blkaddr: 512

Info: add quota type = 0 => 4

Info: add quota type = 1 => 5

Info: add quota type = 2 => 6

Info: format version with

"Linux version 4.14.180-perf-g71b6effd2-dirty (map220v@WIN-1R1L4Q3NJTE) (clang version 10.0.9, GNU ld (binutils-2.27-44492f8e) 2.27.0.20170315) #52 SMP PREEMPT Tue May 30 17:42:14 MSK 2023"

Info: [/dev/block/sda31] Discarding device

Info: This device doesn't support BLKSECDISCARD

Info: Discarded 110748 MB

[f2fs_init_sit_area: 638] Filling sit area at offset 0x00600000

[f2fs_init_nat_area: 672] Filling nat area at offset 0x00e00000

[f2fs_add_default_dentry_root:1255] Writing default dentry root, at offset 0x1d400

[f2fs_write_root_inode:1300] Writing root inode (hot node), offset 0x1ce00

[f2fs_write_default_quota:1386] Writing quota data, at offset 0001d401 (1/2)

[f2fs_write_default_quota:1386] Writing quota data, at offset 0001d402 (2/2)

[f2fs_write_qf_inode:1438] Writing quota inode (hot node), offset 0x1ce01

[f2fs_write_default_quota:1386] Writing quota data, at offset 0001d403 (1/2)

[f2fs_write_default_quota:1386] Writing quota data, at offset 0001d404 (2/2)

[f2fs_write_qf_inode:1438] Writing quota inode (hot node), offset 0x1ce02

[f2fs_write_default_quota:1386] Writing quota data, at offset 0001d405 (1/2)

[f2fs_write_default_quota:1386] Writing quota data, at offset 0001d406 (2/2)

[f2fs_write_qf_inode:1438] Writing quota inode (hot node), offset 0x1ce03

[f2fs_discard_obsolete_dnode:1134] Discard dnode, at offset 0x0001d000

[f2fs_update_nat_default:1474] Writing nat root, at offset 0x00000e00

Info: Overprovision ratio = 0.430%

Info: Overprovision segments = 241 (GC reserved = 239)

[f2fs_write_check_point_pack: 853] Writing main segments, cp at offset 0x00000200

[f2fs_write_check_point_pack: 941] Writing Segment summary for HOT/WARM/COLD_DATA, at offset 0x00000201

[f2fs_write_check_point_pack: 955] Writing Segment summary for HOT_NODE, at offset 0x00000202

[f2fs_write_check_point_pack: 967] Writing Segment summary for WARM_NODE, at offset 0x00000203

[f2fs_write_check_point_pack: 978] Writing Segment summary for COLD_NODE, at offset 0x00000204

[f2fs_write_check_point_pack: 987] Writing cp page2, at offset 0x00000205

[f2fs_write_check_point_pack:1006] Writing NAT bits pages, at offset 0x000003fe

[f2fs_write_check_point_pack:1027] Writing cp page 1 of checkpoint pack 2, at offset 0x00000400

[f2fs_write_check_point_pack:1046] Writing cp page 2 of checkpoint pack 2, at offset 0x00000405

[f2fs_write_super_block:1080] Writing super block, at offset 0x00000000

Info: format successful

mke2fs 1.43.3 (04-Sep-2016)

Discarding device blocks: done

Creating filesystem with 4096 4k blocks and 4096 inodes

Allocating group tables: done

Writing inode tables: done

Creating journal (1024 blocks): done

Writing superblocks and filesystem accounting information: done

mkfs.fat 3.0.28 (2015-05-16)

mke2fs 1.43.3 (04-Sep-2016)

Discarding device blocks: done

Creating filesystem with 30761728 4k blocks and 7692288 inodes

Filesystem UUID: b51c1480-b155-4b7d-ae2d-dda07b497c97

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done

Writing inode tables: done

Creating journal (131072 blocks): done

Writing superblocks and filesystem accounting information: done

done!

#Bakup dtbo.img

adb shell backupdtbo

output:

65536+0 records in

65536+0 records out

33554432 bytes transferred in 0.184 secs (182361043 bytes/sec)

# keep backup into platform-tools folder

adb pull /tmp/dtbo.img

output

/tmp/dtbo.img: 1 file pulled, 0 skipped. 33.6 MB/s (33554432 bytes in 0.952s)

# Slide open orangefox custom recover , select reboot to android system.

# Device will be set to factory reset due to new partition were change and resize from 256GB to 128GB.

# check partition size =17.0GB/128GB ---enable USB debugging.

# Enabe Developer options. Enable USB Debugging. Check OEM Unlocked status.

------End Resize stock parition & create linux partition Step--------

==> Next step: Installing Linux​

#Download "arch.img" & "linux-6.1.10-nabu-gc033672c6f54.boot.img" keep it in platform-tools folder.

# Run CMD as adminstrator and CD to platform-tool folder.

# Boot to fastboot mode.

adb reboot bootloader

# Flash arch.img to linux partition.

fastboot flash linux arch.img

#Reboot to bootloader

fastboot reboot bootloader

# Erase dtbo

fastboot erase dtbo

#Temporary boot Linux from memory

fastboot boot linux-6.1.10-nabu-gc033672c6f54.boot.img

# Initial Setup Arch linux ,

Don't forgot to enable "onscreen keyboard" new initial setup program does work correctly with the touch screen.

#Do dot disconnect tablet from pc until it boots to initial setup till end.

# Restart Arch Linux

View attachment 6097792

# Complete initial setup linux and reboot the tablet into bootloader

# Restore dtbo backup

fastboot flash dtbo dtbo.img

#Reboot tablet into android

fastboot reboot

----------End install Linux----

Set up dualboot​

Download my patched magisk boot image ( for MIUI14 ) Global V14.0.8.0.TKXMIXM

# Root

fastboot flash boot magisk_patched.img

//Reboot to Android

fastboot reboot

#Final flash UEFI installer with magisk manager.

View attachment 6097952

View attachment 6098680

==================

Post installation

==================

Install Thai font for Arch linux.

⚠️ Warning

Do'nt update with

// sudo pacman -Syu

// you will lost

"long press on screen = simulate a right click"​

// Gnome File (nautilus-45.2.1) will update to 46.1.1

You must uses mouse if you update it.

# yay installation

sudo pacman -S git -y

git --version

sudo pacman -S --needed base-devel git

git clone https://aur.archlinux.org/yay.git

//if error use this instread.
git clone https://aur.archlinux.org/yay-bin.git

cd yay

makepkg -si

yay --version

yay -S fonts-tlwg

//[A] + [I]

# Change locale

sudo nano /etc/locale.gen

//// use en_US ISO-8859-1 , th_TH.UTF-8 UTF-8 , th_TH TIS-620

//// comments ru_RU.UTF-8

sudo locale-gen

//log out

# Keyboard Setting

View attachment 6097799

View attachment 6097809

View attachment 6097810

How to change the language of your desktop on ArcoLinux or Arch Linux – ANY DESKTOP | ArcoLinux

# Install Firefox (thai font supported )

yay -S firefox

# Test performance.

View attachment 6097964

# Auto-cpufreq

View attachment 6098137

git clone https://github.com/teerasak/auto-cpufreq.git

cd auto-cpufreq

sudo ./auto-cpufreq-installer

sudo auto-cpufreq --install

sudo systemctl status auto-cpufreq

sudo auto-cpufreq --stats

Note: sudo auto-cpufreq --remove

# Back to Stock MIUi.

1. Restore original partition. https://github.com/timoxa0/Guide-Linux-Nabu/blob/main/guide/English/uninstall-en.md

fastboot flash partition:0 gpt_both0.bin
fastboot -w

2. Make sure by flash original fastboot firmware.

-Stock ROM ( Fastboot): https://xiaomifirmwareupdater.com/miui/nabu/stable/V14.0.8.0.TKXMIXM/

3. Extract fastboot firmware into platform-tools folder

4. open CMD Admin mode

flash_all.bat

=====================

# Any 2-cents wireless earphones can help you with this thing.

pactl info

output:

Server String: /run/user/1000/pulse/native

Library Protocol Version: 35

Server Protocol Version: 35

Is Local: yes

Client Index: 265

Tile Size: 65472

User Name: tom

Host Name: mipad5

Server Name: PulseAudio (on PipeWire 1.0.5)

Server Version: 15.0.0

Default Sample Specification: float32le 2ch 48000Hz

Default Channel Map: front-left,front-right

Default Sink: bluez_output.60_3A_AF_18_51_16.1

Default Source: bluez_output.60_3A_AF_18_51_16.1.monitor

Cookie: 3230:e9e9

[tom@mipad5 ~]$

# Correct sound (which still might be choppy)

sudo pacman -S libldac pipewire pipewire-pulse

Reboot your machine.

# JamesDSP for Linux

Open-source audio effect processor for Pipewire. ( install from Software app )

View attachment 6098716.

View attachment 6098717

View attachment 6098718

View attachment 6098721

View attachment 6098722

View attachment 6098724

Backup / restore with Timeshift

Guide to Backup and Restore Linux Systems with Timeshift

This beginner's guide shows you how to back up and restore Linux systems easily with the Timeshift application.

itsfoss.com

yay -Sy timeshift

sudo pacman -Ru snapd

//update
sudo pacman -Syu