mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Jellinghaus <aj@dungeon.inka.de>
To: linux-kernel@vger.kernel.org
Subject: Re: ANNOUNCE: User-space System Device Enumation (uSDE)
Date: Wed, 29 Oct 2003 15:30:30 +0100	[thread overview]
Message-ID: <pan.2003.10.29.14.30.29.628488@dungeon.inka.de> (raw)
In-Reply-To: <20031028224416.GA8671@kroah.com>

On Tue, 28 Oct 2003 22:52:33 +0000, Greg KH wrote:
> For SDE:
> $ find . -type f | egrep '[.c|.h]$' | xargs wc -l | tail -1
>   57328 total
...

> For udev:
> $ find . -type f | egrep '[.c|.h]$' | xargs wc -l | tail -1
>   17632 total

Here is a config file and a 41 lines shell script, that
will populate /udev with all devices found via /sys.
A version to add or remove only one file should be about
the same size.

---cat /etc/makedev.conf---
ttyS0 root dialout 0660
zero root root 0666
null root root 0666

---cat makedev---
#!/bin/sh

set -e

DEV=/udev
CONFIG=/etc/makedev.conf

cd $DEV

find /sys/class -name dev |while read A;
do
	B=`dirname $A`
	B=`basename $B`
	MM=`cat $A|tr ":" " "`
	mknod --mode=0600 $B c $MM
	if grep -q "$B " $CONFIG
	then
		USER=`grep "$B " $CONFIG|cut -d" " -f2`
		GROUP=`grep "$B " $CONFIG|cut -d" " -f3`
		MODE=`grep "$B " $CONFIG|cut -d" " -f4`
		chown $USER.$GROUP $B
		chmod $MODE $B
	fi
done

find /sys/block -name dev |while read A;
do
	B=`dirname $A`
	B=`basename $B`
	MM=`cat $A|tr ":" " "`
	mknod --mode=0600 $B b $MM
	if grep -q "$B " $CONFIG
	then
		USER=`grep "$B " $CONFIG|cut -d" " -f2`
		GROUP=`grep "$B " $CONFIG|cut -d" " -f3`
		MODE=`grep "$B " $CONFIG|cut -d" " -f4`
		chown $USER.$GROUP $B
		chmod $MODE $B
	fi
done
---cut---

So udev is 99% overhead?

sure, it's fast and small, and has lots of features that I don't need.

> 	SDE:	57328 lines
> 	udev:	 9090 lines
 shell script:     41 lines

> that udev is suffering from "lack of maintainability and bloat" if you
> really want :)

bloat. lots of bloat. what is that tdb database for?
filesystems are persistent. if you want to save space,
create a tar file :-) 

> p.s. yes, I know lines of code is a horrible metric, and doesn't really
> mean squat.  I just want to point out the huge size difference between
> the current state of udev and SDE, with pretty much identical
> functionality from what I can tell.

I agree. lines of codes is a horrible metric, and comparing a shell
script that uses many external commands to a c application with
everything build is makes absolutely no sense. but I wonder why
the off the shelf machine needs a c applications, if all those
external commands are installed anyway.

Regards, Andreas


  reply	other threads:[~2003-10-29 14:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3F9D82F0.4000307@mvista.com>
     [not found] ` <20031027210054.GR24286@marowsky-bree.de>
     [not found]   ` <3F9D8AAA.7010308@mvista.com>
2003-10-28 11:00     ` Lars Marowsky-Bree
2003-10-28 18:12       ` Steven Dake
2003-10-28 22:44         ` Greg KH
2003-10-29 14:30           ` Andreas Jellinghaus [this message]
2003-10-29 17:20             ` Daniel Stekloff
2003-11-02 17:28               ` Andreas Jellinghaus
2003-11-03 23:29                 ` Daniel Stekloff
2003-10-29 19:18             ` Greg KH
2003-10-29 22:12               ` Andreas Jellinghaus
2003-10-29 22:43                 ` Greg KH
2003-10-29  5:12 Guo, Min
2003-10-29 16:10 ` Steven Dake
2003-10-29 19:04 ` Greg KH
2003-10-31  0:45 David Dodge
2003-10-31  0:58 ` Greg KH
2003-10-31  2:29   ` Dave Dodge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pan.2003.10.29.14.30.29.628488@dungeon.inka.de \
    --to=aj@dungeon.inka.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®