Skip to content

Commit c3f2418

Browse files
evgeniharaldh
authored andcommitted
fix: skip empty modalias files in drm module setup
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.
1 parent c17c5b7 commit c3f2418

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

modules.d/50drm/module-setup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ installkernel() {
3333
if [[ $hostonly ]]; then
3434
for i in /sys/bus/{pci/devices,platform/devices,virtio/devices,soc/devices/soc?}/*/modalias; do
3535
[[ -e $i ]] || continue
36+
[[ -n $(<"$i") ]] || continue
3637
if hostonly="" dracut_instmods --silent -s "drm_crtc_init|drm_dev_register|drm_encoder_init" -S "iw_handler_get_spy" $(<"$i"); then
3738
if strstr "$(modinfo -F filename $(<"$i") 2>/dev/null)" radeon.ko; then
3839
hostonly='' instmods amdkfd

0 commit comments

Comments
 (0)