Skip to content

Commit

Permalink
fix bootAndRun() (mininet#1024)
Browse files Browse the repository at this point in the history
* 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()
  • Loading branch information
lantz authored Feb 6, 2021
1 parent f0c726a commit 06dae1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion util/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions util/vm/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -954,15 +954,16 @@ 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:
logfile = NamedTemporaryFile( prefix=basename,
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 )
Expand Down

0 comments on commit 06dae1a

Please sign in to comment.