When building a target (like mustang) using a custom OUT_DIR (e.g.,
OUT_DIR=mustang-out), actions that build ramdisk_16k and
prebuilt_kernel_modules fail because their builders cannot find input
dependencies.
This happens because the builders (ramdisk_16k_builder and
kernel_modules_builder) run inside an sbox sandbox, which maps the
build output directory to `out/` inside the sandbox. Previously, the
paths written to the configuration file (`props.json`) were the raw host
output paths (e.g., `mustang-out/...`). When the builder script ran
inside the sandbox, it attempted to read from `mustang-out/...`, which
did not exist. This bug was masked when using the default `OUT_DIR=out`
because the host and sandbox paths coincidentally matched.
This change fixes the issue by using
`android.RuleBuilderCommand.PathForInputFromFile()` when resolving the
properties for `props.json` in both `filesystem/ramdisk_16k.go` and
`kernel/prebuilt_kernel_modules.go`. This correctly translates the host
paths to the appropriate sandbox-relative paths, ensuring the builders
can find their inputs regardless of the host's OUT_DIR.
(The analysis, patch and commit message are entirely Gemini generated. I
verified that it builds and boots on my device.)
Test: m (on mustang)
Bug: None
Flag: EXEMPT (bug fix)
Change-Id: I64888f8a3eb63c8928d02ac617eb9d75cbdd62d7