7.5 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 and the f2fs tools, keeps onlyen.xml/pl.xmllanguages, and compresses with LZMA (CONFIG_RD_LZMA=yin the rubenslte kernel).
Image layout of the shipped recovery.img (verified component sizes; exact
offsets are 2048-byte aligned by the bootloader):
boot image header (base 0x0, pagesize 2048)
zImage 7,223,736 kernel
ramdisk 2,841,269 LZMA-compressed (gzip would overflow)
dt.img 296,960 QCDT: two EUR dtbs, r02 + r03
SEANDROIDENFORCE trailer
total 10,366,992 fits the 10,485,248 byte partition
Artifact facts:
recovery.img— 10,366,992 bytes (fits the 10,485,248 byte partition)- sha256
cf8c711afeb5636f6b01ee253d0643d380f127e7e71e8c1d3a163a148ab97703 - 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, no F2FS. The kernel has no F2FS driver, so the f2fs tools are excluded (TARGET_USERIMAGES_USE_F2FSunset in BoardConfig.mk, andmkbootimg.mkdeletes them from the ramdisk defensively — they can linger inout/.../root/sbin/from older f2fs-enabled builds). TWRP's format menu only offers F2FS when/sbin/mkfs.f2fsis present, so the option is hidden automatically. Do not formatDataas F2FS.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/. mkfs.f2fsreappears in the ramdisk after a rebuild — stale copy inout/target/product/rubenslte/root/sbin/(the core rulecp -Rs the boot root into the recovery root without wiping it first). Delete them andrecovery/root.ts;mkbootimg.mkstrips them from the packed image anyway.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