From 47812a77cf2d0eaab9daf066ef86c5b4fc0f9347 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Mon, 18 Jun 2007 16:35:23 +0300 Subject: UBI: fix tests This patch fixes UBI tests and adds udev problems solution description. Signed-off-by: Artem Bityutskiy --- ubi-utils/scripts/mkdevs.pl | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 ubi-utils/scripts/mkdevs.pl (limited to 'ubi-utils/scripts') diff --git a/ubi-utils/scripts/mkdevs.pl b/ubi-utils/scripts/mkdevs.pl new file mode 100755 index 0000000..f0fd464 --- /dev/null +++ b/ubi-utils/scripts/mkdevs.pl @@ -0,0 +1,32 @@ +#!/usr/bin/perl -w + +# +# Author: Artem B. Bityutskiy +# +# A small scrip which creates UBI device nodes in /dev. UBI allocates +# major number dynamically, so the script looks at /proc/devices to find +# out UBI's major number. +# + + +my $proc = '/proc/devices'; +my $regexp = '(\d+) (ubi\d+)$'; + + +open FILE, "<", $proc or die "Cannot open $proc file: $!\n"; +my @file = ; +close FILE; + +foreach (@file) { + next if not m/$regexp/g; + print "found $2\n"; + + system("rm -rf /dev/$2"); + system("mknod /dev/$2 c $1 0"); + + for (my $i = 0; $i < 128; $i += 1) { + system("rm -rf /dev/$2_$i"); + my $j = $i + 1; + system("mknod /dev/$2_$i c $1 $j"); + } +} -- cgit v1.2.3