X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=create-vm.sh;h=658f41602bf14b42241d1624ae5ad1d1fa5625c1;hb=refs%2Fheads%2Fmaster;hp=7027276a73e02eb041340bdc9dc71f41430919a6;hpb=1f4f80e0c7dc71ef79614227c195139a56d1421e;p=build.git diff --git a/create-vm.sh b/create-vm.sh index 7027276a..658f4160 100755 --- a/create-vm.sh +++ b/create-vm.sh @@ -3,20 +3,37 @@ COMMAND=$(basename $0) DIRNAME=$(dirname $0) +# NOTE - April 2020 +# this whole lot won't work well with ubuntu containers any longer +# tried with webprivacy on bionic, and +# (*) the initial populating phase somehow spawned a question screen +# something about asking questions during upgrades.. +# so I had to turn off the redirection into ~/machines/.log +# (*) more badly, the resulting container does not start its network upon boot +# everything is in place and it could be started manually +# like for the record e.g. +# ip link set dev eth0 up +# ip address add 138.96.119.13/21 dev eth0 +# ip route add default dev eth0 via 138.96.112.250 +# ping -c 1 8.8.8.8 +# trying to solve that last issue by apt-get install'ing network-manager +# (which was missing indeed) was not enough +# a bit more work seems to be needed if that became needed + BUILD="${HOME}/git-build" LOGS=$HOME/machines -[ -d $LOGS ] || { echo "Creating logs dir $LOGS" ; mkdir -p $LOGS; } +[ -d $LOGS ] || { echo "Creating logs dir $LOGS" ; mkdir -p $LOGS; } DOMAIN=pl.sophia.inria.fr -DEFAULT_DISTRO=f31 +DEFAULT_DISTRO=f39 DEFAULT_MEMORY=16384 CONFIRM= function usage () { - message="$@" + message="$@" echo "usage : $COMMAND [-c] [-f distro] [-i image] [ -m memory ] [ -n hostname ] [-s] container" echo " -c : confirm, will show the command and prompt for confirmation " echo " -f : set distro, default is $DEFAULT_DISTRO" @@ -72,8 +89,10 @@ fqdn=$VM_HOSTNAME.$DOMAIN initvm="$BUILD/lbuild-initvm.sh" [ -z "$IMAGE" ] && initvm="$initvm -f $DISTRO" || initvm="$initvm -i $IMAGE" initvm="$initvm -n $fqdn" +# always use fedora repos +initvm="$initvm -u" [ -n "$DO_NOT_START_VM" ] && initvm="$initvm -s" -[ -n "$MEMORY" ] && initvm="$initvm -m $MEMORY" +[ -n "$MEMORY" ] && initvm="$initvm -m $MEMORY" initvm="$initvm $container" if [ -n "$CONFIRM" ] ; then @@ -84,4 +103,3 @@ fi echo "Running $initvm" echo "Storing output in $LOGS/$container.log" $initvm >& $LOGS/$container.log -