poky/meta/recipes-core/initrdscripts/initramfs-framework/mdev
Otavio Salvador 362a99fd59 initramfs-framework: Allow directories with spaces
When mdev module loads the Linux kernel modules, it can visit
directories with spaces. To allow that, we must quote the variable
otherwise it misunderstand it arguments as multiple entries.

Fixes:

,----
| Freeing unused kernel memory: 3072K (80d00000 - 81000000)
| cat: can't open '/sys/devices/platform/Vivante': No such file or directory
| cat: can't open 'GCCore/modalias': No such file or directory
`----

(From OE-Core rev: afc73dd6346325de0a39997a3045b6659f9658b5)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-12 23:55:28 +01:00

512 B

#!/bin/sh

Copyright (C) 2011, 2017 O.S. Systems Software LTDA.

Licensed on MIT

mdev_enabled() { if [ ! -e /sbin/mdev ]; then debug "/sbin/mdev doesn't exist" return 1 fi

return 0

}

mdev_run() { # setup the environment mount -t tmpfs tmpfs /dev

mkdir -m 1777 /dev/shm

mkdir -m 0755 /dev/pts
mount -t devpts devpts /dev/pts

echo /sbin/mdev > /proc/sys/kernel/hotplug
mdev -s

# load modules for devices
find /sys -name modalias | while read m; do
	load_kernel_module $(cat "$m")
done

}