Heat a skillet over medium heat and toast the whole spices until they start to become fragrant, tossing often so they don't burn (about 3 minutes). Transfer to a dish to cool and then grind the spices.
Heat a sous vide water bath to 165F degrees.
Mix all the rub ingredients together.
Rub the rub all over the pork shoulder. (There will likely be some left over so you can save it for another recipe).
Place the pork shoulder in a vacuum seal bag and use a vacuum sealer to remove all the air. You can also use a ziplock bag and the water displacement method (see above).
Cook for 24 hours. If the bag starts to float, weigh it down with a wet towel or use a sous vide sinker weight.
Remove from the water bath and place immediately in an ice bath for 10-15 minutes to cool it.
While it's cooling, wrap a handful of wood chips in tin foil, poking holes at the top so the smoke can escape. If you have a smoker, you can use that instead of a gas grill.
Place the wood chip packet right next to the heat source. Heat the grill to about 275-300F degrees.
Remove the pork shoulder from the bag carefully (the meat will be soft) and reserve the juices if desired (you can use the juice instead of BBQ sauce if you'd like).
Place the pork on a foil lined baking sheet and smoke in the grill for 1 hour. Remove and let cool for 10 minutes.
When done, it should have a layer of bark on the outside.
Use 2 forks (or your hands) to pull the pork apart on the baking sheet.
Serve on the buns with BBQ sauce and pickled onions. Drizzle a touch of the cooking liquid over the top if desired.