# udev-finish - save udev log and update rules
#
# While udev runs we not only create the log file of initial device
# creation but udev rules may be generated, we need to copy both of
# these out of /dev and onto the root filesystem.

description	"save udev log and update rules"

start on (startup
	  and filesystem
	  and started udev
	  and stopped udevtrigger
	  and stopped udevmonitor)

pre-start script
    # Save udev log in /var/log/udev
    if [ -e /dev/.udev.log ]
    then
	mv -f /dev/.udev.log /var/log/udev || :
    fi

    # Copy any rules generated while the root filesystem was read-only
    /lib/udev/udev-finish
end script
