Custom Android kernel for Redmi Note 8 (ginkgo) based on FlopKernel-Series with Droidspaces Linux containerization support integrated.
LICENSE: GPL v2 (consistent with Linux kernel)
DISCLAIMER: This is a learning project. The author is a beginner in kernel compilation and this repository is created for educational study purposes only. Use at your own risk.
This repository contains a custom-compiled Android kernel for the Redmi Note 8 (ginkgo) device. The kernel is built using FlopKernel-Series as the base source with the following integrated features:
Kernel Components:
- Base Kernel: 4.14.x (FlopKernel-Series)
- KernelSU Next: v1.1.1 (for root access)
- SUSFS: v1.5.9 (filesystem hiding)
- Droidspaces: Configuration for Linux containerization
Droidspaces (https://github.com/ravindu644/Droidspaces-OSS) is a lightweight tool that allows running full Linux distributions directly on Android devices using Linux kernel namespaces.
Key features:
- Run complete Linux systems (Ubuntu, Debian, Alpine) on Android
- Support for systemd and other init systems
- Process isolation without Termux or chroot limitations
- Network isolation support (Host, NAT, None modes)
- Small binary size (under 300KB)
- Works on both Android and Linux desktop
This kernel is compiled with configuration options to support all Droidspaces features.
To flash this kernel, you need:
- Device: Xiaomi Redmi Note 8 (codename: ginkgo) Also compatible with: Mi A3 (laurel_sprout), Redmi Note 8T (willow)
- Unlocked bootloader
- Custom recovery (TWRP recommended)
- ADB and fastboot tools installed on your computer
If you want to compile the kernel yourself, you need to install build tools on your Linux system.
Ubuntu or Debian:
sudo apt-get install -y build-essential clang-14 lld make git python3 bc flex bison ccache libelf-dev pahole openssl libssl-dev perl zstd binutils ncurses-dev
Arch Linux:
sudo pacman -S --needed base-devel clang lld make git python3 bc flex bison ccache libelf pahole openssl perl zstd binutils ncurses
This kernel is compiled with support for:
- Linux Namespaces (PID, MNT, UTS, IPC, CGROUP, NET)
- Cgroups v1 and v2
- OverlayFS
- SELinux
- User namespaces
To verify these features are present after flashing:
adb shell
cat /proc/config.gz | gunzip | grep -E "NAMESPACE|CGROUP|OVERLAY|SELINUX"
The pre-compiled kernel is available as a flashable ZIP file (created using AnyKernel3 template).
Step 1: Download the kernel ZIP file
- Find Floppy_custom-ginkgo-*.zip in the Releases section
Step 2: Transfer to device
adb push Floppy_custom-ginkgo-*.zip /sdcard/
Step 3: Boot into TWRP recovery
adb reboot recovery
Step 4: Install via TWRP
- In TWRP recovery interface, select "Install"
- Navigate to the downloaded ZIP file
- Swipe to confirm installation
- Wait for completion
- Reboot system
After rebooting, verify the kernel installed correctly:
adb shell
cat /proc/version
uname -a
The output should show version 4.14.x and device name ginkgo.
This section explains how to compile the kernel yourself. This is a learning exercise for understanding how Android kernels are built.
Before starting, ensure you have:
- Linux system (Ubuntu, Arch, or similar)
- All build dependencies installed (see Requirements section above)
- At least 20 GB free disk space
- Stable internet connection
- About 1-2 hours for first build (subsequent builds are faster)
git clone https://github.com/YOUR_USERNAME/kernel-ginkgo-droidspaces.git
cd kernel-ginkgo-droidspaces
chmod +x build.sh
Replace YOUR_USERNAME with the actual GitHub username where this repo is hosted.
Follow the installation commands in the Requirements section for your Linux distribution.
After installation, verify your compiler works:
clang --version
make --version
This step creates the kernel configuration file by combining the device-specific settings with Droidspaces settings.
./build.sh defconfig
This will create a .config file in the out/ directory.
Start the compilation. This takes time on first build.
./build.sh build
What happens during build:
- Compiler processes all kernel source files
- Progress shows which files are being compiled
- Build takes 30-60 minutes on first run
- Subsequent builds are faster due to caching (if ccache is installed)
When complete, you should see:
Build selesai!
And the final kernel image will be at:
out/arch/arm64/boot/Image.gz-dtb
Check that the kernel image was created:
ls -lh out/arch/arm64/boot/Image.gz-dtb
file out/arch/arm64/boot/Image.gz-dtb
The file should be 8-15 MB in size and identified as a gzip compressed file.
The AnyKernel3 directory contains the template for creating a flashable ZIP file.
cp out/arch/arm64/boot/Image.gz-dtb AnyKernel3/kernel/
cd AnyKernel3
zip -r ../Floppy_custom-ginkgo.zip . -x "*.git*"
cd ..
This creates Floppy_custom-ginkgo.zip which can be flashed to the device using TWRP.
Problem: Command not found errors Solution: Make sure all dependencies are installed. Re-run the pacman or apt-get commands from the Requirements section.
Problem: Build fails midway Solution: Check disk space with: df -h You need at least 20 GB free. If full, delete the out/ directory and try again: ./build.sh clean
Problem: Build takes very long Solution: This is normal for first build (30-60 minutes). You can check if it is actually compiling by running: top Look for clang or cc1plus processes.
Problem: Clang not found Solution: Verify clang is installed: clang --version If not found, ensure you installed build dependencies correctly.
Problem: Out of memory errors Solution: Reduce parallel jobs. Edit the build.sh script and change the -j flag to a smaller number (e.g., -j4 instead of -j$(nproc)).
This section describes what each directory and important file contains.
kernel/ - Linux kernel source code (version 4.14.x from FlopKernel-Series) arch/arm64/ - ARM64 architecture specific code configs/ - Device configuration files vendor/ginkgo.config - Device specific settings for Redmi Note 8 droidspaces.config - Kernel options for Droidspaces support fs/ - Filesystem code including SUSFS implementation drivers/ - Device drivers for various hardware
toolchains/ - Compiler tools for building the kernel clang/ - AOSP Clang compiler (not committed to this repo, only symlink)
patches/ - Patch files applied to kernel source droidspaces/ - Patches for Droidspaces support kernelsu/ - Patches for KernelSU integration susfs/ - Patches for SUSFS filesystem hiding
AnyKernel3/ - Template for creating flashable ZIP files kernel/ - Where compiled kernel image is copied ramdisk/ - Recovery ramdisk modifications anykernel.sh - Installation script
out/ - Build output directory (created after building) arch/arm64/boot/ - Final compiled kernel images Image - Uncompressed kernel (not used for this device) Image.gz - Compressed kernel Image.gz-dtb - Final kernel with device tree (this is what gets flashed)
build.sh - Build automation script Checks dependencies Generates configuration Compiles kernel Creates output
.gitignore - Specifies which files are not tracked by git README.md - This file
After successfully flashing this kernel to your device, you can use Droidspaces to run Linux containers.
Step 1: Install Droidspaces
- Download the Droidspaces APK from: https://github.com/ravindu644/Droidspaces-OSS/releases
- Install the APK on your Android device
- Grant necessary permissions when prompted
Step 2: Verify Kernel Compatibility
- Open the Droidspaces app
- Go to Settings
- Select "Requirements checker"
- The checker will show which kernel features are present
- All checks should show supported for this kernel
Step 3: Create a Linux Container Example: Creating an Ubuntu container
adb shell
droidspaces create ubuntu
Step 4: Start and Access the Container
droidspaces start ubuntu
droidspaces shell ubuntu
You should now have a shell prompt inside the Linux container. You can run Linux commands and install packages using apt or other package managers.
Note: First time container creation and startup takes time while it downloads and extracts the Linux filesystem. This can take 10-30 minutes depending on internet speed.
For detailed Droidspaces documentation and more advanced usage, see: https://github.com/ravindu644/Droidspaces-OSS
This section covers common problems and how to solve them.
Symptom: Device boots to fastboot or recovery instead of Android Solution steps:
- Verify bootloader is unlocked: fastboot flashing get_unlock_ability
- Try flashing the original kernel from Xiaomi to verify device hardware works
- Check TWRP is compatible with ginkgo model
- Ensure you are flashing Image.gz-dtb (not Image or Image.gz)
- Check recovery.img is for the correct device
Symptom: Droidspaces app shows unsupported or requirements fail Steps to check:
- Connect device with adb
- Run: adb shell cat /proc/config.gz | gunzip | grep "CONFIG_NAMESPACES"
- Should show: CONFIG_NAMESPACES=y
- Check SELinux mode: getenforce
- May need: setenforce 0 (requires root)
Symptom: Applications cannot get root access, KernelSU app shows errors Steps:
- Check if KernelSU is installed: adb shell su -v
- Verify KernelSU app is installed and updated
- Clear app cache and data, then restart
- Check device logs: adb logcat | grep -i kernelsu
- Check if SELinux is blocking: getenforce
- For debugging, set SELinux to permissive: setenforce 0
Symptom: Compilation errors, "command not found", or build stops with error Solution:
- Clean previous build: ./build.sh clean
- Verify disk space: df -h (need at least 20 GB free)
- Check Clang installation: toolchains/clang/bin/clang --version
- Verify dependencies installed correctly
- Check device logs: dmesg | tail -20 (on Linux build machine)
- If still failing, try with fewer parallel jobs (edit build.sh, change -j$(nproc) to -j4)
Symptom: Build progress is very slow, appears stuck Normal behavior:
- First build typically takes 30-60 minutes
- This is expected, not an error
- Verify it is actually running: top command should show clang or cc1plus processes
- Subsequent builds are much faster (5-15 minutes) if ccache is enabled
If it appears completely stuck for more than 2 hours:
- Check with top command if compiler is still running
- Check disk activity with: iostat 1 10
- If truly stuck, press Ctrl+C to stop and start over
Symptom: "clang: command not found" or "No such file or directory" Solution:
- Check: toolchains/clang/bin/clang --version
- If not found, verify symlink exists: ls -la toolchains/
- If symlink broken, reinstall clang to correct location
- Manually verify clang is on system: which clang
- If nowhere, run: sudo pacman -S clang (Arch) or apt install clang-14 (Ubuntu)
Symptom: Installation fails, "No space left on device" Solution:
- Check remaining space: adb shell df -h
- Clear app caches: Settings > Apps > Storage > Clear Cache
- Delete unnecessary files from device storage
- Use TWRP to wipe cache partition (does not delete user data)
- If still not enough, may need to uninstall some apps
The following projects and resources were used in creating this kernel:
FlopKernel-Series - Base kernel source code https://github.com/FlopKernel-Series/flop_trinket-mi_kernel
Droidspaces-OSS - Linux containerization tool and kernel requirements https://github.com/ravindu644/Droidspaces-OSS
KernelSU-Next - Root management system https://github.com/rifsxd/KernelSU-Next
SUSFS - Filesystem hiding module https://github.com/zomasec/susfs
AOSP Kernel Documentation https://android.googlesource.com/kernel/msm
Linux Kernel Documentation https://www.kernel.org/doc/
Xiaomi Redmi Note 8 Device Information https://www.mi.com/
This kernel is licensed under GPL v2, consistent with the Linux kernel license.
When you modify and distribute this kernel, you must also distribute the source code under the same GPL v2 license.
The kernel is based on the Linux kernel which is licensed under GPL v2. See individual source files and components for their specific licenses.
This is a GitHub repository containing source code. To use it:
- View the code online at GitHub (click on files to see their contents)
- Clone locally to compile yourself
- Check Releases section for pre-compiled kernel binaries
- Follow the Installation section to flash to device
Changes and improvements can be submitted as pull requests if you modify the code.
This is a personal learning project. Support may be limited.
Issues can be reported on GitHub Issues section.
Questions about Droidspaces should be directed to the Droidspaces project. Questions about FlopKernel should be directed to the FlopKernel-Series project.
Created: 2026-05-07 Kernel Version: 4.14.x (FlopKernel-Series) Device: Xiaomi Redmi Note 8 (ginkgo) Purpose: Educational learning project
This project is created for educational purposes to learn how Android kernels are compiled and modified. The author is a beginner in kernel development.
Important points:
- This is a learning exercise, not a production kernel
- Use at your own risk on your device
- May void device warranty
- Always backup important data before flashing custom kernels
- Some features may not work perfectly - this is expected in a learning project
- If something breaks, you can always flash the stock Xiaomi kernel back
- Community support for this specific build may be limited
What I learned from this project:
- How to obtain kernel source code
- Applying patches from multiple projects (FlopKernel, Droidspaces, KernelSU, SUSFS)
- Configuring kernel options for specific features
- Kernel compilation process with Clang compiler
- Creating flashable ZIP files with AnyKernel3
- Device tree concepts
- Some kernel configuration options for Linux namespaces
Recommended further learning:
- Read Linux kernel documentation
- Study kernel configuration options in detail
- Understand device tree files
- Learn about bootloaders and recovery systems
- Study how Android system integrates with the Linux kernel
This kernel is not recommended for devices you rely on daily. Use on a test device or secondary device.