Shaping the lining before foaming