blob: ebb88daa18e5a8bb5ae36c0fe920fa09f5df2f4d [file] [log] [blame]
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
description "Start the udev daemon"
author "chromium-os-dev@chromium.org"
# Start udev early so flimflam can be notified of "wlan0". The
# general "trigger" for remaining devices is now in the udev-addon
# job
start on starting boot-services
respawn
expect fork
pre-start script
# udev uses inotify to monitor the dynamic rules directory
# /dev/.udev/rules.d; however, this directory must exist before
# udevd runs, or the inotify won't find the directory even if it
# is created later. This is an issue with udev-146. Udev
# versions 156 and later do not exhibit this problem, and for
# those this test is not necessary.
if [ ! -d /dev/.udev/rules.d ]; then
mkdir -p /dev/.udev/rules.d
fi
# If the driver for built-in WIFI is a module, the udev-addon job
# will have recorded the driver name on the previous boot cycle.
# Load that driver now so flimflam can config the wireless LAN sooner,
# ideally by the time login screen is up.
#
# Note: failure to probe the module here is NOT fatal.
drvfile=/var/lib/preload-wifi-driver
if [ -s $drvfile ] ; then
drv=$(head -1 $drvfile)
if ! modprobe "$drv" >/dev/null 2>&1 ; then
# If modprobe didn't like the alias file for some reason, just
# move it out of the way. The udev-addon job will make a new
# one.
mv $drvfile $drvfile.bad
MESSAGE="udev pre-start: modprobe $drv failed."
MESSAGE="$MESSAGE Renamed $drvfile with .bad suffix."
logger "$MESSAGE"
fi
fi
end script
exec udevd --daemon