Changeset 2478

Show
Ignore:
Timestamp:
01/27/07 12:10:09 (2 years ago)
Author:
dhozac
Message:

Move dynamic context generation to userspace.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/contrib/manifest.dat.pathsubst

    r2469 r2478  
    4646build  @PKGLIBDIR@/defaults/fstab 
    4747build  @PKGLIBDIR@/defaults/debootstrap.uri 
     48build  @PKGLIBDIR@/defaults/context.start 
    4849@ENSC_HAVE_C99_COMPILER_TRUE@build  @PKGLIBDIR@/defaults/vunify-exclude 
    4950base   @PKGLIBDIR@/capchroot 
  • trunk/distrib/Makefile.am

    r2471 r2478  
    2727                        misc/vprocunhide-files \ 
    2828                        misc/vunify-exclude \ 
    29                         misc/environment 
     29                        misc/environment \ 
     30                        misc/context.start 
    3031 
    3132nobase_distrib_SCRIPTS  =  redhat/initpost \ 
  • trunk/doc/configuration.xml

    r2474 r2478  
    7777      </description> 
    7878    </data> 
     79 
     80    <boolean name="context.dynamic"> 
     81      <description> 
     82If this file exists, kernel-side dynamic contexts will be used by the "vserver 
     83... build" command. Otherwise a context will be generated, based on the 
     84contents of <optionref>context.next</optionref>. 
     85      </description> 
     86    </boolean> 
     87 
     88    <scalar id="context.next" name="context.next"> 
     89      <description> 
     90The context id to use for the next guest created by "vserver ... build". 
     91      </description> 
     92    </scalar> 
    7993     
    8094    <collection name="apps"> 
  • trunk/scripts/vserver-setup.functions

    r2477 r2478  
    170170} 
    171171 
     172function _setup_generateContext 
     173{ 
     174    if test -z "$SETUP_CONTEXT" && test ! -e "$__CONFDIR/.defaults/context.dynamic"; then 
     175        if test -e "$__CONFDIR/.defaults/context.next"; then 
     176            SETUP_CONTEXT=`$_CAT "$__CONFDIR/.defaults/context.next"` 
     177        else 
     178            SETUP_CONTEXT=`$_CAT "$__PKGLIBDEFAULTDIR/context.start"` 
     179        fi 
     180        expr "$SETUP_CONTEXT" + 1 > "$__CONFDIR/.defaults/context.next" 
     181    fi 
     182} 
     183 
    172184function setup_writeOption 
    173185{ 
     
    177189 
    178190    mkdir -p "$cfgdir"/interfaces "$cfgdir"/apps/init "$cfgdir"/uts "$cfgdir"/cpuset 
     191 
     192    _setup_generateContext 
    179193 
    180194    _setup_writeSingleOption "$name"            "$cfgdir"/name