meta-digi/meta-digi-dey/recipes-core/busybox/busybox-1.20.2/mdev

46 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
#===============================================================================
#
# mdev
#
# Copyright (C) 2013 by Digi International Inc.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
# Description: Device nodes bootscript
#
#===============================================================================
set -e
if [ "${1}" != "start" ]; then
exit 0
fi
MDEV="/sbin/mdev"
# Create shared memory mount point
mkdir -p /dev/shm
# Register mdev as hotplug to create devices.
if [ -f /proc/sys/kernel/hotplug ]; then
echo > /dev/mdev.seq
echo "${MDEV}" > /proc/sys/kernel/hotplug
fi
# Create all device nodes scanning /sys.
${MDEV} -s
# mount storage devices
usbmount
mmc-mount
# fire *add* event for ADC so the nodes are created in case of built-in driver
for i in $(echo /sys/bus/platform/drivers/*adc*/uevent); do
[ "${i}" = "/sys/bus/platform/drivers/*adc*/uevent" ] && continue
echo add > $i
done