systemd/write_dev_root_rule
2012-11-02 16:30:32 +00:00

14 lines
406 B
Bash

#!/bin/sh
eval $(/sbin/udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/)
[ "$ROOT_MAJOR" -gt 0 ] || return
mkdir -m 0755 -p /run/udev/rules.d >/dev/null 2>&1
ln -sf /run/udev /dev/.udev 2>/dev/null || :
echo "ACTION==\"add|change\", SUBSYSTEM==\"block\", \
ENV{MAJOR}==\"$ROOT_MAJOR\", ENV{MINOR}==\"$ROOT_MINOR\", \
SYMLINK+=\"root\"" > /run/udev/rules.d/10-root-symlink.rules
exit 0