system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5 How operating systems are batch installed on devices like phones, tablets or pc's on the assembly line.

My Xperia Z2 tablet came with the Amazing Spider-man 2 trailer and it got me thinking how this was possible for all the Z2's out of the box. Is there someone copying files across millions of devices in a factory before it's wrapped?
gpt
(I copy/pasted an older post of mine)

Used to work for a cell manufacturer here.

At some point at the assembly line, right after the case is put on but before it goes in the box..... behind some secure walls... there is what we used to call (name may change elsewhere) a provisioning station.

The provisioning stations are simply banks of charge/sync pods (more rugged than the consumer ones of course).... like 20 of them... tied to a single computer through some special high speed interface.

The operator entered the model #, any other hw version info, then selected what Cell Carrier and a few other parameters that decide WHAT software goes on (each carrier gets to customize to some degree). Clicks the go button.

First off, for each device, provisioning/enabling things are done. Essentially using unique hw IDs like mac address, cpu serial, crypto keys (most of which are burned into silicon), the device is registered with the master provisioning server (which keeps track and heretofor calls that chunk of phone "phone xyzqrs". Like an IMEI #. Until this point, the phone was just a chunk of components.

Now that the phone has a unique identity, the software gets zapped on. So they load them 20, 30, 40 at a time, times however many provisioning stations you have.  I've seen thousands of phones being provisioned simultaneously. 

You can usually half the operators to provisioning stations. The op is putting fresh blank phones into the banks, and taking completed phones off and putting them into bulk cartons or trays (that go onto the packing stations).... They can swap the phones in one station 

while the other station is burning phones.

Lastly the pack station is where the thing gets shoved into a carrier branded box with carrier "welcome to your new IGalaxyBerry from AwesomeCarrier!" instructions, shrink wrapped and shoved into a carton with 100 others, on a pallet and on a truck.