Files
builders_rubenslte/README.md
T
2026-09-13 20:08:34 +02:00

9.5 KiB

builders_rubenslte

Build scripts for TWRP recovery and a LineageOS 14.1 ROM for the Samsung Galaxy Tab Active SM-T365 (codename rubenslte, Qualcomm MSM8926).

This repo only orchestrates the builds. The actual device configuration lives in other repos:

Repo Contents
twrp_device_samsung_rubenslte TWRP device tree (BoardConfig.mk, mkbootimg.mk, dtbtool, recovery.fstab)
android_kernel_samsung_rubenslte Samsung msm8226 stock kernel (Linux 3.4), built from source
device_samsung_rubenslte LineageOS 14.1 device tree
android_vendor_samsung_rubenslte LOS vendor blobs / proprietary files
android_kernel_samsung_rubenslte (shared) the same gitea kernel clone
this repo build_twrp.sh / build_los.sh (drivers), shell.nix / shell_los.nix (envs), patches/, docs

The LOS device/vendor/kernel trees come in via local_manifests/rubenslte.xml against the cm-14.1 manifest (the milletwifi/milletlte forks from git.cfpi-fpsi.eu provide the shared trees).

Quick start

Requirements: a NixOS system (or Nix with nix-shell) with network access and nix in your user's allowed-users / trusted-users.

TWRP recovery

./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

LineageOS 14.1

./build_los.sh                # boot.img: kernel + dt.img + ramdisk (fast gate)
./build_los.sh bacon          # full build -> lineage_rubenslte-*.zip
./build_los.sh clean          # mka clean
./build_los.sh env            # interactive shell inside the build env

RB_CMD=<cmd> overrides the subcommand (used by relaunch helpers).

How the builds work

  1. Environment — everything runs inside a nix-shell FHS environment: shell.nix for TWRP, shell_los.nix for LOS (same package set + host gcc, which the kernel kconfig host tools need). nix-shell --run is unreliable here because the shellHook does exec android-env, so the scripts re-enter the environment by piping their body into nix-shell (see reenter_build_env in lib/common.sh).
  2. Sources — repo init/sync fetches the omni twrp-5.1 manifest for TWRP and the cm-14.1 manifest + local_manifests/rubenslte.xml for LOS. The device tree(s) and kernel are shallow clones from gitea and refreshed on each full build.
  3. Patches — patches/{twrp,kernel,los}/*.patch fix the old 5.1/14.1 codebase for modern host tools (see patches/README.md). Applied idempotently so repo sync wipes are harmless.
  4. Toolchain (TWRP) — arm-eabi-4.8 (gcc 4.8, same as stock builds) is downloaded from Android's googlesource and put on PATH. LOS uses the tree prebuilts.
  5. Compiler (LOS) — Jack only. The 14.1 javac fallback is incomplete (dangling with-local/classes.dex intermediates) and can't build bacon. Jack runs in-process (JACK_NO_SERVER=1); the separate Jack server is disabled (JACK_SERVER=false) because its curl admin TLS (try curl against 0.0.0.0:8077: SSL routines::unexpected eof) can't handshake with the Java 8 server on this host, and jack_server_setup.mk's mandatory server-start ninja edge (update jack ... || exit 47) hard-aborts ninja. Jack jars are seeded from the tree into .jack-repository/.
  6. Kernel — built from source via the omni/lineage kernel build rules. The variant defconfig only enables CONFIG_MACH_RUBENSLTE_OPEN (EUR).
  7. dt.img — dtbToolLineage packs the compiled .dtb files; the bootloader selects the right one for the hardware.
  8. Recovery ramdisk — the stock minigzip ramdisk overflows the 10,485,248 byte partition, so mkbootimg.mk replaces the core ramdisk rules: drops tzdata and the f2fs tools and compresses with LZMA (CONFIG_RD_LZMA=y in the rubenslte kernel). All 19 common TWRP language packs ship as-is.

Final artifacts at the repo root: recovery.img (TWRP, currently 10,479,632 bytes) and, after bacon, los-build/out/target/product/rubenslte/lineage_rubenslte-*.zip.

Image layout (shipped recovery.img)

boot image header (base 0x0, pagesize 2048)
zImage     kernel
ramdisk    LZMA-compressed, 19-language TWRP 3.7.0_9-0
dt.img     QCDT: two EUR dtbs, r02 + r03
SEANDROIDENFORCE trailer
total      10,479,632   fits the 10,485,248 byte partition

build_twrp.sh prints the image size and sha256 at the end (verify_image in lib/common.sh).

Flashing

Enter Download mode: Volume Down + Home + Power, then confirm with Volume Up.

  • Odin 3.x: flash recovery.img in 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.

The ROM zip is flashed from TWRP (it does not touch the bootloader), followed by lineage-*-kernel, or extract boot.img (with the SEANDROIDENFORCE trailer) from the zip. The ROM is bare — no GApps — and /data is ext4 (F2FS off).

WebView provider (webview.apk)

The device's WebView (com.android.webview) lives in the vendor tree. If you wipe or replace it, the system can fall back to a broken com.android.webview. Restore point /system/app/webview/webview.apk; a safely-stripped variant sits in important_files/ if you need to re-add it.

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 corresponding CONFIG_MACH_RUBENSLTE_* enabled and a rebuild, otherwise the device may not boot from this kernel.
  • /data is ext4, no F2FS. The kernel has no F2FS driver, so the f2fs tools are excluded. TWRP's format menu only offers F2FS when /sbin/mkfs.f2fs is present, so the option is hidden automatically. Do not format Data as F2FS.
  • adb shell needs /system mounted. adb works in recovery, but the device-side shell is /system/bin/sh; until you check Mount → System in TWRP you'll see CANNOT 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 (TWRP) — the custom bootimg rules are included before the kernel tasks define their paths; the recursive variables in BoardConfig.mk are what keep /dt.img from collapsing to an absolute base path. Don't "simplify" them to :=.
  • Image won't fit the partition (TWRP) — the ramdisk must stay LZMA and trimmed; re-check mkbootimg.mk if you add files under twres/ or system/.
  • mkfs.f2fs reappears in the ramdisk after a rebuild — stale copy in out/target/product/rubenslte/root/sbin/ (the core rule cp -Rs the boot root into the recovery root without wiping it first). Delete them and recovery/root.ts; mkbootimg.mk strips them from the packed image anyway.
  • Jack complaints "not readable" about jack-3.36.CANDIDATE.jar — the .jack-repository/ seed is incomplete; seed_jack_repository re-copies from los-build/prebuilts/sdk/tools/jacks/ (keep jills too).
  • curl TLS error against the Jack server — expected; Jack runs in-process, the server path is disabled on purpose.
  • nix-shell --run ... produces no output — known limitation of the exec android-env shellHook; use the wrapper scripts or ... env.
  • Parallel nix-shell invocations 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