implement makeCoreNodes()

This commit is contained in:
belliash 2012-01-22 11:15:10 +01:00
parent 7e5c54414f
commit b9a1efe4ef
1 changed files with 28 additions and 0 deletions

View File

@ -105,6 +105,34 @@ function makeCoreDirectories() {
return 0
}
#-------------------------------------------------------------------------------
# Creates base device nodes and symlinks in specified directory
# Parameters: %directory%
#-------------------------------------------------------------------------------
function makeCoreNodes() {
local DIR="${1}"
makeNode ${DIR} 600 console c 5 1 || return 1
makeNode ${DIR} 600 kmsg c 1 11 || return 1
makeNode ${DIR} 777 null c 1 3 || return 1
makeNode ${DIR} 666 ptmx c 5 2 || return 1
makeNode ${DIR} 644 ptyp0 c 2 0 || return 1
makeNode ${DIR} 666 random c 1 8 || return 1
makeNode ${DIR} 666 tty c 5 0 || return 1
makeNode ${DIR} 666 tty0 c 4 0 || return 1
makeNode ${DIR} 644 ttyp0 c 3 0 || return 1
makeNode ${DIR} 666 urandom c 1 9 || return 1
makeNode ${DIR} 666 zero c 1 5 || return 1
for n in {0..3}; do
makeNode ${DIR} 600 ttyS${n} c 4 $(( 64 + $n )) || return 1
done
run "ln -sfv /proc/self/fd ${DIR}/fd" || return 1
run "ln -sfv /proc/self/fd/0 ${DIR}/stdin" || return 1
run "ln -sfv /proc/self/fd/1 ${DIR}/stdout" || return 1
run "ln -sfv /proc/self/fd/2 ${DIR}/stderr" || return 1
run "ln -sfv /proc/kcore ${DIR}/core" || return 1
return 0
}
#-------------------------------------------------------------------------------
# Creates all components of the specified directories
# Parameters: %directory%