fix bootAndRun() (#1024)
* rc.local: /usr/bin/bash -> /bin/bash bash is (and should be) located in /bin this may have caused ubuntu 18.04 to not execute /etc/rc.local and regenerate ssh keys * fix bootAndRun()
This commit is contained in:
+1
-1
@@ -791,7 +791,7 @@ function vm_clean {
|
||||
echo 'Removing SSH keys from /etc/ssh/'
|
||||
sudo rm -f /etc/ssh/*key*
|
||||
if [ ! -e /etc/rc.local ]; then
|
||||
echo '#!/usr/bin/bash' | sudo tee /etc/rc.local
|
||||
echo '#!/bin/bash' | sudo tee /etc/rc.local
|
||||
sudo chmod +x /etc/rc.local
|
||||
fi
|
||||
if ! grep mininet /etc/rc.local >& /dev/null; then
|
||||
|
||||
+3
-2
@@ -954,7 +954,8 @@ def bootAndRun( image, prompt=Prompt, memory=1024, cpuCores=1, outputFile=None,
|
||||
log( '* Creating COW disk', cow )
|
||||
run( 'qemu-img create -f qcow2 -b %s %s' % ( image, cow ) )
|
||||
log( '* Extracting kernel and initrd' )
|
||||
kernel, initrd, part = extractKernel( image, flavor=basename, imageDir=tmpdir )
|
||||
kernel, initrd, partnum = extractKernel(
|
||||
image, flavor=basename, imageDir=tmpdir )
|
||||
if LogToConsole:
|
||||
logfile = stdout
|
||||
else:
|
||||
@@ -962,7 +963,7 @@ def bootAndRun( image, prompt=Prompt, memory=1024, cpuCores=1, outputFile=None,
|
||||
suffix='.testlog', delete=False )
|
||||
log( '* Logging VM output to', logfile.name )
|
||||
vm = boot( cow=cow, kernel=kernel, initrd=initrd, logfile=logfile,
|
||||
memory=memory, cpuCores=cpuCores, part=part )
|
||||
memory=memory, cpuCores=cpuCores, partnum=partnum )
|
||||
login( vm )
|
||||
log( '* Waiting for prompt after login' )
|
||||
vm.expect( prompt )
|
||||
|
||||
Reference in New Issue
Block a user