mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-27 17:55:55 +02:00
nuke mdev and replace it with hotplug2 :)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6512 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
a4a2f867c8
commit
203cccc4a2
@ -37,6 +37,9 @@ FEATURES:=$(sort $(FEATURES))
|
|||||||
|
|
||||||
# For target profile selection - the default set
|
# For target profile selection - the default set
|
||||||
DEFAULT_PACKAGES:=base-files libgcc uclibc bridge busybox dnsmasq dropbear iptables mtd ppp ppp-mod-pppoe mtd kmod-ipt-nathelper
|
DEFAULT_PACKAGES:=base-files libgcc uclibc bridge busybox dnsmasq dropbear iptables mtd ppp ppp-mod-pppoe mtd kmod-ipt-nathelper
|
||||||
|
ifneq ($(KERNEL),2.4)
|
||||||
|
DEFAULT_PACKAGES+=udevtrigger hotplug2
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(DUMP),1)
|
ifeq ($(DUMP),1)
|
||||||
all: dumpinfo
|
all: dumpinfo
|
||||||
|
@ -12,7 +12,7 @@ _C=0
|
|||||||
NO_EXPORT=1
|
NO_EXPORT=1
|
||||||
|
|
||||||
hotplug_dev() {
|
hotplug_dev() {
|
||||||
env -i ACTION=$1 INTERFACE=$2 /sbin/hotplug net
|
env -i ACTION=$1 INTERFACE=$2 /sbin/hotplug-call net
|
||||||
}
|
}
|
||||||
|
|
||||||
append() {
|
append() {
|
||||||
|
7
package/base-files/files/etc/hotplug2.rules
Normal file
7
package/base-files/files/etc/hotplug2.rules
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
DEVPATH is set {
|
||||||
|
makedev /dev/%DEVICENAME% 0644
|
||||||
|
}
|
||||||
|
|
||||||
|
MODALIAS is set {
|
||||||
|
exec /sbin/modprobe -q %MODALIAS% ;
|
||||||
|
}
|
@ -20,8 +20,11 @@ start() {
|
|||||||
|
|
||||||
# manually trigger hotplug before loading modules
|
# manually trigger hotplug before loading modules
|
||||||
for iface in $(awk -F: '/:/ {print $1}' /proc/net/dev); do
|
for iface in $(awk -F: '/:/ {print $1}' /proc/net/dev); do
|
||||||
/usr/bin/env -i ACTION=add INTERFACE="$iface" /sbin/hotplug net
|
/usr/bin/env -i ACTION=add INTERFACE="$iface" /sbin/hotplug-call net
|
||||||
done
|
done
|
||||||
|
|
||||||
|
/sbin/hotplug2 --persistent &
|
||||||
|
echo /sbin/hotplug-call > /proc/sys/kernel/hotplug
|
||||||
|
|
||||||
load_modules /etc/modules.d/*
|
load_modules /etc/modules.d/*
|
||||||
}
|
}
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
null 0:0 777
|
|
||||||
zero 0:0 666
|
|
||||||
console 0:5 0600
|
|
||||||
tty 0:5 0660
|
|
||||||
ttyS* 0:20 640
|
|
@ -157,7 +157,7 @@ setup_interface() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
env -i ACTION="ifup" INTERFACE="$config" DEVICE="$iface" PROTO=static /sbin/hotplug "iface" &
|
env -i ACTION="ifup" INTERFACE="$config" DEVICE="$iface" PROTO=static /sbin/hotplug-call "iface" &
|
||||||
;;
|
;;
|
||||||
dhcp)
|
dhcp)
|
||||||
# prevent udhcpc from starting more than once
|
# prevent udhcpc from starting more than once
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Copyright (C) 2006 OpenWrt.org
|
# Copyright (C) 2006 OpenWrt.org
|
||||||
|
|
||||||
[ -x /sbin/mdev -a -n "$ACTION" -a -n "$DEVPATH" ] && /sbin/mdev "$@"
|
|
||||||
|
|
||||||
# bypass the normal hotplug path for firmware loading
|
# bypass the normal hotplug path for firmware loading
|
||||||
# would otherwise cause problems with drivers like bcm43xx
|
# would otherwise cause problems with drivers like bcm43xx
|
||||||
[ "$1" = "firmware" -a "$ACTION" = "add" ] && {
|
[ "$1" = "firmware" -a "$ACTION" = "add" ] && {
|
@ -21,7 +21,7 @@ config_get proto "$cfg" proto
|
|||||||
|
|
||||||
config_get iface "$cfg" device
|
config_get iface "$cfg" device
|
||||||
[ "$proto" = "static" ] && {
|
[ "$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
|
# call interface stop handler
|
||||||
|
@ -12,7 +12,7 @@ else
|
|||||||
mount -t tmpfs tmpfs /dev -o size=512K
|
mount -t tmpfs tmpfs /dev -o size=512K
|
||||||
mknod /dev/console c 5 1
|
mknod /dev/console c 5 1
|
||||||
mkdir /dev/shm
|
mkdir /dev/shm
|
||||||
/sbin/mdev -s
|
/sbin/hotplug2 --no-persistent --coldplug
|
||||||
fi
|
fi
|
||||||
mkdir -p /dev/pts
|
mkdir -p /dev/pts
|
||||||
mount none /dev/pts -t devpts
|
mount none /dev/pts -t devpts
|
||||||
|
@ -14,7 +14,7 @@ hotplug_event() {
|
|||||||
config_get proto $ifc proto
|
config_get proto $ifc proto
|
||||||
[ "$proto" = "dhcp" ] || continue
|
[ "$proto" = "dhcp" ] || continue
|
||||||
|
|
||||||
env -i ACTION="$1" INTERFACE="$ifc" DEVICE="$ifname" PROTO=dhcp /sbin/hotplug iface
|
env -i ACTION="$1" INTERFACE="$ifc" DEVICE="$ifname" PROTO=dhcp /sbin/hotplug-call iface
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ config BUSYBOX_CONFIG_LOSETUP
|
|||||||
|
|
||||||
config BUSYBOX_CONFIG_MDEV
|
config BUSYBOX_CONFIG_MDEV
|
||||||
bool "mdev"
|
bool "mdev"
|
||||||
default y
|
default n
|
||||||
help
|
help
|
||||||
mdev is a mini-udev implementation: call it with -s to populate
|
mdev is a mini-udev implementation: call it with -s to populate
|
||||||
/dev from /sys, then "echo /sbin/mdev > /proc/sys/kernel/hotplug" to
|
/dev from /sys, then "echo /sbin/mdev > /proc/sys/kernel/hotplug" to
|
||||||
@ -276,7 +276,7 @@ config BUSYBOX_CONFIG_MDEV
|
|||||||
|
|
||||||
config BUSYBOX_CONFIG_FEATURE_MDEV_CONF
|
config BUSYBOX_CONFIG_FEATURE_MDEV_CONF
|
||||||
bool "Support /etc/mdev.conf"
|
bool "Support /etc/mdev.conf"
|
||||||
default y
|
default n
|
||||||
depends on BUSYBOX_CONFIG_MDEV
|
depends on BUSYBOX_CONFIG_MDEV
|
||||||
help
|
help
|
||||||
The mdev config file contains lines that look like:
|
The mdev config file contains lines that look like:
|
||||||
|
@ -2,10 +2,3 @@ config BUSYBOX_CONFIG_FEATURE_DEVFS
|
|||||||
default y if LINUX_2_4
|
default y if LINUX_2_4
|
||||||
default n if LINUX_2_6
|
default n if LINUX_2_6
|
||||||
|
|
||||||
config BUSYBOX_CONFIG_MDEV
|
|
||||||
default n if LINUX_2_4
|
|
||||||
default y if LINUX_2_6
|
|
||||||
|
|
||||||
config BUSYBOX_CONFIG_FEATURE_MDEV_CONF
|
|
||||||
default n if LINUX_2_4
|
|
||||||
default y if LINUX_2_6
|
|
||||||
|
@ -13,6 +13,7 @@ button_action() {(
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
[ "$ACTION" = "released" -a "$BUTTON" = "3g" ] && {
|
[ "$ACTION" = "released" -a "$BUTTON" = "3g" ] && {
|
||||||
|
HOTPLUG="$(cat /proc/sys/kernel/hotplug)"
|
||||||
(echo /bin/true > /proc/sys/kernel/hotplug)
|
(echo /bin/true > /proc/sys/kernel/hotplug)
|
||||||
|
|
||||||
include /lib/network
|
include /lib/network
|
||||||
@ -31,5 +32,5 @@ button_action() {(
|
|||||||
}
|
}
|
||||||
config_load network
|
config_load network
|
||||||
|
|
||||||
(echo /sbin/hotplug > /proc/sys/kernel/hotplug)
|
(echo $HOTPLUG > /proc/sys/kernel/hotplug)
|
||||||
} &
|
} &
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
[ -z "$6" ] || env -i ACTION="ifdown" INTERFACE="$6" PROTO=ppp /sbin/hotplug "iface"
|
[ -z "$6" ] || env -i ACTION="ifdown" INTERFACE="$6" PROTO=ppp /sbin/hotplug-call "iface"
|
||||||
|
|
||||||
[ -d /etc/ppp/ip-down.d ] && {
|
[ -d /etc/ppp/ip-down.d ] && {
|
||||||
for SCRIPT in /etc/ppp/ip-down.d/*
|
for SCRIPT in /etc/ppp/ip-down.d/*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
[ -z "$6" ] || env -i ACTION="ifup" INTERFACE="$6" PROTO=ppp /sbin/hotplug "iface"
|
[ -z "$6" ] || env -i ACTION="ifup" INTERFACE="$6" PROTO=ppp /sbin/hotplug-call "iface"
|
||||||
|
|
||||||
[ -d /etc/ppp/ip-up.d ] && {
|
[ -d /etc/ppp/ip-up.d ] && {
|
||||||
for SCRIPT in /etc/ppp/ip-up.d/*
|
for SCRIPT in /etc/ppp/ip-up.d/*
|
||||||
|
10
package/udev/patches/02-udevtrigger_no_config.patch
Normal file
10
package/udev/patches/02-udevtrigger_no_config.patch
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
--- udev.old/udevtrigger.c 2007-03-03 18:42:09.000000000 +0100
|
||||||
|
+++ udev.dev/udevtrigger.c 2007-03-04 21:15:18.459211632 +0100
|
||||||
|
@@ -446,7 +446,6 @@
|
||||||
|
};
|
||||||
|
|
||||||
|
logging_init("udevtrigger");
|
||||||
|
- udev_config_init();
|
||||||
|
dbg("version %s", UDEV_VERSION);
|
||||||
|
sysfs_init();
|
||||||
|
|
@ -65,7 +65,7 @@ eval ${FAILSAFE:+failsafe}
|
|||||||
|
|
||||||
lock -w /tmp/.failsafe
|
lock -w /tmp/.failsafe
|
||||||
set_state preinit
|
set_state preinit
|
||||||
echo /sbin/hotplug > /proc/sys/kernel/hotplug
|
echo /sbin/hotplug-call > /proc/sys/kernel/hotplug
|
||||||
|
|
||||||
ifconfig $ifname 0.0.0.0 down
|
ifconfig $ifname 0.0.0.0 down
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ else
|
|||||||
mknod /dev/console c 5 1
|
mknod /dev/console c 5 1
|
||||||
mkdir /dev/pts
|
mkdir /dev/pts
|
||||||
mkdir /dev/shm
|
mkdir /dev/shm
|
||||||
/sbin/mdev -s
|
/sbin/hotplug2 --no-persistent --coldplug
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mount none /dev/pts -t devpts
|
mount none /dev/pts -t devpts
|
||||||
|
Loading…
Reference in New Issue
Block a user