More NetBSD tweaks.

This commit is contained in:
Roy Marples 2008-01-10 23:48:53 +00:00
parent acbaacb2c1
commit de6e4d3f50
6 changed files with 36 additions and 9 deletions

View File

@ -34,18 +34,21 @@ depend() {
_set() { _set() {
local id=0 local id=0
[ -n "$1" ] && id=$1
ebegin "Setting Host UUID: ${id}"
sysctl kern.hostuuid="${id}" >/dev/null
eend $? || return 1
if [ -n "$1" ]; then if [ -n "$1" ]; then
id=$(echo "$1" | md5) id=$(echo "$1" | md5)
id="0x${id%????????????????????????}" id="0x${id%????????????????????????}"
fi fi
ebegin "Setting Host ID: ${id}" ebegin "Setting Host ID: ${id}"
sysctl kern.hostid="${id}" >/dev/null sysctl -w kern.hostid="${id}" >/dev/null
eend $? eend $? || return 1
if sysctl -n kern.hostuuid >/dev/null 2>&1; then
[ -n "$1" ] && id=$1
ebegin "Setting Host UUID: ${id}"
sysctl kern.hostuuid="${id}" >/dev/null
eend $? || return 1
fi
} }
# First we check to see if there is a system UUID # First we check to see if there is a system UUID

View File

@ -37,7 +37,7 @@ start() {
case "${var}" in case "${var}" in
""|"#"*) continue;; ""|"#"*) continue;;
esac esac
sysctl "${var}" >/dev/null || retval=1 sysctl -w "${var}" >/dev/null || retval=1
done < /etc/sysctl.conf done < /etc/sysctl.conf
eend ${retval} "Some errors were encountered" eend ${retval} "Some errors were encountered"
eend $? eend $?

5
init.d.NetBSD/Makefile Normal file
View File

@ -0,0 +1,5 @@
DIR= /etc/init.d
BIN= ${CONTENTS}
MK= ../mk
include ${MK}/scripts.mk

15
init.d.NetBSD/ttys Normal file
View File

@ -0,0 +1,15 @@
#!/sbin/runscript
start()
{
ebegin "Setting tty flags"
ttyflags -a
eend $? || return $?
if [ -c /dev/ttyp0 ]; then
chmod 666 /dev/tty[p-uw-zP-T][0-9a-zA-Z]
fi
if [ -c /dev/ttyv1 ]; then
chmod 666 /dev/ttyv[0-9a-zA-Z]
fi
}

View File

@ -1,4 +1,4 @@
BOOT= clock dumpon hostid syscons BOOT= clock dumpon syscons
MK= ../mk MK= ../mk
include ${MK}/runlevels.mk include ${MK}/runlevels.mk

View File

@ -0,0 +1,4 @@
BOOT= ttys
MK= ../mk
include ${MK}/runlevels.mk