Minimal Raspbian distribution

Packages that should be installed:

libraspberrypi-bin
raspberrypi-bootloader
raspi-config

Packages that should be removed:

lxde-common
lxsession

Edu packages to remove (from lxde-edu:

idle python3-pygame python-pygame python-tk
idle3 python3-tk
python3-rpi.gpio
python-serial python3-serial
python-picamera python3-picamera
debian-reference-en dillo x2x
scratch nuscratch
raspberrypi-ui-mods
timidity
smartsim penguinspuzzle
pistore
sonic-pi
python3-numpy
python3-pifacecommon python3-pifacedigitalio python3-pifacedigital-scratch-handler python-pifacecommon python-pifacedigitalio
oracle-java8-jdk
minecraft-pi python-minecraftpi
wolfram-engine

From the above, generate a string called $pkgs, and then run:

eatmydata apt-get -y remove --purge $pkgs
eatmydata apt-get -y autoremove # Remove automatically installed packages

jwhitehorn/raspbian-mod: script to slim down a Raspbian installation

Building an image from scratch

Buildroot has instructions for an Raspberry Pi target.

https://github.com/debian-pi/raspbian-ua-netinst: Raspbian network installer

ansible

https://github.com/escapologyBB/ansible

https://github.com/escapologyBB/ansible-raspberry-pi

http://jpmens.net/2012/06/06/configuration-management-with-ansible/

Etc

Instantly finding a headless Raspberry Pi