summaryrefslogtreecommitdiff
path: root/util-linux/mdev.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* mdev: treat zero-length /dev/mdev.seq the same as "\n" one. Closes 7334Denys Vlasenko2014-09-081-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: use $DEVNAME in uevent sysfs file for device node nameNikolaus Voss2013-05-131-12/+35
| | | | | | | | | | | | | | 516530c932bd17d87c9eb4347a490be051e495f4 uses $DEVNAME variable for device node name. This is fine, but only works for hotplugging, "mdev -s" will behave differently when DEVNAME and basename(path) differ. This patch extracts the DEVNAME from the uevent sysfs file in make_device(), thus works for hot- and coldplugging; so using the environment DEVNAME on hotplug events is no longer necessary. Signed-off-by: Nikolaus Voss <n.voss@weinmann.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: call index_in_strings on $ACTION only after we checked it for NULLDenys Vlasenko2013-04-021-3/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: fix build failureDenys Vlasenko2013-03-171-2/+1
| | | | | | The error was "error: 'struct globals' has no member named 'parser'" Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: improve $SEQ handling; improve debug loggingDenys Vlasenko2013-02-271-88/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sequential run of concurrent mdev's was too simplistic: they waited for /dev/mdev.seq to match. This could sometimes cause cumulative loss of time on the order of a second. Added SIGCHLD signaling from exiting mdev to all other mdev's. Added debugging required to see that code actually works as intended. Example of /dev/mdev.log (with "woken up" elevated from dbg lvl 3 to 2): mdev[1023]: first seq written ^^^^ seq, not pid mdev[1023]: 35.022395 ACTION:add SUBSYSTEM:module DEVNAME:(null) DEVPATH:/module/lib80211 mdev[1023]: rule matched, line -1 ^^^^^^^ means "default rule" mdev[1023]: 35.022676 exiting ^^^^^^^^^ second,usec timestamp mdev[1024]: 35.069691 ACTION:add SUBSYSTEM:vc DEVNAME:vcs9 DEVPATH:/devices/virtual/vc/vcs9 mdev[1024]: dev 7,9 mdev[1025]: 35.069889 waiting for '1024' mdev[1026]: 35.069946 waiting for '1024' mdev[1027]: 35.070151 waiting for '1024' mdev[1024]: rule matched, line -1 mdev[1024]: mknod vcs9 (7,9) 20660 0:0 mdev[1024]: 35.070346 exiting mdev[1025]: woken up mdev[1026]: woken up mdev[1025]: 35.071213 ACTION:add SUBSYSTEM:vc DEVNAME:vcsa9 DEVPATH:/devices/virtual/vc/vcsa9 ^^^^^^^^^ took only a millisecond to start running after prev mdev exited mdev[1025]: dev 7,137 mdev[1027]: woken up mdev[1025]: rule matched, line -1 mdev[1025]: mknod vcsa9 (7,137) 20660 0:0 mdev[1025]: 35.072109 exiting function old new delta mdev_main 849 1372 +523 curtime - 59 +59 dirAction 87 134 +47 static.ts - 8 +8 keywords 19 12 -7 make_device 2189 2119 -70 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: add environment variable matchDenys Vlasenko2013-02-261-6/+71
| | | | | | | | | | | | | function old new delta make_device 1998 2189 +191 clean_up_cur_rule 61 96 +35 dirAction 75 87 +12 mdev_main 838 849 +11 packed_usage 29272 29273 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/0 up/down: 250/0) Total: 250 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: chdir back to /dev after trying to read firmwareDenys Vlasenko2013-02-041-1/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: extend debug logging outputDenys Vlasenko2013-01-301-1/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: fix mode of dir1 in =dir1/dir2/file ruleDenys Vlasenko2013-01-211-2/+14
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: tell kernel that we didn't find the firmwareChristoph Lohmann2012-05-191-17/+24
| | | | | | | | function old new delta mdev_main 797 801 +4 Signed-off-by: Christoph Lohmann <20h@r-36.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Merge branch 'master' of git+ssh://vda@busybox.net/var/lib/git/busyboxDenys Vlasenko2012-05-191-37/+14
|\
| * mdev: remove undocumented subsystem/devname matching hackDenys Vlasenko2012-05-181-29/+2
| | | | | | | | | | | | | | It was colliding with matching of devnames with slashes. We need a more generic way to examine env.vars in rules anyway. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * mdev: when found, print major,minor into mdev.logDenys Vlasenko2012-05-181-8/+12
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | tweak help textDenys Vlasenko2012-05-181-2/+2
|/ | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: add support for $DEVNAME and /dev/mdev.log debug aidDenys Vlasenko2012-05-181-20/+147
| | | | | | | | | | | | | | | function old new delta make_device 1843 2083 +240 mdev_main 712 804 +92 packed_usage 29236 29251 +15 keywords 288 19 -269 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 347/-269) Total: 78 bytes text data bss dec hex filename 887506 497 7584 895587 daa63 busybox_old 887982 497 7584 896063 dac3f busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: fix mode of creatred node if config file support is not configuredDenys Vlasenko2012-04-211-3/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: add a comment. no code changesDenys Vlasenko2012-02-061-1/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: fix wrong sizeofJavier Viguera2012-01-301-1/+1
| | | | | Signed-off-by: Javier Viguera <javier.viguera@digi.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: do not treat non-leading '#' chars as start of comment. Closes 4676Denys Vlasenko2012-01-111-1/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: trim overlong comments. No code changesDenys Vlasenko2011-09-221-30/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: don't reparse rules on -sDenys Vlasenko2011-09-221-217/+341
| | | | | | | | | | | | function old new delta make_device 1648 1843 +195 clean_up_cur_rule - 61 +61 make_default_cur_rule - 41 +41 mdev_main 690 712 +22 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 2/0 up/down: 319/0) Total: 319 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* add INIT_G()'s. No code changes.Denys Vlasenko2011-09-211-0/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: expand --help so that it's actually useful.Denys Vlasenko2011-09-191-8/+80
| | | | | | | function old new delta packed_usage 28634 28822 +188 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* simplify parsing of /etc/busybox.confDenys Vlasenko2011-05-161-1/+1
| | | | | | | function old new delta parse_config_file 799 667 -132 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* move remaining help text from include/usage.src.hPere Orga2011-04-111-0/+35
| | | | | Signed-off-by: Pere Orga <gotrunks@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: make GNU licensing statement forms more regularDenys Vlasenko2010-08-161-1/+1
| | | | | | | This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: fix non-working device deletion, add a test for thatDenys Vlasenko2010-08-161-2/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: introduce and use bb_unsetenv_and_freeDenys Vlasenko2010-06-241-4/+2
| | | | | | | | | | | | | function old new delta bb_unsetenv_and_free - 17 +17 tcpudpsvd_main 1819 1810 -9 safe_setenv 58 47 -11 udhcp_run_script 630 616 -14 make_device 1683 1663 -20 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/4 up/down: 17/-54) Total: -37 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: add "!" syntax supportDenys Vlasenko2010-04-021-19/+32
| | | | | | | | | Based on the patch by Steve Bennett <steveb@workware.net.au> function old new delta make_device 1640 1673 +33 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: merge some common stringsDenys Vlasenko2010-03-231-1/+1
| | | | | | | | text data bss dec hexfilename 838650 8009 0 846659 ceb43busybox_old 838519 8009 0 846528 ceac0busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: fix a trivial SEGVDenys Vlasenko2010-03-161-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: fix subsystem passing (new kernels broke it again) - bugs 639, 721.Denys Vlasenko2010-02-241-22/+32
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: suppress ~60% of "aliased warnings" on gcc-4.4.1Denys Vlasenko2010-02-041-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: print line# in error messagesDenys Vlasenko2009-11-071-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: do not die on mknod errorsDenys Vlasenko2009-11-011-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: adjust error messageBernhard Reutner-Fischer2009-10-271-1/+1
| | | | | | | | | | function old new delta .rodata 126715 126706 -9 (reusing common error string) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: handle string modesBernhard Reutner-Fischer2009-10-271-2/+3
| | | | | | | parse ugoa=rwxXst via bb_parse_mode (+5b) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: tiny shrinkage by index_in_stringsBernhard Reutner-Fischer2009-10-271-3/+6
| | | | | | | | | text data bss dec hex filename 2633 0 0 2633 a49 util-linux/mdev.o.old 2624 0 0 2624 a40 util-linux/mdev.o Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: be more permissive on errors (dont die): mdev -s users want thatDenys Vlasenko2009-07-021-3/+7
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: set $MDEV correctly for renamed nodesDenys Vlasenko2009-07-021-37/+39
| | | | | | | | function old new delta make_device 1467 1502 +35 build_alias 78 - -78 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: fix the case when move rule deletes node with name == device_nameDenys Vlasenko2009-06-221-19/+17
| | | | | Signed-off-by: Jean Wolter <jw5@os.inf.tu-dresden.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: revert last wrong commitDenys Vlasenko2009-05-041-6/+7
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: do not exit if user:group parse failed. closes bug 309.Denys Vlasenko2009-05-021-1/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: fix a case where we mangle device_path string and then use it.Denys Vlasenko2009-05-011-1/+4
|
* mdev: enlarge inline documentationDenis Vlasenko2009-04-191-6/+22
|
* mdev: support $ENVVAR=regexDenis Vlasenko2009-04-191-27/+42
|
* mdev: Rob's #if forest removalDenis Vlasenko2009-04-191-178/+146
| | | | | *: remove superfluous conts in "f(type *const param)"
* mdev: add large comment, fix a buglet with subsystem and /sys/blockDenis Vlasenko2009-04-171-4/+42
|
* mdev: set mode, needed when device node already exists.Denis Vlasenko2009-04-161-0/+1
|
* mdev: change subsystem syntax from /subsystem to subsystem/devnameDenis Vlasenko2009-04-161-13/+15
|