6.9 KiB
builders_rubenslte
Build scripts for TWRP recoveries (and, eventually, ROMs) for the Samsung
Galaxy Tab Active SM-T365 (codename rubenslte, Qualcomm MSM8926).
This repo only orchestrates the build. The actual device configuration lives in two other repos:
| Repo | Contents |
|---|---|
rubenslte/twrp_device_samsung_rubenslte |
TWRP device tree (BoardConfig.mk, mkbootimg.mk, dtbtool, recovery.fstab) |
rubenslte/android_kernel_samsung_rubenslte |
Samsung msm8226 stock kernel (Linux 3.4), built from source |
| this repo | build_twrp.sh (driver), shell.nix (nix-shell env), patches/ (fixes), docs |
Quick start
Requirements: a NixOS system (or Nix with nix-shell) with network access and
nix in your user's allowed-users / trusted-users.
./build_twrp.sh # full build -> recovery.img
./build_twrp.sh --no-sync # rebuild without re-syncing/re-patching sources
./build_twrp.sh clean # delete twrp-build/ and recovery.img
./build_twrp.sh env # interactive shell inside the build env
The first run downloads the omni twrp-5.1 manifest source (~2-3 GB with the
kernel and toolchain) and can take over an hour; later --no-sync rebuilds are
much faster. The final artifact is recovery.img at the repo root.
How the build works
- Environment — everything runs inside the nix-shell FHS environment
(
shell.nix).nix-shell --runis unreliable here because the shellHook doesexec android-env, sobuild_twrp.shre-enters the environment by piping its own body intonix-shell(seereenter_build_env). - Sources —
repo init/syncfetches the omnitwrp-5.1manifest; the device tree and kernel are shallow clones from gitea (and refreshed on each full build). - Patches —
patches/*.patchfix the old 5.1 codebase for modern host tools (seepatches/README.md). Applied idempotently. - Toolchain — arm-eabi-4.8 (gcc 4.8, the same one stock builds used) is
downloaded from Android's googlesource and put on
PATH. - Kernel — built from source via the omni kernel build rules
(base defconfig + rubenslte variant + selinux defconfigs). The variant
defconfig only enables
CONFIG_MACH_RUBENSLTE_OPEN(see caveats). - dt.img —
dtbToolLineagepacks the compiled.dtbfiles; the bootloader selects the right one for the hardware. - Recovery ramdisk — the stock minigzip ramdisk overflows the 10,485,248
byte partition, so
mkbootimg.mkreplaces the core ramdisk rules: drops tzdata, keeps onlyen.xml/pl.xmllanguages, and compresses with LZMA (CONFIG_RD_LZMA=yin the rubenslte kernel).
Image layout of the shipped recovery.img:
offset size content
0 2,048 boot image header (base 0x0, pagesize 2048)
2,048 7,223,736 zImage (kernel)
7,225,744 1,608 padding
7,227,352 2,882,224 ramdisk, LZMA-compressed (gzip would overflow)
10,109,576 1,360 padding
10,110,936 296,960 dt.img (QCDT: two EUR dtbs, r02+r03)
10,407,896 56 SEANDROIDENFORCE trailer
Artifact facts:
recovery.img— 10,407,952 bytes (fits the 10,485,248 byte partition)- sha256
add52ab4d7ccbedd24ad08a89fe075c3cf918646bf6e77c6d610bcabd86a6b5b - TWRP 3.7.0_9-0, Linux kernel 3.4.x from Samsung source, built for Android 5.1.1 (omni twrp-5.1)
Flashing
Enter Download mode: Volume Down + Home + Power, then confirm with Volume Up.
- Odin 3.x: flash
recovery.imgin the AP slot (leave BL/CP/CSC empty). - Heimdall:
heimdall flash --RECOVERY recovery.img --no-reboot
Boot into TWRP with Volume Up + Home + Power. Note: the bootloader sets the KNOX warranty bit on flashing — irreversible on this device.
recovery-stock.img (in this directory, git-ignored) is the stock recovery
image dumped from the device; flash it back to restore the factory recovery.
Device notes
- dt.img is EUR-only. The kernel is built with
CONFIG_MACH_RUBENSLTE_OPEN, so dt.img carries only the two EUR DTBs (r02/r03). SM-T365Y (AUS) / SM-T365M / KOR units need the correspondingCONFIG_MACH_RUBENSLTE_*enabled and a rebuild, otherwise the device may not boot from this kernel. /datais ext4. The kernel has no F2FS driver, so do not formatDataas F2FS in TWRP. TheTARGET_USERIMAGES_USE_F2FSflag is deliberately unset.adb shellneeds/systemmounted.adbitself works in recovery, but the device-side shell is/system/bin/sh; until you check Mount → System in TWRP you'll seeCANNOT LINK EXECUTABLE DEPENDENCIES: library "libc.so" not found. The in-TWRP terminal (Advanced → Terminal) always works.
Troubleshooting
make: *** [.../mkbootimg.mk:24: /dt.img] Błąd 255— the custom bootimg rules are included before the kernel tasks define their paths; the recursive variables in BoardConfig.mk are what keep/dt.imgfrom collapsing to an absolute base path. Don't "simplify" them to:=.- Image won't fit the partition — the ramdisk must stay LZMA and trimmed;
re-check
mkbootimg.mkif you add files undertwres/orsystem/. nix-shell --run ...produces no output — known limitation of theexec android-envshellHook; use./build_twrp.shor./build_twrp.sh env.- Parallel
nix-shellinvocations can deadlock on the nix store — run builds sequentially.
Device information
| Basic | Spec sheet |
|---|---|
| Name | Galaxy Tab Active |
| Model | SM-T365 |
| Codename | rubenslte |
| CPU | Quad-core 1.2 GHz Cortex A-7 |
| Chipset | Qualcomm Snapdragon 400 (MSM8926, LTE) |
| ro.board.platform | msm8226 |
| ro.product.board | MSM8926 |
| GPU | Qualcomm Adreno 305 |
| Memory | 1.5 GB |
| Shipped Android | Android 4.4 |
| Latest Android | Android 5.1.1 |
| Storage | 16 GB |
| MicroSD | 64 GB |
| Battery | 4450 mAh |
| Display | 800x1280 px |
| Rear camera | 3.1 Mpx |
| Front camera | 1.2 Mpx |
| Similar devices | milletlte, matisselte, motorola_thea |
Links
- https://git.cfpi-fpsi.eu/rubenslte/twrp_device_samsung_rubenslte
- https://git.cfpi-fpsi.eu/rubenslte/android_kernel_samsung_rubenslte
- https://github.com/matteo0026/android_device_samsung_rubenslte
- https://github.com/matteo0026/twrp_device_samsung_milletlte
- https://github.com/matteo0026/twrp_device_samsung_matisselte