Update: Interestingly https://github.com/HamzaHajeir/ESP32-Arduino-Builds/blob/master/tools/platformio-build-esp32.py has what appears to be a defined variable of form: "ARDUINO_PARTITION_%s" as shown below:
CPPDEFINES=[
"HAVE_CONFIG_H",
("MBEDTLS_CONFIG_FILE", '\\"mbedtls/esp_config.h\\"'),
"UNITY_INCLUDE_CONFIG_H",
"WITH_POSIX",
"_GNU_SOURCE",
("IDF_VER", '\\"v4.4.5\\"'),
"ESP_PLATFORM",
"_POSIX_READER_WRITER_LOCKS",
"ARDUINO_ARCH_ESP32",
"ESP32",
("F_CPU", "$BOARD_F_CPU"),
("ARDUINO", 10812),
("ARDUINO_VARIANT", '\\"%s\\"' % env.BoardConfig().get("build.variant").replace('"', "")),
("ARDUINO_BOARD", '\\"%s\\"' % env.BoardConfig().get("name").replace('"', "")),
"ARDUINO_PARTITION_%s" % basename(env.BoardConfig().get(
"build.partitions", "default.csv")).replace(".csv", "").replace("-", "_")
]
But this “platformio-build-esp32.py” file seems very different from the default https://github.com/espressif/arduino-esp32/blob/master/tools/platformio-build.py version, and it is beyond my capabilities to incorporate this
"ARDUINO_PARTITION_%s" % basename(env.BoardConfig().get(
"build.partitions", "default.csv")).replace(".csv", "").replace("-", "_")
line into the default espressif file!