Using GPIOs at boot time - MiczFlor/RPi-Jukebox-RFID GitHub Wiki

How to use GPIO at boot time

e.g. for blinking LEDs or status LED

Usually it takes the Raspberry some 10 seconds to boot up and execute some customisation scripts to run. But there is an easy way to set GPIOs early in the loading process. e.g. to enable GPIO12 in /boot/config.txt add the line

#Set GPIO12 to be an output set to 1
gpio=12=op,dh

This will enable GPIO12 in the first seconds after power on. It will stay that way until Raspbian is ready and an other script changes GPIO settings.

Source: GPIO control in config.txt - Raspberry Pi Documentation