Usually, SOM maker provide tailored SW deliveries to their HW (e.g. using Yocto).
Otherwise, see wiki, e.g. those pages:
In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'
I find using buildroot the easiest way to create a linux system you can customize. Use the 2020.08 branch. It is the last to use basic boot using SPL and UBOOT so the security stuff does not get in your way. Uses Kernel 5.7.10.
I used this for a custom PCB using STM32MP157C based on DK2. Chucked all device support out of the system except MMC, USB and GPU/LTDC - handling all other hardware directly in my own driver without Linux knowing about it. Boots in 3 seconds currently - can probably speed that up further. Fast boot is needed for our application.
Buildroot is easy to use and quite fast (once you have the first compilation done). Makes you a nice SD card image you can flash straight to a card. It just works.