Skip to content

Commit

Permalink
fix: skip empty modalias files in drm module setup
Browse files Browse the repository at this point in the history
on my system (ThinkPad X201s) I have several modalias entries that are
empty:

    /sys/bus/platform/devices/dock.0/modalias
    /sys/bus/platform/devices/dock.1/modalias
    /sys/bus/platform/devices/dock.2/modalias

executing the drm module setup thus results in the following errors

    dracut-install: No SOURCE argument given

when calling dracut_instmods and hostonly mode is enabled.

Skip those entries, as there are no modules to load in this case
anyways.

Note: it is not sufficient to use [['s -s test (file size is greater
than zero), as all those files are 4096B if you stat them.
  • Loading branch information
evgeni authored and haraldh committed Feb 22, 2021
1 parent c17c5b7 commit c3f2418
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions modules.d/50drm/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ installkernel() {
if [[ $hostonly ]]; then
for i in /sys/bus/{pci/devices,platform/devices,virtio/devices,soc/devices/soc?}/*/modalias; do
[[ -e $i ]] || continue
[[ -n $(<"$i") ]] || continue
if hostonly="" dracut_instmods --silent -s "drm_crtc_init|drm_dev_register|drm_encoder_init" -S "iw_handler_get_spy" $(<"$i"); then
if strstr "$(modinfo -F filename $(<"$i") 2>/dev/null)" radeon.ko; then
hostonly='' instmods amdkfd
Expand Down

0 comments on commit c3f2418

Please sign in to comment.