I have a jig that I use to set up a few hundred Omega2+ with.
Everything you do from the Onion html setup page from upgrading the omega firmware to resetting it via firstboot -y etc can be automated from the command line.
The jig is a custom PCB I have designed that has an ethernet port and built in FTDI for the Omega Serial Port 0.
You could accomplish the same thing using the Omega2+ expansion doc that has the CP2102 on it.
Star by plugging in an out of the box Omega into the programmer PCB.
Connecting through S0 which allows a direct connection to the Omega2+ with out needing to join it's adhoc wifi AP or provide login credentials.
The programming jig is connected to a Raspberry pi via USB cable.
A NodeJS script on the Pi connects using the serialport library and sends commands direct to the Omega2+.
The same thing could be accomplished using expect on the Pi instead of NodeJS it's really just what you are comfortable with. I have a web interface to the programmer so NodeJS made more sense.
The script first logs on by sending a new line and waiting for the bash prompt.
Once the Omega2+ boot process is complete and the script has received the bash prompt the script executes a series of setup commands.
One of the fist commands it does is to change the network interface ETH0 over to DHCP so that it can be used to download any repo files needed.
If you are using the expansion doc you would need to configure a WiFi connection from the command line, I do that through the uci utility.
Here is a very high level summary of how to do that with uci.
View the wireless settings.
uci show wireless
Change a setting by doing something like this.
uci set wireless.@wifi-config.ssid='YOURSSIDHERE'
... other wifi settings
uci set wireless.@wifi-config.key='WIFIPASSWHERE'
Then you have to restart the network with
The script installs git and then downloads custom code from my repo.
git eats up a log of space. You could also just use wget to download source files directly to your Omega if space is an issue.
When it's all done the Pi does a few function tests on the Omega2+ and then toggles a buzzer on the programmer PCB to indicate the process is complete.
Here is a peek at what the web interface to the programmer looks like.