From ae39d6a370ebb0171bd666a22159b70a2e921877 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 4 Mar 2007 20:31:53 +0000 Subject: nuke mdev and replace it with hotplug2 :) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6512 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/sbin/hotplug | 28 ---------------------------- package/base-files/files/sbin/hotplug-call | 26 ++++++++++++++++++++++++++ package/base-files/files/sbin/ifdown | 2 +- package/base-files/files/sbin/mount_root | 2 +- 4 files changed, 28 insertions(+), 30 deletions(-) delete mode 100755 package/base-files/files/sbin/hotplug create mode 100755 package/base-files/files/sbin/hotplug-call (limited to 'package/base-files/files/sbin') diff --git a/package/base-files/files/sbin/hotplug b/package/base-files/files/sbin/hotplug deleted file mode 100755 index 189cfee67c..0000000000 --- a/package/base-files/files/sbin/hotplug +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# Copyright (C) 2006 OpenWrt.org - -[ -x /sbin/mdev -a -n "$ACTION" -a -n "$DEVPATH" ] && /sbin/mdev "$@" - -# bypass the normal hotplug path for firmware loading -# would otherwise cause problems with drivers like bcm43xx -[ "$1" = "firmware" -a "$ACTION" = "add" ] && { - [ -f "/lib/firmware/$FIRMWARE" ] && { - echo 1 > "/sys$DEVPATH/loading" - cp "/lib/firmware/$FIRMWARE" "/sys$DEVPATH/data" - echo 0 > "/sys$DEVPATH/loading" - } - exit 0 -} - -. /etc/functions.sh - -PATH=/bin:/sbin:/usr/bin:/usr/sbin -LOGNAME=root -USER=root -export PATH LOGNAME USER - -[ \! -z "$1" -a -d /etc/hotplug.d/$1 ] && { - for script in $(ls /etc/hotplug.d/$1/* 2>&-); do ( - [ -f $script ] && . $script - ); done -} diff --git a/package/base-files/files/sbin/hotplug-call b/package/base-files/files/sbin/hotplug-call new file mode 100755 index 0000000000..b1b6f97b23 --- /dev/null +++ b/package/base-files/files/sbin/hotplug-call @@ -0,0 +1,26 @@ +#!/bin/sh +# Copyright (C) 2006 OpenWrt.org + +# bypass the normal hotplug path for firmware loading +# would otherwise cause problems with drivers like bcm43xx +[ "$1" = "firmware" -a "$ACTION" = "add" ] && { + [ -f "/lib/firmware/$FIRMWARE" ] && { + echo 1 > "/sys$DEVPATH/loading" + cp "/lib/firmware/$FIRMWARE" "/sys$DEVPATH/data" + echo 0 > "/sys$DEVPATH/loading" + } + exit 0 +} + +. /etc/functions.sh + +PATH=/bin:/sbin:/usr/bin:/usr/sbin +LOGNAME=root +USER=root +export PATH LOGNAME USER + +[ \! -z "$1" -a -d /etc/hotplug.d/$1 ] && { + for script in $(ls /etc/hotplug.d/$1/* 2>&-); do ( + [ -f $script ] && . $script + ); done +} diff --git a/package/base-files/files/sbin/ifdown b/package/base-files/files/sbin/ifdown index 540c69f169..e00a4e38da 100755 --- a/package/base-files/files/sbin/ifdown +++ b/package/base-files/files/sbin/ifdown @@ -21,7 +21,7 @@ config_get proto "$cfg" proto config_get iface "$cfg" device [ "$proto" = "static" ] && { - env -i ACTION="ifdown" INTERFACE="$config" DEVICE="$iface" PROTO=static /sbin/hotplug "iface" & + env -i ACTION="ifdown" INTERFACE="$config" DEVICE="$iface" PROTO=static /sbin/hotplug-call "iface" & } # call interface stop handler diff --git a/package/base-files/files/sbin/mount_root b/package/base-files/files/sbin/mount_root index 9a87fadbaa..dd9d99d8e6 100755 --- a/package/base-files/files/sbin/mount_root +++ b/package/base-files/files/sbin/mount_root @@ -12,7 +12,7 @@ else mount -t tmpfs tmpfs /dev -o size=512K mknod /dev/console c 5 1 mkdir /dev/shm - /sbin/mdev -s + /sbin/hotplug2 --no-persistent --coldplug fi mkdir -p /dev/pts mount none /dev/pts -t devpts -- cgit v1.2.3