[prev in list] [next in list] [prev in thread] [next in thread] 

List:       uclinux-dev
Subject:    [uClinux-dev] [PATCH] mkdevdir-genromfs.sh: script to make /dev
From:       Mike Frysinger <vapier () gentoo ! org>
Date:       2008-09-29 4:10:05
Message-ID: 1222661405-22598-1-git-send-email-vapier () gentoo ! org
[Download RAW message or body]

The genromfs utility (which is used to generate ROMFS images) is a little
funky when it comes to /dev.  This script will parse a normal device table
and create the funky files that genromfs keys off of.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 tools/mkdevdir-genromfs.sh |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
 create mode 100755 tools/mkdevdir-genromfs.sh

diff --git a/tools/mkdevdir-genromfs.sh b/tools/mkdevdir-genromfs.sh
new file mode 100755
index 0000000..29c5895
--- /dev/null
+++ b/tools/mkdevdir-genromfs.sh
@@ -0,0 +1,23 @@
+#! /bin/sh
+
+# A little tool to generate /dev directories in a form that genromfs
+# understands.  It takes as inputs the romfs directory, and the
+# device table (which is in the same format that genext2fs understands)
+
+while read filename type mode uid gid major minor start inc count ; do
+case "$filename" in
+'#'*)    true ;;
+*)
+    case $type in
+	d)
+	    mkdir -p $1$filename
+	    ;;
+	[cb])
+	    x=`basename $filename`
+	    y=`dirname $filename`
+	    touch "$1$y/@$x,$type,$major,$minor"
+	    chmod $mode "$1$y/@$x,$type,$major,$minor"
+	    ;;
+    esac
+esac
+done <$2
-- 
1.6.0.1

_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic