Melt the butter in a saucepan and stir in the flour. Remove from the heat and gradually stir in milk. Bring to the boil, stirring constantly until smooth and thick, then reduce the heat. Add salt and pepper and leave the sauce simmering gently on a very low heat while you prepare the rest of the dish.
Grease a casserole and fill it with alternate layers of sliced onions, sliced potatoes and bacon strips, ending with a layer of potato over the white sauce. Give the casserole a good shake to distribute the sauce throughout. Cover, and bake in the oven 200 C (400 F, gas mark 6) for 1 hour, the reduce the heat to 180 C (350 F, gas mark 4), uncover the casserole and cook for a further hour.
This is really a winter dish, and goes best with winter vegetables like brussels sprouts and cabbage.