Dry roast the whole spices in a pan over medium heat until they're aromatic. Take off heat and allow them to cool down.
Transfer them to a blender jar and blend until you get a coarse powder that looks like this.
Add it back to the pan with the mustard oil and cook for a minute or two over medium-low heat, stirring continuously.
Add the mixture along with the salt, asafoetida, turmeric and lemon juice to the chopped green chilies and mix well.
Notes
Make sure you have enough of the oil mixture to nicely coat the chilies. This is important, since it is what will help the pickled green chilies last longer.
Use a clean spoon, bowl and other utensils while making this green chili pickle. Any moisture will speed up its spoilage.
If you have some extra veggies, you can add them into the mix too. I usually use veggies to make my Torshi (mixed vegetable pickle), but they taste fantastic with this rustic Indian pickle masala too.
If you want the pickle to last longer, use more oil and ensure that there's enough oil to completely cover the chilies when you add them to the jar.
For a stronger, tangy flavor, you can also add some salt preserved limes into the jar with the green chilies.