Patchwork [10/17] initramfs-module-squashfs: port to new getarg API

login
register
mail settings
Submitter Otavio Salvador
Date May 30, 2011, 2:54 p.m.
Message ID <1306767263-29895-11-git-send-email-otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/5059/
State New, archived
Headers show

Comments

Otavio Salvador - May 30, 2011, 2:54 p.m.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 recipes/initrdscripts/files/80-squashfs.sh         |   18 +++++++-----------
 .../initrdscripts/initramfs-module-squashfs_1.0.bb |    2 +-
 2 files changed, 8 insertions(+), 12 deletions(-)

Patch

diff --git a/recipes/initrdscripts/files/80-squashfs.sh b/recipes/initrdscripts/files/80-squashfs.sh
index 22c0954..6150bf9 100644
--- a/recipes/initrdscripts/files/80-squashfs.sh
+++ b/recipes/initrdscripts/files/80-squashfs.sh
@@ -1,17 +1,13 @@ 
 squashfs_mount () {
 	modprobe -q squashfs
 
-	mkdir $2
+	mkdir -p $2
 	mount -t squashfs $1 $2
 }
 
-for arg in $CMDLINE; do
-    optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'`
-    echo $arg xxx $optarg 
-    case $arg in
-        squashfs=*)
-        dev=`expr "$optarg" : '\([^:]*\).*'`
-        path=`expr "$optarg" : '[^:]*:\([^:]*\).*'`
-        squashfs_mount $dev $path ;;
-    esac
-done
+squashfs=$(getarg squashfs=)
+if [ -n "$squashfs" ]; then
+        dev=`expr "$squashfs" : '\([^:]*\).*'`
+        path=`expr "$squashfs" : '[^:]*:\([^:]*\).*'`
+        squashfs_mount $dev $path
+fi
diff --git a/recipes/initrdscripts/initramfs-module-squashfs_1.0.bb b/recipes/initrdscripts/initramfs-module-squashfs_1.0.bb
index fcf3f97..0309ba5 100644
--- a/recipes/initrdscripts/initramfs-module-squashfs_1.0.bb
+++ b/recipes/initrdscripts/initramfs-module-squashfs_1.0.bb
@@ -1,5 +1,5 @@ 
 SRC_URI = "file://80-squashfs.sh"
-PR = "r2"
+PR = "r3"
 DESCRIPTION = "An initramfs module for mount squashfs."
 RDEPENDS_${PN} = "initramfs-uniboot"