Remove udev stuff from the source tree
Pick udev stuff from the running evironment instead. Change-Id: I90a004d0a2b83d3451e73ae351cf474a7bfd62ee
This commit is contained in:
parent
5682d59ca6
commit
0b81a3e0e8
6 changed files with 13 additions and 46 deletions
|
@ -66,7 +66,6 @@ mk_build_dir
|
||||||
|
|
||||||
INIT="$_DIR/../scripts/init"
|
INIT="$_DIR/../scripts/init"
|
||||||
FUNCTIONS_D="$_DIR/../scripts/d"
|
FUNCTIONS_D="$_DIR/../scripts/d"
|
||||||
LIB_UDEV="$_DIR/../udev"
|
|
||||||
|
|
||||||
MODULE_DIR=$MODULE_ROOT/lib/modules/$KERNEL_VERSION
|
MODULE_DIR=$MODULE_ROOT/lib/modules/$KERNEL_VERSION
|
||||||
FIRMWARE_DIR=$MODULE_ROOT/lib/firmware
|
FIRMWARE_DIR=$MODULE_ROOT/lib/firmware
|
||||||
|
@ -76,6 +75,13 @@ if [ ! -d "$MODULE_DIR" ]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
LIB_UDEV=$LIB_UDEV_ROOT/lib/udev
|
||||||
|
|
||||||
|
if [ ! -d "$LIB_UDEV" ]; then
|
||||||
|
echo "ERROR: udev directory not found at $LIB_UDEV"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
mk_build_dir
|
mk_build_dir
|
||||||
mkdir -p $TMP_BUILD_DIR/mnt
|
mkdir -p $TMP_BUILD_DIR/mnt
|
||||||
TMP_MOUNT_PATH=$TMP_BUILD_DIR/mnt
|
TMP_MOUNT_PATH=$TMP_BUILD_DIR/mnt
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
# options for initrd-create.sh
|
# options for initrd-create.sh
|
||||||
KERNEL_VERSION=${KERNEL_VERSION:-$(uname -r)}
|
KERNEL_VERSION=${KERNEL_VERSION:-$(uname -r)}
|
||||||
MODULE_ROOT=${MODULE_ROOT:-""}
|
MODULE_ROOT=${MODULE_ROOT:-""}
|
||||||
|
LIB_UDEV_ROOT=${LIB_UDEV_ROOT:-""}
|
||||||
BUSYBOX=${BUSYBOX:-$(which busybox)}
|
BUSYBOX=${BUSYBOX:-$(which busybox)}
|
||||||
IMAGE_NAME=${IMAGE_NAME:-"ramdisk"}
|
IMAGE_NAME=${IMAGE_NAME:-"ramdisk"}
|
||||||
FLAVOURS_DIR=$(dirname $0)/../flavours
|
FLAVOURS_DIR=$(dirname $0)/../flavours
|
||||||
|
|
|
@ -49,8 +49,10 @@ function create_base () {
|
||||||
mkdir -p "$TMP_MOUNT_PATH/var/lib/dhcp"
|
mkdir -p "$TMP_MOUNT_PATH/var/lib/dhcp"
|
||||||
mkdir -p "$TMP_MOUNT_PATH/var/run"
|
mkdir -p "$TMP_MOUNT_PATH/var/run"
|
||||||
|
|
||||||
|
mkdir -p "$TMP_MOUNT_PATH/lib/udev/rules.d"
|
||||||
cp -a "$LIB_UDEV" "$TMP_MOUNT_PATH/lib/udev"
|
cp -a "$LIB_UDEV/rules.d/50-firmware.rules" "$TMP_MOUNT_PATH/lib/udev/rules.d"
|
||||||
|
cp -a "$LIB_UDEV/rules.d/80-drivers.rules" "$TMP_MOUNT_PATH/lib/udev/rules.d"
|
||||||
|
cp -a "$LIB_UDEV/firmware" "$TMP_MOUNT_PATH/lib/udev"
|
||||||
# cjk adding for hwdiscovery support
|
# cjk adding for hwdiscovery support
|
||||||
cp "/sbin/dhclient-script" "$TMP_MOUNT_PATH/sbin"
|
cp "/sbin/dhclient-script" "$TMP_MOUNT_PATH/sbin"
|
||||||
|
|
||||||
|
@ -73,7 +75,7 @@ function populate_lib () {
|
||||||
echo "Populating /lib"
|
echo "Populating /lib"
|
||||||
|
|
||||||
libs=
|
libs=
|
||||||
for i in "$BUSYBOX" bash lsmod modprobe udevd udevadm wget reboot shutdown $BINARY_DEPS ; do
|
for i in "$BUSYBOX" "$LIB_UDEV/firmware" bash lsmod modprobe udevd udevadm wget reboot shutdown $BINARY_DEPS ; do
|
||||||
if "$BUSYBOX" --list | grep "^$i\$" >/dev/null; then
|
if "$BUSYBOX" --list | grep "^$i\$" >/dev/null; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
#!/bin/sh -e
|
|
||||||
|
|
||||||
FIRMWARE_DIRS="/lib/firmware/updates/$(uname -r) /lib/firmware/updates \
|
|
||||||
/lib/firmware/$(uname -r) /lib/firmware"
|
|
||||||
|
|
||||||
err() {
|
|
||||||
echo "$@" >&2
|
|
||||||
logger -t "${0##*/}[$$]" "$@" 2>/dev/null || true
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ ! -e /sys$DEVPATH/loading ]; then
|
|
||||||
err "udev firmware loader misses sysfs directory"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
for DIR in $FIRMWARE_DIRS; do
|
|
||||||
[ -e "$DIR/$FIRMWARE" ] || continue
|
|
||||||
echo 1 > /sys$DEVPATH/loading
|
|
||||||
cat "$DIR/$FIRMWARE" > /sys$DEVPATH/data
|
|
||||||
echo 0 > /sys$DEVPATH/loading
|
|
||||||
exit 0
|
|
||||||
done
|
|
||||||
|
|
||||||
echo -1 > /sys$DEVPATH/loading
|
|
||||||
err "Cannot find firmware file '$FIRMWARE'"
|
|
||||||
mkdir -p /dev/.udev/firmware-missing
|
|
||||||
file=$(echo "$FIRMWARE" | sed 's:/:\\x2f:g')
|
|
||||||
ln -s -f "$DEVPATH" /dev/.udev/firmware-missing/$file
|
|
||||||
exit 1
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
SUBSYSTEM=="firmware", ACTION=="add", RUN+="firmware.sh"
|
|
|
@ -1,11 +0,0 @@
|
||||||
ACTION!="add", GOTO="drivers_end"
|
|
||||||
|
|
||||||
DRIVER!="?*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $env{MODALIAS}"
|
|
||||||
SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", RUN+="/sbin/modprobe tifm_sd"
|
|
||||||
SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", RUN+="/sbin/modprobe tifm_ms"
|
|
||||||
SUBSYSTEM=="memstick", RUN+="/sbin/modprobe --all ms_block mspro_block"
|
|
||||||
SUBSYSTEM=="i2o", RUN+="/sbin/modprobe i2o_block"
|
|
||||||
SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST!="[module/sg]", RUN+="/sbin/modprobe sg"
|
|
||||||
SUBSYSTEM=="module", KERNEL=="parport_pc", RUN+="/sbin/modprobe ppdev"
|
|
||||||
|
|
||||||
LABEL="drivers_end"
|
|
Loading…
Reference in a new issue