- Install BerryBoot and add your desired images.
- Install Raspbian Lite (~300 mb) and set it as the default OS to boot.
- Use
raspi-configto setup networking if needed and auto-login of the user pi. - Install pip, sh, and pyftpdlib, for python
- Adjust at least the FTP values of
boot_selector_config.py. - Transfer the Python files to Raspbian Lite. (
Boot_selector.pyetc.) - Append the following to the end of
/home/pi/.bashrc:
#Adjust the dirs accordingly.
sudo python /home/pi/ftp_server.py && sleep 2s &
sudo python /home/pi/boot_selector.py
- Make sure the switch is not connected for the first run in order to generate the required filenames. Use the command:
source ~/.bashrc. You should now have a working FTP server and a text file in the same directory namedimages.log. - Adjust boot_selector_config.py with the right filenames from
images.logand the GPIO you wish to use for the switch.
When everything is set up. Upon rebooting, the ftp server starts. The images.log file is produced. If the switch IS connected, the system will begin a countdown timer and reboot to the image that you have designated in the config file for the corresponding GPIO. If the switch is NOT connected, the system will not reboot, allowing you to connect via FTP to adjust the config file as needed.
