[readonly/geninitrd/BUSYBOX: 9/113] *** empty log message ***

draenog draenog at pld-linux.org
Sat Nov 2 19:10:47 CET 2013


commit f5a2a23b4e549dfefdc41822b46535c8a0864fce
Author: inglod <inglod at pld-linux.org>
Date:   Thu Nov 16 09:08:50 2000 +0000

    *** empty log message ***
    
    
    svn-id: @1161

 TODO      |  2 +-
 geninitrd | 21 +++++++++++----------
 2 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/TODO b/TODO
index 8c9a72c..a6584fc 100644
--- a/TODO
+++ b/TODO
@@ -1 +1 @@
-- change all "sed" and "grep" into "awk"
+- change all "grep" into "awk"
diff --git a/geninitrd b/geninitrd
index 4ebeb06..8fc11e1 100755
--- a/geninitrd
+++ b/geninitrd
@@ -118,7 +118,7 @@ while [ $# -gt 0 ]; do
     case $1 in
 	--fstab*)
 	    if echo $1 | grep '=' >/dev/null ; then
-	    	fstab=`echo $1 | sed 's/^--fstab=//'`
+	    	fstab=`echo $1 | awk -F= '{print $2;}'`
 	    else
 		fstab=$2
 		shift
@@ -127,7 +127,7 @@ while [ $# -gt 0 ]; do
 
 	--with*)
 	    if echo $1 | grep '=' >/dev/null ; then
-	    	modname=`echo $1 | sed 's/^--with=//'`
+	    	modname=`echo $1 | awk -F= '{print $2;}'`
 	    else
 		modname=$2
 		shift
@@ -158,7 +158,7 @@ while [ $# -gt 0 ]; do
 	    ;;
 	--preload)
 	    if echo $1 | grep '=' >/dev/null ; then
-	    	modname=`echo $1 | sed 's/^--preload=//'`
+	    	modname=`echo $1 | awk -F= '{print $2;}'`
 	    else
 		modname=$2
 		shift
@@ -180,7 +180,7 @@ while [ $# -gt 0 ]; do
 	    shift
 	    ;;
 	--fs*)
-	    FS=`echo $1 | sed 's/^--fs=//'`
+	    FS=`echo $1 | awk -F= '{print $2;}'`
 	    ;;
 	--image-version)
 	    img_vers=yes
@@ -329,9 +329,11 @@ if [ -n "$verbose" ]; then
     echo "Using modules: $MODULES"
 fi
 
-MNTIMAGE=`mktemp -d /tmp/initrd.XXXXXX`
-IMAGE=`mktemp /tmp/initrd.img-XXXXXX`
-MNTPOINT=`mktemp -d /tmp/initrd.mnt-XXXXXX`
+MNTIMAGE=`mktemp -u /tmp/initrd.XXXXXX`
+IMAGE=`mktemp -u /tmp/initrd.img-XXXXXX`
+MNTPOINT=`mktemp -u /tmp/initrd.mnt-XXXXXX`
+mkdir $MNTIMAGE
+mkdir $MNTPOINT
 RCFILE=$MNTIMAGE/linuxrc
 
 if [ -f $MNTIMAGE ]; then
@@ -410,9 +412,8 @@ echo "#!/bin/sh" > $RCFILE
 echo "" >> $RCFILE
 
 for MODULE in $MODULES; do
-    module=`echo $MODULE | sed "s|.*/||" | sed "s/.o$//"`
-
-    options=`sed -n -e "s/^options[ 	][ 	]*$module[ 	][ 	]*//p" $modulefile`
+    module=`echo $MODULE | awk -F/ '{ $0=$NF } /.o$/ { $0=substr($0,1,length($0)-2); } { print $0; }'`
+    options=`awk '{ if($1 == "options" && $2 == "'${module}'") { for(i=3;i<=NF;i++) printf("%s ",$i); }}' $modulefile`
 
     if [ -n "$verbose" ]; then
         echo "Loading module $module with options $options"
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/readonly/geninitrd.git/commitdiff/0999a53e93eedcf489380684b998ce04aaddf11c



More information about the pld-cvs-commit mailing list