Loads of NetBSD tweaks here.

This commit is contained in:
Roy Marples 2008-01-10 23:22:46 +00:00
parent 5aea880f81
commit 2d95c9a756
10 changed files with 19 additions and 18 deletions

View File

@ -23,9 +23,6 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE. # SUCH DAMAGE.
# Ensure we are called by init
[ "$PPID" = "1" ] || exit 0
# If $TERM is not set then assume default of cons25 # If $TERM is not set then assume default of cons25
# This gives us a nice colour boot :) # This gives us a nice colour boot :)
[ -z "$TERM" -o "$TERM" = "dumb" ] && export TERM="cons25" [ -z "$TERM" -o "$TERM" = "dumb" ] && export TERM="cons25"

View File

@ -23,9 +23,6 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE. # SUCH DAMAGE.
# Ensure we are called by init
[ "$PPID" = "1" ] || exit 0
# Handle interrupts # Handle interrupts
trap : SIGINT SIGQUIT trap : SIGINT SIGQUIT
@ -41,8 +38,8 @@ export LD_LIBRARY_PATH="/lib${LD_LIBRARY_PATH:+:}${LDLIBRARY_PATH}"
# This block should 'translate' from the way init calls it to the way it would # This block should 'translate' from the way init calls it to the way it would
# be called by sysvinit on linux. # be called by sysvinit on linux.
case "$1" in case "$1" in
reboot) export RUNLEVEL=6;; reboot) export RUNLEVEL=6;;
shutdown) export RUNLEVEL=0;; shutdown) export RUNLEVEL=0;;
single) export RUNLEVEL=S;; single) export RUNLEVEL=S;;
esac esac
exec /sbin/rc "$1" exec /sbin/rc "$1"

0
init.d.BSD/clock → init.d.FreeBSD/clock Executable file → Normal file
View File

View File

@ -56,7 +56,8 @@ cleanup_tmp_dir() {
! -path "./aquota.group/*" \ ! -path "./aquota.group/*" \
! -path ./journal \ ! -path ./journal \
! -path "./journal/*" \ ! -path "./journal/*" \
-delete -exec rm -rf -- {} \; \
-type d -prune
eend 0 eend 0
else else
ebegin "Cleaning ${dir} directory" ebegin "Cleaning ${dir} directory"
@ -126,6 +127,8 @@ start() {
dmesg > /var/log/dmesg dmesg > /var/log/dmesg
chmod 640 /var/log/dmesg chmod 640 /var/log/dmesg
fi fi
rm -f /etc/nologin
} }
stop() { stop() {

View File

@ -128,7 +128,7 @@ _add_address() {
# ifconfig doesn't like CIDR addresses # ifconfig doesn't like CIDR addresses
case "${RC_UNAME}" in case "${RC_UNAME}" in
NetBSD|OpenBSD) OpenBSD)
local ip="${1%%/*}" cidr="${1##*/}" netmask= local ip="${1%%/*}" cidr="${1##*/}" netmask=
if [ -n "${cidr}" -a "${cidr}" != "${ip}" ]; then if [ -n "${cidr}" -a "${cidr}" != "${ip}" ]; then
netmask="$(_cidr2netmask "${cidr}")" netmask="$(_cidr2netmask "${cidr}")"

View File

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

View File

@ -1,4 +1,4 @@
BOOT= consolefont keymaps modules net.lo procfs BOOT= clock consolefont keymaps modules net.lo procfs
DEFAULT= hdparm DEFAULT= hdparm
MK= ../mk MK= ../mk

View File

@ -1,4 +1,4 @@
BOOT= bootmisc checkroot checkfs clock hostname localmount \ BOOT= bootmisc checkroot checkfs hostname localmount \
swap sysctl urandom swap sysctl urandom
DEFAULT= local netmount DEFAULT= local netmount

View File

@ -177,6 +177,7 @@ static const char *const color_terms[] = {
"screen-w", "screen-w",
"screen.linux", "screen.linux",
"vt100", "vt100",
"vt220",
"xterm", "xterm",
"xterm-256color", "xterm-256color",
"xterm-color", "xterm-color",

View File

@ -151,11 +151,14 @@ char **rc_config_list (const char *file)
/* Get entry - we do not want comments */ /* Get entry - we do not want comments */
token = strsep (&p, "#"); token = strsep (&p, "#");
if (token && (strlen (token) > 1)) { if (token && (strlen (token) > 1)) {
/* Stip the newline if present */ /* If not variable assignment then skip */
if (token[strlen (token) - 1] == '\n') if (strchr (token, '=')) {
token[strlen (token) - 1] = 0; /* Stip the newline if present */
if (token[strlen (token) - 1] == '\n')
token[strlen (token) - 1] = 0;
rc_strlist_add (&list, token); rc_strlist_add (&list, token);
}
} }
free (buffer); free (buffer);
} }