Burn bootloader.bin

There is any option to build “bootloader.bin” from Platformio using ESP32 and Arduino framework?

I will flash one ESP32 from another ESP32 based on “esp-serial-flasher” lib.
If I flash my firmware directly from platformio and then I flash firmware and partitions from the other ESP32, it works fine. But when I flash it with the bootloader.bin (bootloader_dio_40m.bin). It comes a constant bucle:

rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
mode:DIO, clock div:2
entry 0x400806a8
ets Jul 29 2019 12:21:46

Thanks in advance.

The available bootloaders are not built from source. arduino-esp32/tools/sdk/esp32/bin at master · espressif/arduino-esp32 · GitHub has the available binaries, and the code

selects which bootloader binary to use based on the current board settings. The board flash mode and flash frequency can be changed as per documentation. This will cause PlatformIO to select a different bootloader bin.

@maxgerhardt very interesting, but how to select an alternative (& custom built) bootlader ? any possibility ? does it need a hack ?