X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fvserver-build.functions;h=3508f3f43e78d9343492adfab2b389b3a94a08e3;hb=5990e5a2b7fb4100fb45a8036466f2e57b0af46c;hp=9262ade396e20289eccf94cc94d527b5f13ebc12;hpb=9c78378bebc1a9f3d400f422df8ede9efea57dea;p=util-vserver.git diff --git a/scripts/vserver-build.functions b/scripts/vserver-build.functions index 9262ade..3508f3f 100644 --- a/scripts/vserver-build.functions +++ b/scripts/vserver-build.functions @@ -50,6 +50,17 @@ function makeDevEntry 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 @@ -101,7 +112,7 @@ function _setCacheDir } } -function _setVserverDir +function _setVserverDirName { test -z "$VSERVERDIRNAME" || return 0 VSERVERDIRNAME="$VSERVER_NAME" @@ -172,6 +183,8 @@ ERROR: Can not determine distribution; please specify it manually with ERROR: Can not find configuration for the distribution '$DISTRIBUTION'; please read http://linux-vserver.org/HowToRegisterNewDistributions for information how to add support for your own distribution." + + export DISTRIBUTION } function base._addGeneratedFile @@ -188,19 +201,16 @@ vserver-topdirectory '$VDIR' and/or configuration at '$SETUP_CONFDIR' exist already; please try to use '--force', or remove them manually." mkdir -p -m755 "$VDIR" - chattr -t "$VDIR" + $_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 \ @@ -215,7 +225,7 @@ function base._initVariables { _setRootDir _setCacheDir - _setVserverDir + _setVserverDirName _setVdir findFile _DEV_FILE "$__CONFDIR/.distributions/$DISTRIBUTION/devs" "$__DISTRIBDIR/$DISTRIBUTION/devs" "$__DISTRIBDIR/defaults/devs"