Patchwork [4/5] initramfs-module-e2fs: add

login
register
mail settings
Submitter Otavio Salvador
Date Dec. 6, 2011, 4:07 p.m.
Message ID <d3f26adf5c6129ea8023e87588c7898e3e19c74a.1323187516.git.otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/16315/
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-e2fs/e2fs       |   28 ++++++++++++++++++++
 .../initrdscripts/initramfs-module-e2fs_1.0.bb     |   15 ++++++++++
 2 files changed, 43 insertions(+), 0 deletions(-)
 create mode 100755 meta/recipes-core/initrdscripts/initramfs-module-e2fs/e2fs
 create mode 100644 meta/recipes-core/initrdscripts/initramfs-module-e2fs_1.0.bb

Patch

diff --git a/meta/recipes-core/initrdscripts/initramfs-module-e2fs/e2fs b/meta/recipes-core/initrdscripts/initramfs-module-e2fs/e2fs
new file mode 100755
index 0000000..29f801a
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-module-e2fs/e2fs
@@ -0,0 +1,28 @@ 
+#!/bin/sh
+# Copyright (C) 2011 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+e2fs_enabled() {
+	return 0
+}
+
+e2fs_run() {
+	filesystems="ext4 ext3 ext2"
+
+	# load modules
+	for fs in $filesystems; do
+		load_kernel_module $fs
+	done
+
+	for fs in $filesystems; do
+		eval "fs_options=\$bootparam_${fs}"
+		if [ -n "$fs_options" ]; then
+		    dev=`expr "$fs_options" : '\([^:]*\).*'`
+		    path=`expr "$fs_options" : '[^:]*:\([^:]*\).*'`
+
+		    info "Mounting $dev as $fs on $path as $fs..."
+			mkdir -p $path
+		    mount -t $fs $dev $path
+		fi
+	done
+}
diff --git a/meta/recipes-core/initrdscripts/initramfs-module-e2fs_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-module-e2fs_1.0.bb
new file mode 100644
index 0000000..89f15ae
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-module-e2fs_1.0.bb
@@ -0,0 +1,15 @@ 
+DESCRIPTION = "initramfs support for ext2/ext3/ext3"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+RDEPENDS = "initramfs-base"
+
+inherit allarch
+
+SRC_URI = "file://e2fs"
+
+do_install() {
+    install -d ${D}/init.d
+    install -m 0755 ${WORKDIR}/e2fs ${D}/init.d/20-e2fs
+}
+
+FILES_${PN} = "/init.d/*"