This guide provides step-by-step instructions to set up a development environment on Fedora for porting Ubuntu Touch to the Samsung Galaxy A11q. We will cover everything from setting up the necessary tools and libraries to unpacking the stock firmware and extracting critical kernel and boot image details.
The repo
tool is used for managing Android source code. Install it using the following command:
sudo dnf install repo
Add the ~/bin
directory to your PATH environment variable:
mkdir -p ~/bin
echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc
source ~/.bashrc
Install a set of development tools required for building Android kernels:
sudo dnf groupinstall "Development Tools"
Ensure 32-bit libraries are installed for cross-compilation purposes:
sudo dnf install gcc-c++ glibc-devel.i686 libstdc++-devel.i686
The following packages are needed for building the kernel and managing related tasks:
sudo dnf install gcc make glibc-devel bc bison \
ca-certificates cpio curl flex git kmod openssl-devel ncurses-compat-libs python3 \
unzip wget xz jq
To handle XML files, you need libxml2
:
sudo dnf install libxml2
The img2simg
tool is necessary to convert Android sparse images to standard image formats. Follow these steps:
git clone https://coral.googlesource.com/img2simg
cd img2simg/libsparse
gcc -I. -Iinclude -o img2simg img2simg.c sparse_crc32.c sparse_err.c sparse_read.c sparse.c backed_block.c output_file.c -lz
Move the compiled binary to the /usr/local/bin
directory for global access:
sudo mv img2simg /usr/local/bin/
For the clean kernel source with Halium patches, please visit our GitLab repository.
This repository focuses on the Ubuntu Touch porting process for the Samsung Galaxy A11q.
-
Download Stock Firmware: Download the appropriate stock firmware for your device (Samsung Galaxy A11). Tools like Frija or websites like SamMobile can help you obtain official firmware files.
-
Extract the
.tar.md5
Firmware: Once downloaded, untar the.tar.md5
file to access the various partitions:tar -xvf firmware.tar.md5 -C ~/temp
After extraction, you'll see
.img
files such asboot.img.lz4
,dtbo.img.lz4
, andvendor_boot.img.lz4
. -
Decompress
.lz4
Files: Use thelz4
tool to decompress theboot.img
anddtbo.img
files:lz4 -d boot.img.lz4 boot.img lz4 -d dtbo.img.lz4 dtbo.img
-
Unpack
boot.img
: After decompression, use theunpack_bootimg.py
script to extract kernel offsets and other essential data:python3 unpack_bootimg.py --boot_img boot.img --out out
After unpacking the boot.img
, extract key values and fill them in your deviceinfo
file:
- Page Size:
deviceinfo_flash_pagesize="2048"
- Kernel Load Address:
deviceinfo_flash_offset_kernel="0x80008000"
- Ramdisk Load Address:
deviceinfo_flash_offset_ramdisk="0x82000000"
- Second Bootloader Load Address:
deviceinfo_flash_offset_second="0x00000000"
(if applicable) - Kernel Tags Load Address:
deviceinfo_flash_offset_tags="0x81e00000"
- DTB Address:
deviceinfo_flash_offset_dtb="0x81f00000"
- OS Version:
deviceinfo_bootimg_os_version="12.0.0"
- OS Patch Level:
deviceinfo_bootimg_os_patch_level="2023-11"
- Command Line Args:
deviceinfo_kernel_cmdline="console=ttyMSM0,115200,n8 androidboot.console=ttyMSM0 androidboot.hardware=qcom user_debug=30 msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci lpm_levels.sleep_disabled=1 earlycon=msm_hsl_uart,0x78af000 androidboot.usbconfigfs=true vmalloc=300M loop.max_part=7"