Patchwork [3/5] initramfs-module-mdev: add

login
register
mail settings
Submitter Otavio Salvador
Date Dec. 6, 2011, 4:07 p.m.
Message ID <5f5928bc7457cee8e16558383cee848b4c43fb20.1323187516.git.otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/16319/
State New
Headers show

Comments

Otavio Salvador - Dec. 6, 2011, 4:07 p.m.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 .../initrdscripts/initramfs-module-mdev/mdev       |   30 ++++++++++++++++++++
 .../initrdscripts/initramfs-module-mdev_1.0.bb     |   16 ++++++++++
 2 files changed, 46 insertions(+), 0 deletions(-)
 create mode 100644 meta/recipes-core/initrdscripts/initramfs-module-mdev/mdev
 create mode 100644 meta/recipes-core/initrdscripts/initramfs-module-mdev_1.0.bb

Patch

diff --git a/meta/recipes-core/initrdscripts/initramfs-module-mdev/mdev b/meta/recipes-core/initrdscripts/initramfs-module-mdev/mdev
new file mode 100644
index 0000000..a5df1d7
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-module-mdev/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
+}
diff --git a/meta/recipes-core/initrdscripts/initramfs-module-mdev_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-module-mdev_1.0.bb
new file mode 100644
index 0000000..e1af0e3
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-module-mdev_1.0.bb
@@ -0,0 +1,16 @@ 
+DESCRIPTION = "initramfs support for mdev"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+RDEPENDS = "initramfs-base"
+RCONFLICTS = "initramfs-module-udev"
+
+inherit allarch
+
+SRC_URI = "file://mdev"
+
+do_install() {
+    install -d ${D}/init.d
+    install -m 0755 ${WORKDIR}/mdev ${D}/init.d/01-mdev
+}
+
+FILES_${PN} = "/init.d/*"