--- /dev/null
+#! /bin/bash
+
+# Copyright (C) 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+## Called as: initpost <cfgdir> <path of util-vserver-vars>
+
+. "$2"
+
+$_MKDIR -p "$1"/vdir/usr/portage
+
+$_CAT <<EOF >> "$1"/fstab
+# shared portage tree
+/usr/portage /usr/portage none bind,ro 0 0
+/usr/portage/distfiles /usr/portage/distfiles none bind,rw 0 0
+EOF
esac
}
+function populateDev
+{
+ local spec
+
+ mkdir -p -m755 "$VDIR"/dev/pts
+
+ while read spec; do
+ makeDevEntry "$VDIR"/dev $spec
+ done <$_DEV_FILE
+}
+
function populateDirectory
{
local dst=$1
$_SETATTR --~barrier "$VDIR"
base._addGeneratedFile "$VDIR"
- mkdir -p -m755 "$SETUP_CONFDIR"/apps "$VDIR"/{dev/pts,etc}
+ mkdir -p -m755 "$SETUP_CONFDIR"/apps "$VDIR"/etc
base._addGeneratedFile "$SETUP_CONFDIR"
ln -s "$VDIR" "$SETUP_CONFDIR/vdir"
ln -s "$CACHEDIR/$VSERVERDIRNAME" "$SETUP_CONFDIR/cache"
- local spec
- while read spec; do
- makeDevEntry "$VDIR"/dev $spec
- done <$_DEV_FILE
+ populateDev
mkdir -p "$VDIR"/proc
findAndCopy "$VDIR"/etc/hosts "$__CONFDIR"/.defaults/files/hosts "$__CONFDIR/.distributions/$DISTRIBUTION"/files/hosts \
-# $Id:$ --*- sh -*--
+# $Id$ --*- sh -*--
# Copyright (C) 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
DISTRIBUTION=:
use_pkgmgmt=
+no_dev_sanity=
declare -a TEMPLATE=()
while true; do
case "$1" in
-d) DISTRIBUTION=$2; shift;;
--debug) set -x;;
--pkgmgmt) use_pkgmgmt=1;;
+ --nodevsanity) no_dev_sanity=1;;
-t|--template)
case "$2" in
/*) f="$2";;
done
popd &> /dev/null
+test -z "$no_dev_sanity" || {
+ rm -rf dev/*
+ populateDev
+}
+
test -z "$BUILD_INITPOST" || "$BUILD_INITPOST" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS"
base.setSuccess