svn commit: trunk/busybox: docs examples

aldot at busybox.net aldot at busybox.net
Wed May 28 11:21:21 UTC 2008


Author: aldot
Date: 2008-05-28 04:21:20 -0700 (Wed, 28 May 2008)
New Revision: 22100

Log:
- move depmod shell script to examples/


Added:
   trunk/busybox/examples/depmod

Removed:
   trunk/busybox/docs/depmod


Changeset:
Deleted: trunk/busybox/docs/depmod
===================================================================
--- trunk/busybox/docs/depmod	2008-05-28 10:35:51 UTC (rev 22099)
+++ trunk/busybox/docs/depmod	2008-05-28 11:21:20 UTC (rev 22100)
@@ -1,57 +0,0 @@
-#!/bin/sh
-#
-# Simple depmod, use to generate modprobe.conf
-#
-# Copyright (C) 2008 by Vladimir Dronnikov <dronnikov at gmail.com>
-#
-# Licensed under GPLv2
-#
-
-local BASE="${1:-/usr/lib/modules}"
-
-find "$BASE" -name '*.ko.gz' | while read I ; do
-	N=`basename "$I" '.ko.gz'`
-	echo -n "@$N"
-	zcat "$I" | strings | grep '^depends=' | sed -e 's/^depends=$//' -e 's/^depends=/,/' -e 's/,/ @/g'
-done | awk '
-{
-	# modules which has no dependencies are resolved
-	if ( NF == 1 ) { res[$1] = ""; next }
-	# others have to be resolved based on those which already resolved
-	i = $1; $1 = ""; deps[i] = $0; ++ndeps
-}
-END {
-	# resolve implicit dependencies
-	while ( ndeps ) for (mod in deps) {
-		if ( index(deps[mod], "@") > 0 ) {
-			$0 = deps[mod]
-			for ( i=1; i<=NF; ++i ) {
-				if ( substr($i,1,1) == "@" ) {
-					if ( $i in res ) {
-						$i = res[$i] " " substr($i,2)
-					}
-				}
-			}
-			deps[mod] = $0
-		} else {
-			res[mod] = deps[mod]
-			delete deps[mod]
-			--ndeps
-		}
-	}
-
-	# output dependencies in modules.dep format
-	for ( mod in res ) {
-		$0 = res[mod]
-		s = ""
-		delete a
-		for ( i=1; i<=NF; ++i ) {
-			if ( ! ($i in a) ) {
-				a[$i] = $i
-				s = " ," $i s
-			}
-		}
-		print "," substr(mod,2) ":" s
-	}
-}
-' | sort | sed -r -e "s!,([^,: ]*)!/usr/lib/modules/\\1.ko.gz!g"

Copied: trunk/busybox/examples/depmod (from rev 22099, trunk/busybox/docs/depmod)
===================================================================
--- trunk/busybox/examples/depmod	                        (rev 0)
+++ trunk/busybox/examples/depmod	2008-05-28 11:21:20 UTC (rev 22100)
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+# Simple depmod, use to generate modprobe.conf
+#
+# Copyright (C) 2008 by Vladimir Dronnikov <dronnikov at gmail.com>
+#
+# Licensed under GPLv2
+#
+
+local BASE="${1:-/usr/lib/modules}"
+
+find "$BASE" -name '*.ko.gz' | while read I ; do
+	N=`basename "$I" '.ko.gz'`
+	echo -n "@$N"
+	zcat "$I" | strings | grep '^depends=' | sed -e 's/^depends=$//' -e 's/^depends=/,/' -e 's/,/ @/g'
+done | awk '
+{
+	# modules which has no dependencies are resolved
+	if ( NF == 1 ) { res[$1] = ""; next }
+	# others have to be resolved based on those which already resolved
+	i = $1; $1 = ""; deps[i] = $0; ++ndeps
+}
+END {
+	# resolve implicit dependencies
+	while ( ndeps ) for (mod in deps) {
+		if ( index(deps[mod], "@") > 0 ) {
+			$0 = deps[mod]
+			for ( i=1; i<=NF; ++i ) {
+				if ( substr($i,1,1) == "@" ) {
+					if ( $i in res ) {
+						$i = res[$i] " " substr($i,2)
+					}
+				}
+			}
+			deps[mod] = $0
+		} else {
+			res[mod] = deps[mod]
+			delete deps[mod]
+			--ndeps
+		}
+	}
+
+	# output dependencies in modules.dep format
+	for ( mod in res ) {
+		$0 = res[mod]
+		s = ""
+		delete a
+		for ( i=1; i<=NF; ++i ) {
+			if ( ! ($i in a) ) {
+				a[$i] = $i
+				s = " ," $i s
+			}
+		}
+		print "," substr(mod,2) ":" s
+	}
+}
+' | sort | sed -r -e "s!,([^,: ]*)!/usr/lib/modules/\\1.ko.gz!g"




More information about the busybox-cvs mailing list