You most likely have a calcimine ceiling. I assume you are putting up latex ceiling paint. The surface can be easily coated with a product like Ox-o-flow by California Paints. If calcimine coating ceiling paints are not an option, use a wallpaper steamer or hot water and remove. This process is difficult and time consuming. Any water base paint will cause it to fail. If you do not get it all off sand and recoat with an oil base flat.
Answer for Ceiling Paint Slothing Off
Very Few Options
You don't have many options. There isn't a primer that I know of that will penetrate through and glue down your paint.
The easiest way to remove the loose paint is to wet it with a garden sprayer and use a wide scraper attached to a threaded pole. Once the loose paint is removed the ceilings can be primed, patched and then painted.