This script uses the devicetree compatible properties in the modalias info and compares them to all the compatible properties
used on the running device. Essentially, it filters lsmod
to only show modules which are directly used for hardware
functionality on your device. This is NOT an exhaustive list of modules, but should be added to your distros existing
list. It doesn't cover basic things like nvme
, etc.
On the Lenovo Yoga Slim 7x laptop, the following is printed:
; ./hwmodules.sh
Populating list of compatible properties...
Finding modules required by this device...
The following modules are needed by hardware, consider adding them to your initramfs:
q6prm_clocks
q6apm_lpass_dais
q6apm_dai
q6prm
snd_q6apm
apr
fastrpc
qcom_pon
nvmem_qcom_spmi_sdam
qcom_spmi_temp_alarm
snd_soc_x1e80100
qcom_stats
soundwire_qcom
qcom_q6v5_pas
snd_soc_lpass_rx_macro
snd_soc_lpass_tx_macro
snd_soc_lpass_va_macro
snd_soc_lpass_wsa_macro
pinctrl_sm8550_lpass_lpi
lpasscc_sc8280xp
panel_samsung_atna33xc20
msm
i2c_hid_of
phy_qcom_eusb2_repeater
phy_qcom_qmp_combo
phy_qcom_snps_eusb2
i2c_qcom_geni
phy_qcom_edp
dispcc_x1e80100
llcc_qcom
gpucc_x1e80100
phy_qcom_qmp_pcie
icc_bwmon
pmic_glink