X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=distrib%2Fgentoo%2Finitpre;h=4d18d691669c1dc891b7bd1e59a546faa960533a;hb=4434ece05f02e6f5bebd6854172e1de056b405c2;hp=24ffd80d4fee38dd1f63e7d64acb0f5e6388cc72;hpb=4111ebf86b56722baa166a59394334732ae111a7;p=util-vserver.git diff --git a/distrib/gentoo/initpre b/distrib/gentoo/initpre index 24ffd80..4d18d69 100755 --- a/distrib/gentoo/initpre +++ b/distrib/gentoo/initpre @@ -21,17 +21,24 @@ vdir="$1"/vdir . "$2" # portage stuff - echo ">>> Adding shared /usr/portage to fstab ... " -if test -d /usr/portage; then +hash portageq &>/dev/null + +if test $? -eq 0; then + _PORTDIR=$(portageq portdir) +else + _PORTDIR=/usr/portage +fi + +if test -d $_PORTDIR; then ( echo echo "# shared portage tree" - echo "/usr/portage /usr/portage none bind,ro 0 0" - echo "/usr/portage/distfiles /usr/portage/distfiles none bind,rw 0 0" + echo "${_PORTDIR} /usr/portage none bind,ro 0 0" + echo "${_PORTDIR}/distfiles /usr/portage/distfiles none bind,rw 0 0" ) >> "$1"/fstab else - echo "!!! Cannot find /usr/portage! You should definitely use a" + echo "!!! Cannot find a portage tree! You should definitely use a" echo "!!! shared portage tree if you have multiple Gentoo guests!" fi @@ -46,3 +53,5 @@ if test "$initstyle" != "gentoo" -a "$initstyle" != "plain"; then echo "!!! The init-style you specified is not supported for Gentoo" echo "!!! Please use one of: plain, gentoo" fi + +echo -n ">>> Unpacking template ... "