diff options
author | Roy Marples <roy@marples.name> | 2008-01-11 19:19:33 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2008-01-11 19:19:33 +0000 |
commit | bcbdb0ed1371ee359bc3da948690c2a2d6f597db (patch) | |
tree | cf732cd65b3514b352a75a5cd6d5e45fe098d5f4 | |
parent | 99ef2748485ff8ef67a0595b62912f176a7a593c (diff) |
Add wscons script. We still need to convert this to a conf.d format.
-rw-r--r-- | init.d.NetBSD/ttys | 2 | ||||
-rw-r--r-- | init.d.NetBSD/wscons | 99 | ||||
-rw-r--r-- | runlevels/Makefile.NetBSD | 2 |
3 files changed, 101 insertions, 2 deletions
diff --git a/init.d.NetBSD/ttys b/init.d.NetBSD/ttys index c8e9d872..59b66743 100644 --- a/init.d.NetBSD/ttys +++ b/init.d.NetBSD/ttys @@ -1,5 +1,5 @@ #!/sbin/runscript -# Copyright 2007 Roy Marples <roy@marples.name> +# Copyright 2008 Roy Marples <roy@marples.name> # All rights reserved. Released under the 2-clause BSD license. start() diff --git a/init.d.NetBSD/wscons b/init.d.NetBSD/wscons new file mode 100644 index 00000000..7859f5fb --- /dev/null +++ b/init.d.NetBSD/wscons @@ -0,0 +1,99 @@ +#!/sbin/runscript +# Copyright 2008 Roy Marples <roy@marples.name> +# All rights reserved. Released under the 2-clause BSD license. + +depend() +{ + need localmount +} + +start() +{ + wscfg=/usr/sbin/wsconscfg + wsfld=/usr/sbin/wsfontload + wsctl=/sbin/wsconsctl + config=/etc/wscons.conf + + # args mean: + # screen idx scr emul + # font name width height enc file + while read type arg1 arg2 arg3 arg4 arg5; do + case "${type}" in + \#*|"") + continue + ;; + + font) + cmd=${wsfld} + [ "${arg2}" != "-" ] && cmd="${cmd} -w ${arg2}" + [ "${arg3}" != "-" ] && cmd="${cmd} -h ${arg3}" + [ "${arg4}" != "-" ] && cmd="${cmd} -e ${arg4}" + cmd="${cmd} -N ${arg1} ${arg5}" + eval "${cmd}" + ;; + + screen) + cmd=${wscfg} + [ "${arg2}" != "-" ] && cmd="${cmd} -t ${arg2}" + [ "${arg3}" != "-" ] && cmd="${cmd} -e ${arg3}" + cmd="${cmd} ${arg1}" + eval "${cmd}" + ;; + + keyboard) + cmd=${wscfg} + case "${arg1}" in + -|auto) + cmd="${cmd} -k" + ;; + *) + cmd="${cmd} -k ${arg1}" + ;; + esac + ${cmd} + ;; + + encoding) + eval ${wsctl} -w "\"encoding=${arg1}\"" + ;; + + mapfile) + local entry= + while read entry; do + case "${entry}" in + \#*|"") + continue + ;; + *) + cmd="${wsctl} -w \"map+=${entry}\"" + eval "${cmd} >/dev/null" + ;; + esac + done < "${arg1}" + ;; + + mux) + eval "${wscfg} -m ${arg1}" + ;; + + setvar) + case "${arg1}" in + keyboard) + cmd="${wsctl} -kw ${arg2}" + ;; + display) + cmd="${wsctl} -dw ${arg2}" + ;; + mouse) + cmd="${wsctl} -mw ${arg2}" + ;; + *) + cmd="${wsctl} -w ${arg1}" + ;; + esac + eval "${cmd}" + ;; + + esac + done < "${config}" +} diff --git a/runlevels/Makefile.NetBSD b/runlevels/Makefile.NetBSD index 02a99036..ad61d8fb 100644 --- a/runlevels/Makefile.NetBSD +++ b/runlevels/Makefile.NetBSD @@ -1 +1 @@ -BOOT+= ttys +BOOT+= ttys wscons |