An example mdev.conf
Rob Landley
rob at landley.net
Tue Nov 10 20:12:08 UTC 2009
On Tuesday 10 November 2009 09:32:45 Ned Ludd wrote:
> > However, the point I was trying to raise is that the "mkdir && cd && ln"
> > combination seems kind of common, and it might be nice to teach mdev to
> > do that. The question is what syntax?
> >
> > I note that Natanael's
> > http://git.alpinelinux.org/cgit/aports/tree/main/busybox-initscripts/mdev
> >.conf had this:
> >
> > ram([0-9]*) root:disk 0660 >rd/%1
> > loop([0-9]+) root:disk 0660 >loop/%1
> >
> > But I dunno if that's standard or if he patched it.
>
> I think he assumes the dir exists already. But it's a damn spiffy conf
> he has.
Yup.
Detecting the need to mkdir wouldn't be too hard, and it _is_ a common
construct (I have no idea why). Personally, I'd just wait for somebody to
actually need a directory with permissions other than 755 (and complain about
the lack thereof to us) before worrying about adding infrastructure for it.
(And then it could be a config line, it could be an environment variable, we
could add a way to specify it on the line... Wait for more context to see
what looks good.)
I'd also like to test hotplug removal, which gets us back to setting up a root
testing environment, which probably means me mucking in and unbreaking the one
I did...
> > > For testing or even to make a quick set of default devices a feature to
> > > define the /dev/ dir would be good. As well as the ability to use
> > > another mdev.conf vs the system one. Maybe something like
> > >
> > > root at device # mdev -s -f ./etc/mdev.conf -d ./dev/
> > >
> > > Yes I know patches are welcome :)
> >
> > Nah, you need a chroot environment to test in.
>
> I know and it's a bit of a pita cuz you have to -obind mount additional
> dirs to be able to make use of it. ie 3-4 cmds vs 1
Which is why I made a shell script to do it, and to clean up after it. (The
second being the hard part, especially if the tests fail and you don't know
what state they left things in. more an issue with "mount" than mdev, but in
either case using an emulator takes away the _need_ to do most of this hard
part.)
Rob
--
Latency is more important than throughput. It's that simple. - Linus Torvalds
More information about the busybox
mailing list