Lua scripting using separate onboard DataFlash Chip

I have a flight controller with 2MB internal flash with a separate DataFlash chip available onboard, i want to know is there any way to store and run lua script directly from onboard/external DataFlash chip and not from SD Card?

Recently I got to know about @ROMFS filesystem feature of storing lua script directly on internal flash, so similar to that how can i store and run same lua script from separate onboard DataFlash chip ?

If there’s any way to store and run lua script directly from separate onboard DataFlash chip then what will be the limitations of running lua scripts like size of lua script or size of a text/log file which lua script can read and execute during runtime ?

Lastly, with the same context as mentioned above if i use a pixhawk with 2MB internal flash and lua scripts stored on SD card then again what will be limitations of lua scripting ?

Sure, you need this PR

@tridge Will it make lua scripts to run from the external SPI flash like winbond W25QXX series ? If yes then how about reading a file from the same
spi flash using lua script ? Can I load any TXT or CSV file on the SPI flash just like loading any lua script on it ? Will there not be any kind of issues related to file system format like to read SD card directly using AP_filesystem for ChibiOS boards it’s important to make sure that SD card is formatted in FAT format