#!/bin/sh

source /etc/utils/shell-utils.sh

UDEVBIN=/bin/udevd
UDEVCTRL=/bin/udevadm
UDEVTRG=/bin/udevadm
UDEVSTL=/bin/udevadm

mkdir -p /dev/pts

grep -q devtmpfs /proc/mounts || mount -t devtmpfs none /dev
grep -q devpts /proc/mounts   || mount -t devpts devpts /dev/pts

mkdir -p /dev/.udev

${UDEVBIN} --daemon

log "[IM][system init][UDEV][+] REPLAYING UDEV EVENTS..."
${UDEVCTRL} control --env STARTUP=1
${UDEVTRG} trigger --action=add
(${UDEVSTL} settle --timeout=3; ${UDEVCTRL} control --env STARTUP=)&

