Mix together the thyme, garlic, celery salt and pepper. Use a sharp knife to cut several deep slits through the pork skin into the meat. Pack the garlic mixture into the slits. Rub salt over the skin. Put the pork in a large roasting tin and roast in a preheated oven, 220°C (425°F), Gas Mark 7, for 30 minutes. Reduce the oven temperature to 140°C (275°F), Gas Mark 1, and roast for a further 2 hours. Put the onions or shallots in a heatproof bowl, cover with boiling water and leave to stand. Drain and rinse in cold water. Peel away the skins, leaving the onions or shallots whole. Add to the pan with the vegetables, turning in the fat. Return to the oven for 2 hours, turning occasionally.
Transfer the pork to a carving platter. Cover with foil and leave to rest in a warm place. Increase the oven temperature to 220°C (425°F), Gas Mark 7. Drain off the excess fat from the tin and brush the vegetables with the maple syrup. Return to the oven for 25–30 minutes, turning once, until golden. Lift out into a dish.
Skim off the fat in the tin, retaining the meaty juices. Add the wine and stock, bring to the boil on the hob and cook for about 5 minutes until slightly thickened. Serve the carved meat with the vegetables and gravy.