mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-26 09:43:57 -04:00
Tools: initvagrant.sh: increase verbosity
- it needs to be run as root, but did not check. - increase the verbosity a bit as during 'vagrant up' as its often unclear which script is actually running.
This commit is contained in:
parent
f5b2d5ca66
commit
b3e8618f9d
@ -1,24 +1,36 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
echo "---------- $0 start ----------"
|
||||||
|
|
||||||
# this script is run by the root user in the virtual machine
|
# this script is run by the root user in the virtual machine
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
who=$(whoami)
|
||||||
echo "Initial setup of SITL-vagrant instance."
|
echo "Initial setup of SITL-vagrant instance."
|
||||||
|
if [ $who != 'root' ]; then
|
||||||
|
echo "SORRY, MUST RUN THIS SCRIPT AS ROOT, GIVING UP"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
VAGRANT_USER=ubuntu
|
VAGRANT_USER=ubuntu
|
||||||
if [ -e /home/vagrant ]; then
|
if [ -e /home/vagrant ]; then
|
||||||
# prefer vagrant user
|
# prefer vagrant user
|
||||||
VAGRANT_USER=vagrant
|
VAGRANT_USER=vagrant
|
||||||
fi
|
fi
|
||||||
|
echo USING VAGRANT_USER:$VAGRANT_USER
|
||||||
|
|
||||||
|
cd /home/$VAGRANT_USER
|
||||||
|
|
||||||
|
|
||||||
# artful rootfs is 2GB without resize:
|
# artful rootfs is 2GB without resize:
|
||||||
sudo resize2fs /dev/sda1
|
sudo resize2fs /dev/sda1
|
||||||
|
|
||||||
usermod -a -G dialout $VAGRANT_USER
|
usermod -a -G dialout $VAGRANT_USER
|
||||||
|
|
||||||
|
echo "calling pre-reqs script..."
|
||||||
/vagrant/Tools/scripts/install-prereqs-ubuntu.sh -y
|
/vagrant/Tools/scripts/install-prereqs-ubuntu.sh -y
|
||||||
|
echo "...pre-reqs script done... initvagrant.sh continues."
|
||||||
|
|
||||||
# run-in-terminal-window uses xterm:
|
# run-in-terminal-window uses xterm:
|
||||||
apt-get install -y xterm
|
apt-get install -y xterm
|
||||||
@ -35,6 +47,7 @@ apt-get install -y gcovr lcov
|
|||||||
# install pexpect for autotest.py
|
# install pexpect for autotest.py
|
||||||
pip install pexpect
|
pip install pexpect
|
||||||
|
|
||||||
|
|
||||||
sudo -u $VAGRANT_USER ln -fs /vagrant/Tools/vagrant/screenrc /home/$VAGRANT_USER/.screenrc
|
sudo -u $VAGRANT_USER ln -fs /vagrant/Tools/vagrant/screenrc /home/$VAGRANT_USER/.screenrc
|
||||||
|
|
||||||
# build JSB sim
|
# build JSB sim
|
||||||
@ -55,3 +68,5 @@ touch /ardupilot.vagrant
|
|||||||
|
|
||||||
# Now you can run
|
# Now you can run
|
||||||
# vagrant ssh -c "screen -d -R"
|
# vagrant ssh -c "screen -d -R"
|
||||||
|
echo "---------- $0 end ----------"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user