diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2011-12-07 21:23:00 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-12-08 15:14:05 +0000 |
commit | 7b69ad2167a1f0e57db82817b98a0cbcb70a0dd3 (patch) | |
tree | b5715e5e90ea8174dbfb0646d81bad43609eb2dd /meta/recipes-core/initrdscripts/initramfs-framework/mdev | |
parent | c9f714062c1100cedbcb2c16d16656e3f5442133 (diff) | |
download | openembedded-core-contrib-7b69ad2167a1f0e57db82817b98a0cbcb70a0dd3.tar.gz |
initramfs-framework: provides a modular initramfs
Provides the API and modules for a modular initramfs. The currently
included modules are:
* initramfs-module-debug adds support to dynamic debugging of
initramfs using bootparams
* initramfs-module-udev: enables udev usage
* initramfs-module-mdev: enables mdev usage
* initramfs-module-e2fs: adds support for ext4, ext3 and ext2
filesystems
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'meta/recipes-core/initrdscripts/initramfs-framework/mdev')
-rw-r--r-- | meta/recipes-core/initrdscripts/initramfs-framework/mdev | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/mdev b/meta/recipes-core/initrdscripts/initramfs-framework/mdev new file mode 100644 index 0000000000..a5df1d717a --- /dev/null +++ b/meta/recipes-core/initrdscripts/initramfs-framework/mdev @@ -0,0 +1,30 @@ +#!/bin/sh +# Copyright (C) 2011 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 +} |