From d8e1d9a6edf94ecac580e80e1113f4fdbdc5a23b Mon Sep 17 00:00:00 2001 From: Gabriele Giacone <1o5g4r8o@gmail.com> Date: Tue, 21 Oct 2014 02:24:12 -0500 Subject: [PATCH] Add missing files for GNU/kFreeBSD --- conf.d/network.GNU-kFreeBSD.in | 4 ++++ conf.d/staticroute.GNU-kFreeBSD.in | 5 +++++ init.d/sysctl.GNU-kFreeBSD.in | 31 ++++++++++++++++++++++++++ mk/os-GNU-kFreeBSD.mk | 4 +++- sh/init.sh.GNU-kFreeBSD.in | 35 ++++++++++++++++++++++++++++++ 5 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 conf.d/network.GNU-kFreeBSD.in create mode 100644 conf.d/staticroute.GNU-kFreeBSD.in create mode 100644 init.d/sysctl.GNU-kFreeBSD.in create mode 100644 sh/init.sh.GNU-kFreeBSD.in diff --git a/conf.d/network.GNU-kFreeBSD.in b/conf.d/network.GNU-kFreeBSD.in new file mode 100644 index 00000000..9f49b81a --- /dev/null +++ b/conf.d/network.GNU-kFreeBSD.in @@ -0,0 +1,4 @@ + +# You can assign a default route +#defaultroute="192.168.0.1" +#defaultroute6="2001:a:b:c" diff --git a/conf.d/staticroute.GNU-kFreeBSD.in b/conf.d/staticroute.GNU-kFreeBSD.in new file mode 100644 index 00000000..9f541524 --- /dev/null +++ b/conf.d/staticroute.GNU-kFreeBSD.in @@ -0,0 +1,5 @@ +# Separate multiple routes using ; or new lines. + +# Example static routes. See route(8) for syntax. +#staticroute="net 192.168.0.0 10.73.1.1 netmask 255.255.255.0 +#net 192.168.1.0 10.73.1.1 netmask 255.255.255.0" diff --git a/init.d/sysctl.GNU-kFreeBSD.in b/init.d/sysctl.GNU-kFreeBSD.in new file mode 100644 index 00000000..92d58680 --- /dev/null +++ b/init.d/sysctl.GNU-kFreeBSD.in @@ -0,0 +1,31 @@ +#!@SBINDIR@/openrc-run +# Copyright (c) 2007-2009 Roy Marples +# Released under the 2-clause BSD license. + +depend() +{ + before bootmisc logger + keyword -prefix +} + +start() +{ + [ -e /etc/sysctl.conf ] || return 0 + local retval=0 var= comments= conf= + ebegin "Configuring kernel parameters" + eindent + for conf in @SYSCONFDIR@/sysctl.conf @SYSCONFDIR@/sysctl.d/*.conf; do + if [ -r "$conf" ]; then + vebegin "applying $conf" + while read var comments; do + case "$var" in + ""|"#"*) continue;; + esac + sysctl -w "$var" >/dev/null || retval=1 + done < "$conf" + veend $retval + fi + done + eoutdent + eend $retval "Some errors were encountered" +} diff --git a/mk/os-GNU-kFreeBSD.mk b/mk/os-GNU-kFreeBSD.mk index 72fea3e1..c2173726 100644 --- a/mk/os-GNU-kFreeBSD.mk +++ b/mk/os-GNU-kFreeBSD.mk @@ -3,7 +3,9 @@ # Generic definitions +SFX= .GNU-kFreeBSD.in +PKG_PREFIX?= /usr + CPPFLAGS+= -D_BSD_SOURCE -D_XOPEN_SOURCE=700 LIBDL= -Wl,-Bdynamic -ldl LIBKVM?= -include ${MK}/os-BSD.mk diff --git a/sh/init.sh.GNU-kFreeBSD.in b/sh/init.sh.GNU-kFreeBSD.in new file mode 100644 index 00000000..d1a04e15 --- /dev/null +++ b/sh/init.sh.GNU-kFreeBSD.in @@ -0,0 +1,35 @@ +#!@SHELL@ +# Copyright (c) 2007-2009 Roy Marples +# Released under the 2-clause BSD license. + +if [ ! -d /run ]; then + ebegin "Creating /run" + mkdir -p /run + eend $? +fi + +if [ -L $RC_SVCDIR ]; then + rm $RC_SVCDIR +fi + +ebegin "Mounting /run" +if ! fstabinfo --mount /run; then + mount -t tmpfs -o mode=0755,noexec,nosuid,size=10% tmpfs /run + if [ $? != 0 ]; then + eerror "Unable to mount tmpfs on /run." + eerror "Can't continue." + exit 1 + fi +fi +eend + +ebegin "Creating $RC_SVCDIR" +mkdir -p $RC_SVCDIR +eend $? + +if [ -e "$RC_LIBEXECDIR"/cache/deptree ]; then + cp -p "$RC_LIBEXECDIR"/cache/* "$RC_SVCDIR" 2>/dev/null +fi + +echo sysinit >"$RC_SVCDIR"/softlevel +exit 0