Soak the black beans in 2 litres/3½ pints of cold water overnight.
When the beans have soaked, heat half of the oil in a lidded frying pan (large enough to fit all the ribs in at once) over a medium heat.
Season the smoked and unsmoked pork ribs all over with salt and freshly ground black pepper. Fry the ribs for 4-5 minutes on each side, or until browned on both sides.
Add the onion and garlic and continue to fry for a further 2-3 minutes, stirring well, until softened.
Add 250ml/9fl oz water and bring it to a simmer, then cover the frying pan with the lid and cook for 18-20 minutes, topping up the pan with water as necessary if the liquid evaporates too quickly. Transfer the pan contents to a large casserole and set aside.
Wipe the frying pan clean with kitchen paper, then heat the remaining oil over a medium heat. Fry the bacon, pork belly and sausage, in batches, until browned all over (do not overcrowd the pan). Transfer the browned meat to the casserole.
Add the soaked black beans and the soaking liquid to the casserole and stir well. Bring the mixture to the boil, then reduce the heat until the mixture is simmering gently. Simmer, half-covered, for about 2½ hours, topping up the casserole with water every so often to prevent it from drying out. The feijoada is ready when the ribs are tender and the meat is almost falling off the bone.
Just before serving, season the feijoada with salt and freshly ground black pepper, if necessary, and with chill flakes, if desired.