#!/bin/sh -e

export TZ=/etc/localtime

[ -f /etc/default/udev ] && . /etc/default/udev

echo "Caching udev devnodes"

if [ "$DEVCACHE" != "" ]; then
	echo -n "Populating dev cache"
	(cd /; tar cf $DEVCACHE dev)
	mv /tmp/uname /etc/udev/saved.uname
	mv /tmp/cmdline /etc/udev/saved.cmdline
	mv /tmp/devices /etc/udev/saved.devices
	mv /tmp/atags /etc/udev/saved.atags
	echo
else
	rm -f /tmp/uname
	rm -f /tmp/cmdline
	rm -f /tmp/devices
	rm -f /tmp/atags
fi

exit 0
