summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <uberlord@gentoo.org>2007-05-30 22:39:31 +0000
committerRoy Marples <uberlord@gentoo.org>2007-05-30 22:39:31 +0000
commitf4faa8b43405b211a810f27fd4ff565dff35be04 (patch)
tree5a76a94f0aed6472f3d2eda1120a2310aaf24c4e /sys-apps/baselayout
parentVersion bump to 1.9.1 Bug #158261 (diff)
downloadgentoo-2-f4faa8b43405b211a810f27fd4ff565dff35be04.tar.gz
gentoo-2-f4faa8b43405b211a810f27fd4ff565dff35be04.tar.bz2
gentoo-2-f4faa8b43405b211a810f27fd4ff565dff35be04.zip
Push out some misc fixes, hopefully including one that finally solves our
shutdown issues with certain configs. (Portage version: 2.1.2.7)
Diffstat (limited to 'sys-apps/baselayout')
-rw-r--r--sys-apps/baselayout/ChangeLog10
-rw-r--r--sys-apps/baselayout/baselayout-2.0.0_alpha3-r1.ebuild280
-rw-r--r--sys-apps/baselayout/files/baselayout-2.0.0_alpha3-2721.patch666
-rw-r--r--sys-apps/baselayout/files/digest-baselayout-2.0.0_alpha3-r13
4 files changed, 958 insertions, 1 deletions
diff --git a/sys-apps/baselayout/ChangeLog b/sys-apps/baselayout/ChangeLog
index 14257a9289cd..b8656eb3a00d 100644
--- a/sys-apps/baselayout/ChangeLog
+++ b/sys-apps/baselayout/ChangeLog
@@ -1,10 +1,18 @@
# ChangeLog for sys-apps/baselayout
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/ChangeLog,v 1.419 2007/05/30 15:39:15 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/ChangeLog,v 1.420 2007/05/30 22:39:31 uberlord Exp $
# See the rc-scripts ChangeLog in subversion for release info:
# http://sources.gentoo.org/viewcvs.py/*checkout*/baselayout/trunk/ChangeLog
+*baselayout-2.0.0_alpha3-r1 (30 May 2007)
+
+ 30 May 2007; Roy Marples <uberlord@gentoo.org>
+ +files/baselayout-2.0.0_alpha3-2721.patch,
+ +baselayout-2.0.0_alpha3-r1.ebuild:
+ Push out some misc fixes, hopefully including one that finally solves our
+ shutdown issues with certain configs.
+
30 May 2007; Doug Goldstein <cardoe@gentoo.org>
baselayout-1.11.15-r3.ebuild, baselayout-1.12.9-r2.ebuild,
baselayout-1.12.10-r3.ebuild, baselayout-1.12.10-r4.ebuild,
diff --git a/sys-apps/baselayout/baselayout-2.0.0_alpha3-r1.ebuild b/sys-apps/baselayout/baselayout-2.0.0_alpha3-r1.ebuild
new file mode 100644
index 000000000000..10a6d42b1dc6
--- /dev/null
+++ b/sys-apps/baselayout/baselayout-2.0.0_alpha3-r1.ebuild
@@ -0,0 +1,280 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/baselayout-2.0.0_alpha3-r1.ebuild,v 1.1 2007/05/30 22:39:31 uberlord Exp $
+
+inherit flag-o-matic eutils toolchain-funcs multilib
+
+DESCRIPTION="Filesystem baselayout and init scripts"
+HOMEPAGE="http://www.gentoo.org/"
+SRC_URI="mirror://gentoo/${P}.tar.bz2
+ http://dev.gentoo.org/~uberlord/baselayout/${P}.tar.bz2
+ http://dev.gentoo.org/~azarah/baselayout/${P}.tar.bz2
+ http://dev.gentoo.org/~vapier/dist/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
+IUSE="bootstrap build pam static unicode kernel_linux kernel_FreeBSD"
+
+RDEPEND="virtual/init
+ !build? (
+ !bootstrap? (
+ kernel_linux? ( >=sys-apps/coreutils-5.2.1 )
+ kernel_FreeBSD? ( sys-process/fuser-bsd )
+ )
+ )
+ pam? ( virtual/pam )
+ !<net-misc/dhcpcd-2.0.0"
+DEPEND="virtual/os-headers"
+PDEPEND="virtual/init
+ !build? ( !bootstrap? (
+ kernel_linux? ( >=sys-apps/module-init-tools-3.2.2-r2 sys-apps/makedev )
+ ) )"
+
+PROVIDE="virtual/baselayout"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/${P}-2721.patch"
+
+ # Setup unicode defaults for silly unicode users
+ if use unicode ; then
+ sed -i -e '/^UNICODE=/s:no:yes:' etc/rc.conf
+ fi
+
+ # SPARC does not like stty, so we disable RC_INTERACTIVE which requires it
+ # see Gentoo bug #104067.
+ if use sparc ; then \
+ sed -i -e '/^RC_INTERACTIVE=/s:yes:no:' etc/conf.d/rc || die
+ fi
+}
+
+make_opts() {
+ local libdir="lib"
+ [[ ${SYMLINK_LIB} == "yes" ]] && libdir=$(get_abi_LIBDIR "${DEFAULT_ABI}")
+ local opts="${opts} LIB=${libdir}"
+
+ if use kernel_linux ; then
+ opts="${opts} OS=Linux"
+ else
+ opts="${opts} OS=BSD"
+ fi
+ use pam && opts="${opts} HAVE_PAM=1"
+
+ echo "${opts}"
+}
+
+src_compile() {
+ use static && append-ldflags -static
+ emake $(make_opts) ARCH=$(tc-arch) CC=$(tc-getCC) || die
+}
+
+# Support function for remapping old wireless dns vars
+remap_dns_vars() {
+ if [[ -f "${ROOT}/etc/conf.d/$1" ]]; then
+ sed -e 's/\<domain_/dns_domain_/g' \
+ -e 's/\<mac_domain_/mac_dns_domain_/g' \
+ -e 's/\<nameservers_/dns_servers_/g' \
+ -e 's/\<mac_nameservers_/mac_dns_servers_/g' \
+ -e 's/\<searchdomains_/dns_search_domains_/g' \
+ -e 's/\<mac_searchdomains_/mac_dns_search_domains_/g' \
+ "${ROOT}/etc/conf.d/$1" > "${D}/etc/conf.d/$1"
+ fi
+}
+
+pkg_preinst() {
+ # Move our makefiles to a temporay location
+ mv "${D}"/usr/share/baselayout/{Makefile,default.mk,runlevels}* "${T}"
+
+ # We need to install directories and maybe some dev nodes when building
+ # stages, but they cannot be in CONTENTS.
+ # Also, we cannot reference $S as binpkg will break so we do this.
+ if use build || use bootstrap ; then
+ local libdirs="$(get_all_libdirs)" dir=
+ # Create our multilib dirs - the Makefile has no knowledge of this
+ : ${libdirs:=lib} # it isn't that we don't trust multilib.eclass...
+ for dir in ${libdirs}; do
+ mkdir -p "${ROOT}${dir}"
+ touch "${ROOT}${dir}"/.keep
+ mkdir -p "${ROOT}usr/${dir}"
+ touch "${ROOT}usr/${dir}"/.keep
+ mkdir -p "${ROOT}usr/local/${dir}"
+ touch "${ROOT}usr/local/${dir}"/.keep
+ done
+
+ # Ugly compatibility with stupid ebuilds and old profiles symlinks
+ if [[ ${SYMLINK_LIB} == "yes" ]] ; then
+ rm -r "${ROOT}"/{lib,usr/lib,usr/local/lib} &> /dev/null
+ local lib=$(get_abi_LIBDIR ${DEFAULT_ABI})
+ ln -s "${lib}" "${ROOT}lib"
+ ln -s "${lib}" "${ROOT}usr/lib"
+ ln -s "${lib}" "${ROOT}usr/local/lib"
+ fi
+
+ make -C "${T}" $(make_opts) DESTDIR="${ROOT}" layout || die "failed to layout filesystem"
+ fi
+
+ # Change some vars introduced in baselayout-1.11.0 before we go stable
+ # The new names make more sense and allow nis_domain
+ # for use in baselayout-1.12.0
+ remap_dns_vars net
+ remap_dns_vars wireless
+}
+
+src_install() {
+ make $(make_opts) DESTDIR="${D}" install
+ dodoc ChangeLog COPYRIGHT
+
+ # Should this belong in another ebuild? Like say binutils?
+ # List all the multilib libdirs in /etc/env/04multilib (only if they're
+ # actually different from the normal
+ if has_multilib_profile || [[ $(get_libdir) != "lib" || -n ${CONF_MULTILIBDIR} ]]; then
+ local libdirs="$(get_all_libdirs)" libdirs_env= dir=
+ : ${libdirs:=lib} # it isn't that we don't trust multilib.eclass...
+ for dir in ${libdirs}; do
+ libdirs_env=${libdirs_env:+$libdirs_env:}/${dir}:/usr/${dir}:/usr/local/${dir}
+ done
+
+ # Special-case uglyness... For people updating from lib32 -> lib amd64
+ # profiles, keep lib32 in the search path while it's around
+ if has_multilib_profile && [[ -d ${ROOT}lib32 || -d ${ROOT}lib32 ]] && ! hasq lib32 ${libdirs}; then
+ libdirs_env="${libdirs_env}:/lib32:/usr/lib32:/usr/local/lib32"
+ fi
+ echo "LDPATH=\"${libdirs_env}\"" > "${T}"/04multilib
+ doenvd "${T}"/04multilib
+ fi
+
+ # rc-scripts version for testing of features that *should* be present
+ echo "Gentoo Base System release ${PV}" > "${D}"/etc/gentoo-release
+
+ # Remove the installed runlevels, as we don't know about $ROOT yet
+ rm -rf "${D}/etc/runlevels"
+
+ # Copy the make files to /usr/share/baselayout so we can re-use them in
+ # postinst, otherwise binpkg will break.
+ insinto /usr/share/baselayout
+ doins -r Makefile default.mk runlevels*
+}
+
+pkg_postinst() {
+ # Make our runlevels if they don't exist
+ if [[ ! -e ${ROOT}etc/runlevels ]] ; then
+ einfo "Making default runlevels"
+ make -C "${T}" $(make_opts) DESTDIR="${ROOT}" runlevels_install >/dev/null
+ fi
+
+ # We installed some files to /usr/share/baselayout instead of /etc to stop
+ # (1) overwriting the user's settings
+ # (2) screwing things up when attempting to merge files
+ # (3) accidentally packaging up personal files with quickpkg
+ # If they don't exist then we install them
+ for x in master.passwd passwd shadow group fstab ; do
+ [[ -e "${ROOT}etc/${x}" ]] && continue
+ [[ -e "${ROOT}usr/share/baselayout/${x}" ]] || continue
+ cp -p "${ROOT}usr/share/baselayout/${x}" ${ROOT}etc
+ done
+
+ # We need to copy svcdir if upgrading
+ if has_version "<sys-apps/${PN}-1.13.0_alpha" ; then
+ (
+ source "${ROOT}etc/conf.d/rc"
+ svcdir="${svcdir:-/var/lib/init.d}"
+ einfo "Moving state from ${ROOT}${svcdir} to ${ROOT}lib/rcscripts/init.d"
+ cp -RPp "${ROOT}${svcdir}"/* "${ROOT}"lib/rcscripts/init.d
+ rm -rf "${ROOT}"lib/rcscripts/init.d/daemons
+ umount "${ROOT}${svcdir}" 2>/dev/null
+ rm -rf "${ROOT}${svcdir}"
+ )
+ elif has_version "<sys-apps/${PN}-2.0.0_alpha" ; then
+ # The format has changed since 1.13
+ rm -rf "${ROOT}lib/rcscripts/init.d/daemons"
+ fi
+
+ if [[ ${ROOT} == / ]] && ! use build && ! use bootstrap; then
+ /$(get_libdir)/rcscripts/bin/rc-depend --update
+ fi
+
+ # This is also written in src_install (so it's in CONTENTS), but
+ # write it here so that the new version is immediately in the file
+ # (without waiting for the user to do etc-update)
+ rm -f "${ROOT}"/etc/._cfg????_gentoo-release
+ echo "Gentoo Base System release ${PV}" > "${ROOT}"/etc/gentoo-release
+
+ echo
+ einfo "Please be sure to update all pending '._cfg*' files in /etc,"
+ einfo "else things might break at your next reboot! You can use 'etc-update'"
+ einfo "to accomplish this:"
+ einfo
+ einfo " # etc-update"
+
+ local lo="net.lo0"
+ use kernel_linux && lo="net.lo"
+ for f in ${ROOT}etc/init.d/net.*; do
+ [[ -L ${f} || ${f} == "${ROOT}etc/init.d/${lo}" ]] && continue
+ echo
+ einfo "WARNING: You have older net.* files in ${ROOT}etc/init.d/"
+ einfo "They need to be converted to symlinks to ${lo}. If you haven't"
+ einfo "made personal changes to those files, you can update with the"
+ einfo "following command:"
+ einfo
+ einfo " /bin/ls ${ROOT}etc/init.d/net.* | grep -v '/${lo}$' | xargs -n1 ln -sfvn ${lo}"
+ break
+ done
+
+ if sed -e 's/#.*//' "${ROOT}"etc/conf.d/{net,wireless} 2>/dev/null \
+ | egrep -q '\<(domain|nameservers|searchdomains)_' ; then
+ echo
+ ewarn "You have deprecated variables in ${ROOT}etc/conf.d/net"
+ ewarn "or ${ROOT}etc/conf.d/wireless"
+ ewarn
+ ewarn "domain_* -> dns_domain_*"
+ ewarn "nameservers_* -> dns_servers_*"
+ ewarn "searchdomains_* -> dns_search_domains_*"
+ ewarn
+ ewarn "They have been converted for you - ensure that you"
+ ewarn "update them via 'etc-update'"
+ fi
+
+ if sed -e 's/#.*//' "${ROOT}"etc/conf.d/net 2>/dev/null \
+ | egrep -q '\<(ifconfig|aliases|broadcasts|netmasks|inet6|ipaddr|iproute)_'; then
+ echo
+ ewarn "You are using deprecated variables in ${ROOT}etc/conf.d/net"
+ ewarn "that no longer work"
+ ewarn
+ ewarn "You are advised to review the new configuration variables as"
+ ewarn "found in ${ROOT}etc/conf.d/net.example"
+ fi
+
+ # Remove old stuff that may cause problems.
+ if [[ -e "${ROOT}"/etc/env.d/01hostname ]] ; then
+ rm -f "${ROOT}"/etc/env.d/01hostname
+ fi
+ if [[ -e "${ROOT}"/etc/init.d/domainname ]] ; then
+ rm -f "${ROOT}"/etc/{conf.d,init.d}/domainname \
+ "${ROOT}"/etc/runlevels/*/domainname
+ echo
+ ewarn "The domainname init script has been removed in this version."
+ ewarn "Consult ${ROOT}etc/conf.d/net.example for details about how"
+ ewarn "to apply dns/nis information to the loopback interface."
+ fi
+}
+
+# Handle our downgraders
+# We should remove this when <1.13 has been removed from the tree
+pkg_postrm() {
+ # Remove dir if downgrading
+ if has_version "<sys-apps/${PN}-1.13.0_alpha" ; then
+ (
+ source "${ROOT}etc/conf.d/rc"
+ svcdir="${svcdir:-/var/lib/init.d}"
+ einfo "Moving state from ${ROOT}lib/rcscripts/init.d to ${ROOT}${svcdir}"
+ mkdir -p "${ROOT}${svcdir}"
+ cp -RPp "${ROOT}lib/rcscripts/init.d"/* "${ROOT}${svcdir}"
+ rm -rf "${ROOT}${svcdir}"/daemons
+ umount "${ROOT}lib/rcscripts/init.d" 2>/dev/null
+ rm -rf "${ROOT}lib/rcscripts/init.d"
+ )
+ fi
+}
diff --git a/sys-apps/baselayout/files/baselayout-2.0.0_alpha3-2721.patch b/sys-apps/baselayout/files/baselayout-2.0.0_alpha3-2721.patch
new file mode 100644
index 000000000000..350abcdb4fdc
--- /dev/null
+++ b/sys-apps/baselayout/files/baselayout-2.0.0_alpha3-2721.patch
@@ -0,0 +1,666 @@
+Index: init.d/halt.sh
+===================================================================
+--- init.d/halt.sh (revision 2702)
++++ init.d/halt.sh (working copy)
+@@ -14,6 +14,12 @@
+ stop_addon devfs
+ stop_addon udev
+
++# Really kill things off before unmounting
++if [ -x /sbin/killall5 ] ; then
++ killall5 -15
++ killall5 -9
++fi
++
+ # Flush all pending disk writes now
+ sync ; sync
+
+Index: init.d/bootmisc
+===================================================================
+--- init.d/bootmisc (revision 2702)
++++ init.d/bootmisc (working copy)
+@@ -21,7 +21,7 @@
+ if [ -e /etc/sysctl.conf -a ! -x /etc/init.d/sysctl ] ; then
+ if [ "${RC_SYS}" != "VPS" ] ; then
+ ebegin "Configuring kernel parameters"
+- sysctl -q -p /etc/sysctl.conf
++ sysctl -p /etc/sysctl.conf >/dev/null
+ eend $?
+ fi
+ fi
+Index: init.d/checkroot
+===================================================================
+--- init.d/checkroot (revision 2702)
++++ init.d/checkroot (working copy)
+@@ -31,7 +31,7 @@
+ rm -f /etc/mtab~ /etc/mtab~~
+ }
+
+-start() {
++do_fsck() {
+ local retval=0 opts="-F"
+ [ "${RC_UNAME}" = "Linux" ] && opts="-T -C0"
+
+@@ -110,8 +110,12 @@
+ else
+ mount -u -o rw /
+ fi
+- eend $? "Root filesystem could not be mounted read/write :(" || return 1
++ eend $? "Root filesystem could not be mounted read/write :("
++}
+
++start() {
++ do_fsck || return 1
++
+ # Only Linux has mtab
+ [ "${RC_UNAME}" = "Linux" ] && do_mtab
+
+Index: sh/rc-mount.sh
+===================================================================
+--- sh/rc-mount.sh (revision 2702)
++++ sh/rc-mount.sh (working copy)
+@@ -8,7 +8,7 @@
+ local cmd="$1" retval=0 retry=
+ local f_opts="-m -c" f_kill="-s " mnt=
+ if [ "${RC_UNAME}" = "Linux" ] ; then
+- f_opts="-c"
++ f_opts="-m"
+ f_kill="-"
+ fi
+
+@@ -34,7 +34,7 @@
+ esac
+
+ retry=3
+- while ! ${cmd} "${mnt}" 2>/dev/null ; do
++ while ! LC_ALL=C ${cmd} "${mnt}" 2>/dev/null ; do
+ # Don't kill if it's us (/ and possibly /usr)
+ local pids="$(fuser ${f_opts} "${mnt}" 2>/dev/null)"
+ case " ${pids} " in
+@@ -52,14 +52,14 @@
+
+ # OK, try forcing things
+ if [ ${retry} -le 0 ] ; then
+- local extra_opts="-f"
+ case "${cmd}" in
+- mount*)
+- # Silly reiserfs helper blocks us, so bypass it
+- [ "${RC_UNAME}" = "Linux" ] && extra_opts="-i"
++ umount*)
++ LC_ALL=C ${cmd} -f "${mnt}" || retry=-999
+ ;;
++ *)
++ retry=-999
++ ;;
+ esac
+- ${cmd} ${extra_opts} "${mnt}" || retry=-999
+ break
+ fi
+ done
+Index: sh/net.sh
+===================================================================
+--- sh/net.sh (revision 2702)
++++ sh/net.sh (working copy)
+@@ -118,8 +118,8 @@
+
+ # Basically sorts our modules into order and saves the list
+ _gen_module_list() {
+- local x= f=
+- if [ -s "${MODULESLIST}" -a "${MODULESLIST}" -nt "${MODULESDIR}" ] ; then
++ local x= f= force=$1
++ if ! ${force} && [ -s "${MODULESLIST}" -a "${MODULESLIST}" -nt "${MODULESDIR}" ] ; then
+ local update=false
+ for x in "${MODULESDIR}"/* ; do
+ [ -e "${x}" ] || continue
+@@ -230,18 +230,21 @@
+ }
+
+ _load_modules() {
++ local starting=$1 mymods=
++
+ # Ensure our list is up to date
+- _gen_module_list
++ _gen_module_list false
++ if ! . "${MODULESLIST}" ; then
++ _gen_module_list true
++ . "${MODULESLIST}"
++ fi
+
+- local starting=$1 mymods=
+-
+ MODULES=
+ if [ "${IFACE}" != "lo" -a "${IFACE}" != "lo0" ] ; then
+ eval mymods=\$modules_${IFVAR}
+ [ -z "${mymods}" ] && mymods=${modules}
+ fi
+
+- . "${MODULESLIST}"
+ local i=-1 x= mod= f= provides=
+ while true ; do
+ i=$((${i} + 1))
+Index: init.d.Linux/clock
+===================================================================
+--- init.d.Linux/clock (revision 2702)
++++ init.d.Linux/clock (working copy)
+@@ -79,24 +79,25 @@
+
+ ebegin "Setting system clock using the hardware clock" "[${TBLURB}]"
+ if [ ${fakeit} -eq 1 ] ; then
+- ret=0
++ retval=0
+ elif [ -x /sbin/hwclock ] ; then
+- # Since hwclock always exit's with a 0, need to check its output.
+- errstr="$(/sbin/hwclock ${myadj} ${myopts} 2>&1 >/dev/null)"
+- errstr="${errstr}$(/sbin/hwclock --hctosys ${myopts} 2>&1 >/dev/null)"
++ # Don't call hwclock unless we need to
++ if [ "${TBLURB}" != "UTC" -o "${myadj}" != "--noadjfile" ] ; then
++ # Since hwclock always exit's with a 0, need to check its output.
++ errstr="$(/sbin/hwclock ${myadj} ${myopts} 2>&1 >/dev/null)"
++ errstr="${errstr}$(/sbin/hwclock --hctosys ${myopts} 2>&1 >/dev/null)"
+
+- if [ -n "${errstr}" ] ; then
+- ewarn "${errstr}"
+- ret=1
+- else
+- ret=0
++ if [ -n "${errstr}" ] ; then
++ ewarn "${errstr}"
++ retval=1
++ fi
++ errstr="Failed to set clock"
+ fi
+- errstr="Failed to set clock"
+ else
+- ret=1
++ retval=1
+ errstr="/sbin/hwclock not found"
+ fi
+- eend ${ret} "${errstr}" "You will need to set the clock yourself"
++ eend ${retval} "${errstr}" "You will need to set the clock yourself"
+
+ return 0
+ }
+@@ -111,16 +112,16 @@
+
+ ebegin "Setting hardware clock using the system clock" "[${TBLURB}]"
+ if [ ${fakeit} -eq 1 ] ; then
+- ret=0
++ retval=0
+ elif [ -x /sbin/hwclock ] ; then
+ [ -z "$(/sbin/hwclock --systohc ${myopts} 2>&1 >/dev/null)" ]
+- ret=$?
++ retval=$?
+ errstr="Failed to sync clocks"
+ else
+- ret=1
++ retval=1
+ errstr="/sbin/hwclock not found"
+ fi
+- eend ${ret} "${errstr}"
++ eend ${retval} "${errstr}"
+ }
+
+ save() {
+Index: src/rc-plugin.c
+===================================================================
+--- src/rc-plugin.c (revision 2702)
++++ src/rc-plugin.c (working copy)
+@@ -23,12 +23,25 @@
+ {
+ char *name;
+ void *handle;
+- int (*hook) (rc_hook_t hook, const char *name);
++ int (*hook) (rc_hook_t, const char *);
+ struct plugin *next;
+ } plugin_t;
+
+ static plugin_t *plugins = NULL;
+
++#ifndef __FreeBSD__
++dlfunc_t dlfunc (void * __restrict handle, const char * __restrict symbol)
++{
++ union {
++ void *d;
++ dlfunc_t f;
++ } rv;
++
++ rv.d = dlsym (handle, symbol);
++ return (rv.f);
++}
++#endif
++
+ void rc_plugin_load (void)
+ {
+ char **files;
+@@ -47,7 +60,7 @@
+ char *p = rc_strcatpaths (RC_PLUGINDIR, file, NULL);
+ void *h = dlopen (p, RTLD_LAZY);
+ char *func;
+- void *f;
++ int (*fptr) (rc_hook_t, const char *);
+ int len;
+
+ if (! h) {
+@@ -62,8 +75,8 @@
+ func = rc_xmalloc (sizeof (char *) * len);
+ snprintf (func, len, "_%s_hook", file);
+
+- f = dlsym (h, func);
+- if (! f) {
++ fptr = (int (*)(rc_hook_t, const char*)) dlfunc (h, func);
++ if (! fptr) {
+ eerror ("`%s' does not expose the symbol `%s'", p, func);
+ dlclose (h);
+ } else {
+@@ -76,7 +89,7 @@
+ memset (plugin, 0, sizeof (plugin_t));
+ plugin->name = rc_xstrdup (file);
+ plugin->handle = h;
+- plugin->hook = f;
++ plugin->hook = fptr;
+ }
+
+ free (func);
+Index: src/rc.c
+===================================================================
+--- src/rc.c (revision 2702)
++++ src/rc.c (working copy)
+@@ -143,8 +143,6 @@
+ argv++;
+ }
+ }
+- else
+- retval = EXIT_FAILURE;
+ }
+
+ if (argc > 0) {
+@@ -579,6 +577,29 @@
+ errno = serrno;
+ }
+
++static void run_script (const char *script) {
++ int status = 0;
++ pid_t pid = vfork ();
++
++ if (pid < 0)
++ eerrorx ("%s: vfork: %s", applet, strerror (errno));
++ else if (pid == 0) {
++ execl (script, script, (char *) NULL);
++ eerror ("%s: unable to exec `%s': %s",
++ script, applet, strerror (errno));
++ _exit (EXIT_FAILURE);
++ }
++
++ do {
++ pid_t wpid = waitpid (pid, &status, 0);
++ if (wpid < 1)
++ eerror ("waitpid: %s", strerror (errno));
++ } while (! WIFEXITED (status) && ! WIFSIGNALED (status));
++
++ if (! WIFEXITED (status) || ! WEXITSTATUS (status) == 0)
++ exit (EXIT_FAILURE);
++}
++
+ int main (int argc, char **argv)
+ {
+ char *RUNLEVEL = NULL;
+@@ -709,9 +730,6 @@
+ /* OK, we're either in runlevel 1 or single user mode */
+ if (strcmp (newlevel, RC_LEVEL_SYSINIT) == 0) {
+ struct utsname uts;
+- pid_t pid;
+- pid_t wpid;
+- int status = 0;
+ #ifdef __linux__
+ FILE *fp;
+ #endif
+@@ -719,24 +737,9 @@
+ /* exec init-early.sh if it exists
+ * This should just setup the console to use the correct
+ * font. Maybe it should setup the keyboard too? */
+- if (rc_exists (INITEARLYSH)) {
+- if ((pid = vfork ()) == -1)
+- eerrorx ("%s: vfork: %s", applet, strerror (errno));
++ if (rc_exists (INITEARLYSH))
++ run_script (INITEARLYSH);
+
+- if (pid == 0) {
+- execl (INITEARLYSH, INITEARLYSH, (char *) NULL);
+- eerror ("%s: unable to exec `" INITEARLYSH "': %s",
+- applet, strerror (errno));
+- _exit (EXIT_FAILURE);
+- }
+-
+- do {
+- wpid = waitpid (pid, &status, 0);
+- if (wpid < 1)
+- eerror ("waitpid: %s", strerror (errno));
+- } while (! WIFEXITED (status) && ! WIFSIGNALED (status));
+- }
+-
+ uname (&uts);
+
+ printf ("\n");
+@@ -752,26 +755,8 @@
+
+ setenv ("RC_SOFTLEVEL", newlevel, 1);
+ rc_plugin_run (rc_hook_runlevel_start_in, newlevel);
++ run_script (INITSH);
+
+- if ((pid = vfork ()) == -1)
+- eerrorx ("%s: vfork: %s", applet, strerror (errno));
+-
+- if (pid == 0) {
+- execl (INITSH, INITSH, (char *) NULL);
+- eerror ("%s: unable to exec `" INITSH "': %s",
+- applet, strerror (errno));
+- _exit (EXIT_FAILURE);
+- }
+-
+- do {
+- wpid = waitpid (pid, &status, 0);
+- if (wpid < 1)
+- eerror ("waitpid: %s", strerror (errno));
+- } while (! WIFEXITED (status) && ! WIFSIGNALED (status));
+-
+- if (! WIFEXITED (status) || ! WEXITSTATUS (status) == 0)
+- exit (EXIT_FAILURE);
+-
+ /* If we requested a softlevel, save it now */
+ #ifdef __linux__
+ set_ksoftlevel (NULL);
+Index: src/rc-plugin.h
+===================================================================
+--- src/rc-plugin.h (revision 2702)
++++ src/rc-plugin.h (working copy)
+@@ -12,4 +12,15 @@
+ void rc_plugin_unload ();
+ void rc_plugin_run (rc_hook_t, const char *value);
+
++/* dlfunc defines needed to avoid ISO errors. FreeBSD has this right :) */
++#ifndef __FreeBSD__
++struct __dlfunc_arg {
++ int __dlfunc_dummy;
++};
++
++typedef void (*dlfunc_t) (struct __dlfunc_arg);
++
++dlfunc_t dlfunc (void * __restrict handle, const char * __restrict symbol);
+ #endif
++
++#endif
+Index: src/start-stop-daemon.c
+===================================================================
+--- src/start-stop-daemon.c (revision 2702)
++++ src/start-stop-daemon.c (working copy)
+@@ -30,6 +30,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <time.h>
+ #include <unistd.h>
+
+ #ifdef HAVE_PAM
+@@ -90,6 +91,20 @@
+ rc_strlist_free (newenv);
+ }
+
++static int get_time(struct timeval *tp)
++{
++ struct timespec ts;
++
++ if (clock_gettime (CLOCK_MONOTONIC, &ts) == -1) {
++ eerror ("clock_gettime: %s", strerror (errno));
++ return (-1);
++ }
++
++ tp->tv_sec = ts.tv_sec;
++ tp->tv_usec = ts.tv_nsec / 1000;
++ return (0);
++}
++
+ static int parse_signal (const char *sig)
+ {
+ typedef struct signalpair
+@@ -374,10 +389,8 @@
+ break;
+ }
+
+- if (gettimeofday (&stopat, NULL) != 0) {
+- eerror ("%s: gettimeofday: %s", progname, strerror (errno));
++ if (get_time (&stopat) != 0)
+ return (0);
+- }
+
+ stopat.tv_sec += item->value;
+ while (1) {
+@@ -396,10 +409,8 @@
+ }
+ }
+
+- if (gettimeofday (&now, NULL) != 0) {
+- eerror ("%s: gettimeofday: %s", progname, strerror (errno));
++ if (get_time (&now) != 0)
+ return (0);
+- }
+ if (timercmp (&now, &stopat, >))
+ break;
+ }
+@@ -952,7 +963,7 @@
+
+ if (! WIFEXITED (status) || WEXITSTATUS (status) != 0) {
+ if (! quiet)
+- eerrorx ("%s: failed to started `%s'", progname, exec);
++ eerrorx ("%s: failed to start `%s'", progname, exec);
+ exit (EXIT_FAILURE);
+ }
+
+@@ -966,8 +977,8 @@
+ struct timeval now;
+ bool retestpid = false;
+
+- if (gettimeofday (&stopat, NULL) != 0)
+- eerrorx ("%s: gettimeofday: %s", progname, strerror (errno));
++ if (get_time (&stopat) != 0)
++ exit (EXIT_FAILURE);
+
+ stopat.tv_usec += START_WAIT;
+ while (1) {
+@@ -981,9 +992,6 @@
+ eerrorx ("%s: select: %s", progname, strerror (errno));
+ }
+
+- if (gettimeofday (&now, NULL) != 0)
+- eerrorx ("%s: gettimeofday: %s", progname, strerror (errno));
+-
+ /* This is knarly.
+ If we backgrounded then we know the exact pid.
+ Otherwise if we have a pidfile then it *may* know the exact pid.
+@@ -1015,7 +1023,9 @@
+ if (! alive)
+ eerrorx ("%s: %s died", progname, exec);
+
+- if (timercmp (&now, &stopat, >))
++ if (get_time (&now) != 0)
++ exit (EXIT_FAILURE);
++ if (timercmp (&now, &stopat, >))
+ break;
+ }
+
+Index: src/librc-misc.c
+===================================================================
+--- src/librc-misc.c (revision 2702)
++++ src/librc-misc.c (working copy)
+@@ -572,7 +572,7 @@
+ char *line;
+ int i;
+ char *p;
+- char **config = rc_get_config (NULL, RC_CONFIG);
++ char **config;
+ char *e;
+ char sys[6];
+ struct utsname uts;
+@@ -580,6 +580,13 @@
+ FILE *fp;
+ char buffer[PATH_MAX];
+
++ /* Don't trust environ for softlevel yet */
++ snprintf (buffer, PATH_MAX, "%s.%s", RC_CONFIG, rc_get_runlevel());
++ if (rc_exists (buffer))
++ config = rc_get_config (NULL, buffer);
++ else
++ config = rc_get_config (NULL, RC_CONFIG);
++
+ STRLIST_FOREACH (config, line, i) {
+ p = strchr (line, '=');
+ if (! p)
+@@ -670,13 +677,15 @@
+ if (file_regex ("/proc/xen/capabilities", "control_d"))
+ snprintf (sys, sizeof (sys), "XENU");
+ }
+- if (! sys)
++ if (! sys[0])
+ snprintf (sys, sizeof (sys), "XEN0");
+- } else if (file_regex ("/proc/cpuinfo", "UML"))
++ } else if (file_regex ("/proc/cpuinfo", "UML")) {
+ snprintf (sys, sizeof (sys), "UML");
+- else if (file_regex ("/proc/self/status",
+- "(s_context|VxID|envID):[[:space:]]*[1-9]"))
+- snprintf (sys, sizeof (sys), "VPS");
++ } else if (file_regex ("/proc/self/status",
++ "(s_context|VxID|envID):[[:space:]]*[1-9]"))
++ {
++ snprintf (sys, sizeof (sys), "VPS");
++ }
+ #endif
+
+ /* Only add a NET_FS list if not defined */
+Index: src/runscript.c
+===================================================================
+--- src/runscript.c (revision 2702)
++++ src/runscript.c (working copy)
+@@ -80,8 +80,8 @@
+ * which sucks ass
+ * http://www.opengroup.org/onlinepubs/009695399/functions/dlsym.html
+ */
+- selinux_run_init_old = dlsym (lib_handle, "selinux_runscript");
+- selinux_run_init_new = dlsym (lib_handle, "selinux_runscript2");
++ selinux_run_init_old = (void (*)(void)) dlfunc (lib_handle, "selinux_runscript");
++ selinux_run_init_new = (void (*)(int, char **)) dlfunc (lib_handle, "selinux_runscript2");
+
+ /* Use new run_init if it rc_exists, else fall back to old */
+ if (selinux_run_init_new)
+@@ -975,6 +975,9 @@
+ int opt;
+
+ service = argv[1];
++ applet = rc_xstrdup (basename (service));
++ atexit (cleanup);
++
+ /* Show help if insufficient args */
+ if (argc < 3) {
+ execl (RCSCRIPT_HELP, RCSCRIPT_HELP, service, (char *) NULL);
+@@ -982,9 +985,6 @@
+ applet, strerror (errno));
+ }
+
+- applet = rc_xstrdup (basename (service));
+- atexit (cleanup);
+-
+ #ifdef __linux__
+ /* coldplug events can trigger init scripts, but we don't want to run them
+ until after rc sysinit has completed so we punt them to the boot runlevel */
+Index: src/Makefile
+===================================================================
+--- src/Makefile (revision 2702)
++++ src/Makefile (working copy)
+@@ -65,6 +65,7 @@
+ ifeq ($(OS),Linux)
+ LDLIBS_RC = -ldl
+ LDLIBS_RS = -ldl
++LDLIBS_SSD = -lrt
+ # Shouldn't need this, but it's the easiest workaround for silly
+ # Linux headers that don't work with -std=c99
+ override CPPFLAGS += -D_GNU_SOURCE
+@@ -76,7 +77,7 @@
+ HAVE_PAM =
+ ifdef HAVE_PAM
+ CPPFLAGS_SSD = -DHAVE_PAM
+-LDLIBS_SSD = -lpam
++LDLIBS_SSD += -lpam
+ endif
+
+ # We also define _BSD_SOURCE so both Linux and the BSDs get a few
+Index: net.BSD/iwconfig.sh
+===================================================================
+--- net.BSD/iwconfig.sh (revision 2702)
++++ net.BSD/iwconfig.sh (working copy)
+@@ -71,7 +71,7 @@
+
+ iwconfig_set_mode() {
+ local x= opt= unopt="hostap adhoc"
+- case "${mode}" in
++ case "$1" in
+ master|hostap) unopt="adhoc" opt="hostap" ;;
+ ad-hoc|adhoc) unopt="hostap" opt="adhoc" ;;
+ esac
+@@ -474,7 +474,7 @@
+ ad-hoc|adhoc|hostap|master) iwconfig_setup_specific "${x}" ;;
+ esac
+
+- if [ "${x}" != "managed" -a "${x}" != "auto" ] ; then
++ if [ "${x}" != "managed" -a "${x}" != "auto" -a "${x}" != "ad-hoc" -a "${x}" != "adhoc" -a ${x} != "master" ] ; then
+ eerror "Only managed, ad-hoc, master and auto modes are supported"
+ return 1
+ fi
+Index: sh.Linux/init.sh
+===================================================================
+--- sh.Linux/init.sh (revision 2702)
++++ sh.Linux/init.sh (working copy)
+@@ -100,7 +100,24 @@
+ check_statedir /proc
+
+ # By default VServer already has /proc mounted, but OpenVZ does not!
+-if [ ! -e /proc/self/stat ] ; then
++# However, some of our users have an old proc image in /proc
++# NFC how they managed that, but the end result means we have to test if
++# /proc actually works or not. We to this by comparing uptime to one a second
++# ago
++mountproc=true
++if [ -e /proc/uptime ] ; then
++ up="$(cat /proc/uptime)"
++ sleep 1
++ if [ "${up}" = "$(cat /proc/uptime)" ] ; then
++ eerror "You have cruft in /proc that should be deleted"
++ else
++ einfo "/proc is already mounted, skipping"
++ mountproc=false
++ fi
++ unset up
++fi
++
++if ${mountproc} ; then
+ procfs="proc"
+ [ "${RC_UNAME}" = "GNU/kFreeBSD" ] && proc="linprocfs"
+ ebegin "Mounting ${procfs} at /proc"
+@@ -108,6 +125,7 @@
+ try mount -n ${mntcmd:--t ${procfs} -o noexec,nosuid,nodev proc /proc}
+ eend $?
+ fi
++unset mountproc
+
+ # Read off the kernel commandline to see if there's any special settings
+ # especially check to see if we need to set the CDBOOT environment variable
+Index: etc.Linux/sysctl.conf
+===================================================================
+--- etc.Linux/sysctl.conf (revision 2702)
++++ etc.Linux/sysctl.conf (working copy)
+@@ -22,7 +22,7 @@
+
+ # Enable SYN cookies (yum!)
+ # http://cr.yp.to/syncookies.html
+-net.ipv4.tcp_syncookies = 1
++#net.ipv4.tcp_syncookies = 1
+
+ # Disable source route
+ #net.ipv4.conf.all.accept_source_route = 0
diff --git a/sys-apps/baselayout/files/digest-baselayout-2.0.0_alpha3-r1 b/sys-apps/baselayout/files/digest-baselayout-2.0.0_alpha3-r1
new file mode 100644
index 000000000000..0dcfcff835fd
--- /dev/null
+++ b/sys-apps/baselayout/files/digest-baselayout-2.0.0_alpha3-r1
@@ -0,0 +1,3 @@
+MD5 861f5ac622994d28d362466cf0af9b12 baselayout-2.0.0_alpha3.tar.bz2 133097
+RMD160 baff1fc62090059a62634a03f03d775bd7ad4115 baselayout-2.0.0_alpha3.tar.bz2 133097
+SHA256 bf59e5c5241ca00e9af5147043d5d4666614cae4cec894c73f4912109dd276ea baselayout-2.0.0_alpha3.tar.bz2 133097