Performance-optimized Ubuntu Touch for the Lenovo Tab M8 HD (TB-8505F) — custom kernel with KSM, ZSWAP, BBR, and more, plus browser/system performance tuning, boot experience improvements, and system-level fixes.
Built on top of k.nacke's original UBports port.
| Component | Details |
|---|---|
| Model | Lenovo Tab M8 HD (TB-8505F) |
| SoC | MediaTek Helio A22 (MT6761), 4× Cortex-A53 @ 2.0 GHz |
| RAM | 2 GB LPDDR3 |
| Storage | 32 GB eMMC |
| Display | 8" IPS 800×1280 |
| GPU | PowerVR GE8320 |
| Kernel | Linux 4.9.190+ (custom, see below) |
| OS | Ubuntu Touch 24.04 (Noble) |
This project includes a custom-compiled kernel built from the redstar-team halium-10-4.9 source using the exact UBports CI toolchain (Android prebuilt clang 9.0.3 + GCC 4.9).
| Feature | Config | What It Does |
|---|---|---|
| KSM | CONFIG_KSM=y |
Deduplicates identical memory pages — critical on 2GB RAM |
| ZSWAP | CONFIG_ZSWAP=y |
Compresses swap pages in RAM before hitting eMMC |
| FRONTSWAP | CONFIG_FRONTSWAP=y |
Backend for ZSWAP |
| ZBUD / Z3FOLD | CONFIG_ZBUD=y, CONFIG_Z3FOLD=y |
Compressed page allocators (2:1 and 3:1 ratios) |
| CLEANCACHE | CONFIG_CLEANCACHE=y |
Compressed clean page cache |
| TCP BBR | CONFIG_TCP_CONG_BBR=y |
Google's congestion control — faster WiFi throughput |
| BPF JIT | CONFIG_BPF_JIT=y |
JIT-compiled packet filters |
| JUMP_LABEL | CONFIG_JUMP_LABEL=y |
Runtime code patching — eliminates branch overhead |
| SLAB_FREELIST_RANDOM | CONFIG_SLAB_FREELIST_RANDOM=y |
Memory allocator security hardening |
| FRAMEBUFFER_CONSOLE | CONFIG_FRAMEBUFFER_CONSOLE=y |
Kernel debug console on display |
| DEBUG_INFO disabled | CONFIG_DEBUG_INFO=n |
Smaller kernel image (~10-15MB saved) |
A systemd service (kernel-optimizations.service) activates features on every boot:
- KSM page scanning enabled (200ms interval)
- ZSWAP enabled with LZO compression
- TCP congestion control set to BBR
- BPF JIT enabled
- I/O scheduler set to deadline (optimal for eMMC)
See kernel/build_instructions.md for full build and flash instructions.
These apply on top of the custom kernel and don't require recompilation:
- CPU governor — 1056 MHz floor, PPM SYS_BOOST enabled
- EAS scheduler — top-app boost 10%, foreground boost 5%
- I/O scheduler — deadline with 256KB read-ahead, iostats disabled
- Memory management — tuned swappiness, dirty ratios, min_free_kbytes
- zRAM — increased from 1 GB to 1.5 GB with LZ4 compression
- PSI-based OOM guard — proactive memory pressure monitoring
- Custom boot logo — replaces Lenovo/Android logo
- Orange state warning removed — patched LK bootloader
- Framebuffer boot status — renders systemd boot progress on display
- QtWebEngine tuning — single renderer process, JS heap 128MB, GPU memory 64MB, VP9 disabled (H.264 faster on ARM), 4 raster threads, zero-copy rasterization
- Browser cache on tmpfs — 64MB RAM-backed cache for faster page loads
- Process priority tuning — browser/Lomiri nice -5, ksmd nice 19 + idle I/O
- Network tuning — TCP Fast Open, 256KB buffers, no slow start after idle
- VM tuning — swappiness=60, vfs_cache_pressure=200, overcommit=1
- CPU governor — locked to
performance(all cores at max frequency) - eMMC readahead — 512KB (up from 128KB)
- Boot console disabled — no garbled fbcon text on display
- mpv + yt-dlp — YouTube outside the browser (~30MB RAM vs ~800MB)
ytcommand —yt <youtube-url>for 720p H.264 playback via mpv
- PulseAudio tuning — larger fragment buffers, disabled timer-based scheduling
- Bind mounts — apt cache and logs moved to
/homepartition - Locale cleanup — removed unused locales
- Package cleanup — removed unnecessary packages
├── configs/ # Systemd services and config files
│ ├── performance-tuning.service # CPU, memory, I/O, network tuning
│ ├── zram-resize.service # zRAM 1.5GB resize
│ ├── psi-oom-guard.service # PSI-based OOM guard
│ ├── boot-status-display.service # Framebuffer boot status
│ └── pulse/ # PulseAudio audio fix
│ ├── 99-fix-crackling.pa
│ └── 99-fix-crackling.conf
├── scripts/
│ ├── boot_status.py # Framebuffer boot status renderer
│ ├── fix_fonts.sh # Fix missing/blank characters (font fix)
│ ├── optimize_performance.sh # Browser & system performance optimizations
│ ├── psi-oom-guard.sh # PSI-based OOM killer
│ ├── install.sh # One-shot installer
│ └── verify.sh # Post-install verification
├── patches/
│ ├── patch_lk.py # LK bootloader orange state removal
│ └── replace_logo.py # Custom boot logo replacement
├── kernel/
│ ├── build_optimized_v3.sh # Kernel build script (proven, tested)
│ ├── kernel-optimizations.service # Boot-time kernel feature activation
│ ├── build_instructions.md # Step-by-step build & flash guide
│ └── defconfig_changes.md # All config changes documented
├── docs/
│ ├── CHANGELOG.md # Version history (semver)
│ ├── KNOWN_ISSUES.md # Known issues and workarounds
│ └── CONTRIBUTING.md # How to contribute
├── LICENSE # MIT License
└── README.md # This file
- Lenovo Tab M8 HD (TB-8505F) with unlocked bootloader
- Ubuntu Touch installed (original port by k.nacke)
- ADB access (platform-tools v29.0.5 recommended for this device)
- Developer mode enabled with a phablet password set
See kernel/build_instructions.md for building from source, or use a prebuilt image from Releases.
# Reboot to fastboot
adb shell "echo YOUR_PHABLET_PASSWORD | sudo -S reboot bootloader"
# Flash the optimized boot image
fastboot flash boot boot_optimized.img
fastboot reboot# Push all project files to the device
adb push . /tmp/ut-optimize/
# Run the installer
adb shell "echo YOUR_PHABLET_PASSWORD | sudo -S sh /tmp/ut-optimize/scripts/install.sh"
adb rebootadb shell "echo YOUR_PHABLET_PASSWORD | sudo -S sh /tmp/ut-optimize/scripts/verify.sh"python patches/patch_lk.py
adb reboot bootloader
fastboot flash lk lk_patched.bin
fastboot flash lk2 lk_patched.bin
fastboot rebootIf the new kernel doesn't boot:
- Hold Volume Down + Power to enter fastboot
- Flash the original boot image:
fastboot flash boot original_boot.img - Or use Lenovo Rescue and Smart Assistant to restore stock Android
See docs/KNOWN_ISSUES.md. Key issues:
Missing/blank characters— Fixed in v2.1.0 (Qt distance field rendering bug on PowerVR GPU)- Keyboard text slightly washed out — cosmetic side effect of the distance field fix (see KNOWN_ISSUES.md)
- Audio crackling — mitigated by PulseAudio tuning in this project
- Back camera cloudy — hardware/driver issue, no fix yet
- Tap to wake — not supported by current kernel
- k.nacke / redstar-team — Original Ubuntu Touch port and kernel source
- CoderCharmander — Published Lenovo stock kernel source
- UBports Community — Ubuntu Touch OS
- thephfox — Custom kernel build, performance optimizations, and this project
This software modifies low-level device components including the bootloader, kernel, and system services. Improper use may render your device unbootable or cause data loss. The author(s) are not responsible for any damage to devices, data, or other property. Use entirely at your own risk.
Always keep a backup of your original boot image before flashing.
This project is dual-licensed (see LICENSE):
- Scripts, configs, patches, docs — MIT License. Credit thephfox if you reuse.
- Kernel modifications — GPL v2, per the upstream Linux kernel license. If you distribute compiled kernel binaries, you must provide the corresponding source.