On Sunday 08 November 2009 16:28:40 Ned Ludd wrote: > On Sun, 2009-11-08 at 16:00 -0600, Rob Landley wrote: > > On Sunday 08 November 2009 15:02:21 Ned Ludd wrote: > > > Anyway that example conf you are looking at was "before" you did any > > > porting of my first attempt of a mdev.c from that guys mini-udev.c > > > file. > > > > Apparently in the absence of something better, the LFS guys grabbed your > > old version. :) > > yeah dump that thing if you have not already. It's incompatible.
Hence wanting an example one merged that could be kept up to date with what Busybox currently supports. :) > > > These days my busybox-compat basic confs/script-foo look more like the > > > attached files. > > > > What's the event stuff for? I'm not following that... > > touchscreen events. Lots of things really expect /dev/event/* > And based on the type of event we are dealing with, I have needed to > setup diff symlinks in a more dynamic way then having to edit every > single mdev.conf for the exact device. I vaguely recall early on you wanted an mdev.conf #include syntax... > > > fb[0-9] 0:0 0600 @mkdir -pm 755 fb;cd fb && ln -sf ../$MDEV $(echo > > > $MDEV | > > > > cut -c 3-) > > > > > loop[0-9] 0:0 0640 @mkdir -pm 755 loop;cd loop && ln -sf ../$MDEV > > > $(echo > > > > $MDEV | cut -c 5-) > > > > > i2c-[0-9].* 0:0 0660 @mkdir -pm 755 i2c && cd i2c && ln -sf ../$MDEV > > > $(echo > > > > $MDEV | cut -c 5-) > > > > That's looking like a common enough idiom we'd want to support it... > > Yeah all the mkdir -m 755 calls annoy me. Would be nice if we could set > a default umask before the systems umask is set. > Example: when calling mdev from the inittab file. I just use a wrapper script that calls "umask", but I see your point. However, is there ever a reason to use a mask _other_ than 755 here? Checking xubuntu 9.04, I've got: $ ls -l /dev | grep "^d" drwxr-xr-x 2 root root 620 2009-11-06 01:31 block drwxr-xr-x 3 root root 60 2009-11-06 01:31 bus drwxr-xr-x 2 root root 3400 2009-11-09 15:29 char drwxr-xr-x 5 root root 100 2009-11-06 01:31 disk drwxr-xr-x 2 root root 60 2009-11-06 01:32 dri drwxr-xr-x 3 root root 300 2009-11-06 01:31 input drwxr-xr-x 2 root root 60 2009-11-06 01:31 mapper drwxr-xr-x 2 root root 60 2009-08-01 20:56 net drwxr-xr-x 2 root root 60 2009-11-06 01:31 pktcdvd drwxr-xr-x 2 root root 0 2009-11-06 01:31 pts drwxrwxrwt 2 root root 40 2009-11-06 01:31 shm drwxr-xr-x 2 root root 160 2009-11-06 01:31 snd And the only oddball (shm) is the mount point for /dev/shm which isn't handled by mdev anyway. (There's a _reason_ mdev never mounted /tmp on /dev itself.) 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. > 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 > > r...@device # mdev -s -f ./etc/mdev.conf -d ./dev/ > > Yes I know patches are welcome :) Nah, you need a chroot environment to test in. One of the big problems the busybox testsuite has always had is it can't do tests requiring root access. (This is why you have things like the second half of coreutils/chmod.c being a big commented out shell script for what _would_ be a test suite entry... except it requires root access to run. Hands up anybody who think that's even been noticed in the past couple years?) Back before The Bruce happened I was working on extending the test suite to be able to detect it was running as root and do automated tests on mount and such. I taught it to make a chroot directory to play in (copying all the binaries we actually used out of the host, and recursively using ldd to copy all the shared libraries those binaries called). If you look at the testsuite directory, the mkchroot and dochroot stuff in testing.sh is still there, as is mount.testroot. (And even umlwrapper.sh, using an emulator to fake root access as a normal user. These days I'd use qemu, of course.) The plan was to either autodetect when we were running as root or add some kind of "make root_tests" target that would use the emulator to fake root. (No, the "fakeroot" package isn't good enough. I can explain why if you're bored. :) Alas, I got interrupted by The Bruce, and what's there no longer seems to work. I wonder why. Bit rot...? No, git annotate says it got broken by 2dea01ca back in 2008. Denys checked in a patch to "remove bashisms" that made the code it touched obviously no longer works. (Remove the test for absolute paths and do the same transformation to relative paths too: that can't _possibly_ break anything, can it? After all, that test couldn't have had a reason to exist, could it?) Oh well. I have no interest in programming for the Defective Annoying SHell unless paid, and my approach to making things work with ash is to fix _ash_, not the script. Saying "this required bash extensions and thus didn't work on a posix-only shell, which is why it started with #!/bin/bash instead of #!/bin/sh. Now it doesn't work under ANY shell!" doesn't strike me as an improvement... > > Where's this being used? Just your personal systems, or is it part of > > gentoo- embeded or the gentoo boot or something? > > minimal misc devices I use mdev on. Not related to anything I've pushed > into gentoo. > > > (The upshot of this conversation, for me, is I no longer feel I have a > > clear idea of how this sucker's being used out in the field...) > > My usage mainly covers the HTC Wizard phone running Xfbdev (small > community). The AML-M8050 (Nobody really). A beagle board and some other > HTC phone that another dude uses. *shrug* Yeah, but at least _you_ use it, which is something. Rob -- Latency is more important than throughput. It's that simple. - Linus Torvalds _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
