Skip to content

Commit

Permalink
Merge pull request #56 from ResidenciaTICBrisa/fix-naov4-python-sdk
Browse files Browse the repository at this point in the history
Corrigir ambiente do NAOv4
  • Loading branch information
damarcones authored Sep 20, 2023
2 parents 4487441 + e7d859a commit ace999f
Show file tree
Hide file tree
Showing 23 changed files with 76 additions and 31 deletions.
2 changes: 1 addition & 1 deletion docs/mkdocs-kludge.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

readonly DOCDIRS=(ros1 ros2 vms/ubuntu-12 vms/ubuntu-16)
readonly DOCDIRS=(ros1 ros2 vms/ubuntu-14 vms/ubuntu-16)

for docdir in "${DOCDIRS[@]}"; do
# Create directory inside the current one
Expand Down
1 change: 0 additions & 1 deletion docs/vms/ubuntu-12/README.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/vms/ubuntu-14/README.md
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ nav:
- Home: index.md
- Máquina Virtual: Instruções/Maquina_Virtual.md
- NAOv4:
- Máquina Virtual com scripts: vms/ubuntu-12/README.md
- Máquina Virtual com scripts: vms/ubuntu-14/README.md
- NAO Flahser: Instruções/NAO_Flasher.md
- SDK C++: Instruções/CPP_SDK_v4.md
- Choregraphe: Instruções/Choregraphe_v4.md
Expand Down
8 changes: 0 additions & 8 deletions scripts/vms/ubuntu-12/sources.list

This file was deleted.

File renamed without changes.
22 changes: 12 additions & 10 deletions scripts/vms/ubuntu-12/README.md → scripts/vms/ubuntu-14/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ Even though these scripts can be modified easily, they expect the following
directory structure in their current form:

