Add the pig knuckles and pork shoulder into an 8-quart pot and cover with cold water. Add the onion, carrot, celery, bay leaves, black peppercorns and optional juniper berries.
Place the pot on high heat and bring to a boil, removing grey scum that appears on the surface using a skimmer or slotted spoon.
Cover the pot and reduce the heat to low. Simmer for 3 hours or until the meat is starting to fall off the bone.
Remove the pig knuckles and meat to a large cutting board. Use a fork to pick all the meat and skin off the bones. Discard the bones.
Pour the rest of the pot contents through a mesh strainer and into a bowl. Discard the solids and reserve the liquid stock.
Place the meat in a food processor and pulse several times until you reach a coarse consistency. (Alternatively, you can mince it yourself on a cutting board using a chef's knife.)
Place the empty pot over medium-high heat. Add 4 quarts of stock along with the minced meat. Bring to a boil.
Reduce the heat to medium-low and gradually add the cornmeal. Let the mixture bubble for 10 minutes until thickened, stirring continuously to achieve a thick pancake batter consistency. (You can add extra cornmeal or optional flour for extra thickening if desired, or add more water if it gets too thick.)
Stir in all of the seasonings: salt, pepper, sage, thyme and cayenne. Taste the mixture and adjust the seasonings as needed.
Pour the mixture into a terrine pan or small loaf pans lined with parchment to minimize sticking. Use a rigid spatula to pack the mixture in firmly to eliminate any air pockets.
Cool uncovered until it reaches room temperature. Then cover with plastic wrap and chill overnight to firm up completely. Slice and fry to serve.