[readonly/geninitrd: 552/1068] - small optimize for root=

draenog draenog at pld-linux.org
Sat Nov 2 19:58:49 CET 2013


commit dcdf6b49050653b9f3e48093bead0b9e84ec21b4
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Mon Jan 28 10:10:46 2008 +0000

    - small optimize for root=
    
    svn-id: @9205

 geninitrd | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index 03b6bad..5b6e947 100755
--- a/geninitrd
+++ b/geninitrd
@@ -1524,9 +1524,8 @@ initrd_gen_blkid()
 initrd_gen_procdata() {
 	debug "Adding rootfs finding based on kernel cmdline root= option support."
 	add_linuxrc <<-'EOF'
-		[ "${ROOT##/dev/}" != "${ROOT}" ] && root="${ROOT##/dev/}"
-		if [ -n "$root" ]; then
-			rootnr="$(busybox awk -v root="$root" ' { if ($4 == root) { print 256*$1+$2; } } ' /proc/partitions)"
+		if [ "${ROOT##/dev/}" != "${ROOT}" ]; then
+			rootnr="$(busybox awk -v rootnode="${ROOT##/dev/}" '$4 == rootnode { print 256 * $1 + $2 }' /proc/partitions)"
 			if [ -n "$rootnr" ]; then
 				echo "$rootnr" > /proc/sys/kernel/real-root-dev
 			fi
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/readonly/geninitrd.git/commitdiff/147754ca159d40ca5eb541074dc043d8cbd92090



More information about the pld-cvs-commit mailing list