- `env-vars.sh`, a script to centralise the VM's configurations
- an [image][1] from Ubuntu's installation disk version 12.04 named as
`ubuntu-12.04-desktop-amd64.iso` (this can be altered in the `IMAGE_LOCATION`
- an [image][1] from Ubuntu's installation disk version 14.04 named as
`ubuntu-14.04-desktop-amd64.iso` (this can be altered in the `IMAGE_LOCATION`
variable at the `env-vars.sh` script)

[1]: https://old-releases.ubuntu.com/releases/precise/ubuntu-12.04.5-desktop-amd64.iso
[1]: https://releases.ubuntu.com/trusty/ubuntu-14.04.6-desktop-amd64.iso

### Creating the VM and preparing to compile NAOqi for NAOv4

Expand All @@ -46,7 +46,7 @@ the following order:
1. `reset-main-drive.sh`
2. `first-boot.sh`

After installing Ubuntu 12.04 in their virtual machine, the following scripts
After installing Ubuntu 14.04 in their virtual machine, the following scripts
must be executed in their host machine:

1. `update-sources.sh`
Expand All @@ -57,7 +57,8 @@ must run the `prepare-naoqi-requirements.sh` script to compile Python 2.7.11
and install Pip 20.3.4.

Finally, the user will be able to install the NAOv4 development environment
using the `install-naov4.sh` script.
using the `install-naov4.sh` script. The newer Python will be used only to
download Pip, as it crashes the Python SDK.

## Starting the Virtual Machine up for the first time

Expand All @@ -68,7 +69,7 @@ The initial images are created by the `reset-*` scripts
```

With the drives created, run the initialisation script and install a regular
Ubuntu 12.04 LTS installation:
Ubuntu 14.04 LTS installation:

- Language and keyboard layout: Português Brasileiro
- Erase disk and install Ubuntu
Expand All @@ -81,9 +82,10 @@ Ubuntu 12.04 LTS installation:

## Running the VM

Ubuntu 12.04 is not a supported release anymore. This means that the repository
in the original release has been changed to the old release archive. In order to
fix this, run the following script when the VM is disabled:
Sometimes the Brazilian server takes too long to synchronise with the main
server, leading to failed installations or upgrades. In order to avoid this
problem, please run the following script to set the repository to the main
archive:

```
./update-sources.sh
Expand All @@ -94,7 +96,7 @@ if there are any updates available.

## Preparing to install NAOqi for NAOv4

Ubuntu 12.04 has an old version of Python 2.7. It lacks support to download data
Ubuntu 14.04 has an old version of Python 2.7. It lacks support to download data
from websites that enforce HTTPS, such as the modern Python packages index
(`pip`). This requires a compilation of a newer Python version and the
installation of the last compatible `pip` release. These steps can be automated
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
[ -z "${SOURCED_ENV_VARS_SH}" ] || exit 0

readonly BIOS_LOCATION="/usr/share/seabios/vgabios-virtio.bin"
readonly IMAGE_LOCATION="ubuntu-12.04-desktop-amd64.iso"
readonly DISK_LOCATION="ubuntu-12.04-vm.qcow2"
readonly IMAGE_LOCATION="ubuntu-14.04-desktop-amd64.iso"
readonly DISK_LOCATION="ubuntu-14.04-vm.qcow2"

readonly DISK_SIZE="50G"

readonly VM_INITIAL_NAME="ubuntu-12.04-nao-first-boot"
readonly VM_NAME="ubuntu-12.04-nao"
readonly VM_INITIAL_NAME="ubuntu-14.04-nao-first-boot"
readonly VM_NAME="ubuntu-14.04-nao"
readonly IPV4_NETWORK="192.168.3.0/24"
readonly IPV4_DHCP_FIRST_ADDR="192.168.3.220"
readonly P22_FWD="10022"
readonly MACHINE_TYPE="pc-q35-6.2"
readonly MACHINE_CFG="type=${MACHINE_TYPE},accel=kvm"
readonly CPU_MODEL="Nehalem-v2"
readonly CPU_MODEL="Haswell-v4"
readonly CPU_NUMBER="4"
readonly MACHINE_MEMORY_SIZE="4G"
readonly DISPLAY_DEVICE="qxl-vga"
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ mkdir -pv "${NAO_CHOREGRAPHE_DIR}"
mkdir -pv "${NAO_FLASHER_DIR}"

echo 'Install qibuild'
pip2 install qibuild pyreadline
"${PIP_PATH}/pip2" install qibuild pyreadline
echo '# NAOv4 installation' >> "${HOME}/.bashrc"
echo "readonly PIP_PATH=\"${PIP_PATH}\"" >> "${HOME}/.bashrc"
echo 'export PATH="${PATH}:${PIP_PATH}"' >> "${HOME}/.bashrc"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ echo "Installing GCC and G++"
sudo apt-get install --yes build-essential

echo "Installing Python 2 Build dependencies"
sudo apt-get build-dep --yes python-dev
sudo apt-get install --yes python-dev
sudo apt-get build-dep --yes python-all-dev
sudo apt-get install --yes python-all-dev pkg-config \
libbz2-dev libffi-dev libgdbm-dev liblzma-dev \
libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev \
lzma lzma-dev tk-dev uuid-dev zlib1g-dev

echo "Downloading Python 2.7.11"
wget 'https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tar.xz'
Expand All @@ -21,8 +24,6 @@ cd 'Python-2.7.11'
make -j "$(nproc)" profile-opt
make install

echo 'export PATH="${HOME}/.local/bin:${PATH}"' >> "${HOME}/.bashrc"

echo "Downloading pip for Python 2.7"
wget 'https://bootstrap.pypa.io/pip/2.7/get-pip.py'

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
49 changes: 49 additions & 0 deletions scripts/vms/ubuntu-14/sources.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://archive.ubuntu.com/ubuntu/ trusty universe
deb http://archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu trusty partner
# deb-src http://archive.canonical.com/ubuntu trusty partner

deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
1 change: 1 addition & 0 deletions scripts/vms/ubuntu-14/ubuntu-14.04-desktop-amd64.iso
File renamed without changes.

0 comments on commit ace999f

Please sign in to comment.