My boar had something like this (very similiar to what the problem with your boar had Niki by the sounds of it). The vet called it Smegma, however thats usually found in the genitals rather than the bum area (which confused me, as another vet told me it was probably more to do with his gut so put him on a probiotic which did nothing, I think for me this was another example of how vets know nothing about guinea pigs). It STUNK, was a creamy colour and had bits of his bedding cemented in it and was rock hard. I had to peel it out of him, much to his disapproval. Was like a lil casing or something he'd make himself..lol.
I found it stopped once I changed his bedding and eventually got him a friend. He was on Hemcore, then I put him on vetbed and it stopped...then got him a friend and he's now on newspaper and hay and its still fine.