devfs: optionally add missing symbolic links

If symbolic links for /dev/{fd,stdin,stdout,stderr,core} do not exist
once /dev is mounted, we should create them.
This commit is contained in:
William Hubbs 2014-11-20 10:55:53 -06:00
parent 93ba67eff9
commit 8d0ca13fbd

View File

@ -69,7 +69,14 @@ seed_dev()
# so udev can add its start-message to dmesg
[ -c /dev/kmsg ] || mknod -m 660 /dev/kmsg c 1 11
# Mount required stuff as user may not have then in /etc/fstab
# extra symbolic links not provided by default
[ -e /dev/fd ] || ln -snf /proc/self/fd /dev/fd
[ -e /dev/stdin ] || ln -snf /proc/self/fd/0 /dev/stdin
[ -e /dev/stdout ] || ln -snf /proc/self/fd/1 /dev/stdout
[ -e /dev/stderr ] || ln -snf /proc/self/fd/2 /dev/stderr
[ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core
# Mount required directories as user may not have them in /etc/fstab
for x in \
"mqueue /dev/mqueue 1777 ,nodev mqueue" \
"devpts /dev/pts 0755 ,gid=5,mode=0620 devpts" \