Progetto Esteso Raccolta Automatica Configurazioni hardware Organizzate Tramite Tarallo Autonomamente
Script to gather hardware data and update T.A.R.A.L.L.O. automatically.
Clone this repo:
git clone https://github.com/weee-open/peracotta
Make a virtual environment in the directory of the repo:
cd peracotta
python3 -m venv venv
Activate it:
source venv/bin/activate
Install the requirements in the virtual environment:
pip install -r requirements.txt
Use it.
When you're done, exit the virtualenv with deactivate
or simply close the terminal you were using.
For developers, if requirements change:
- install the correct version of the requirements (e.g. a new library or a new version of an already installed library)
- with the virtual environment activated, run
pip freeze > requirements.txt
These are the scripts you run directly from the terminal. Quite obviously, main_with_gui.py
presents a graphical interface, but at the time being, if you just have to copy-paste the JSON output from the terminal into the 'Bulk Add' TARALLO page, main.sh
is the one for you.
This script basically runs sudo ./generate_files.sh
and ./extract_data.py
, but it does so in an interactive manner, so
you can either pass it the arguments, or it will ask you for them nicely.
Use -h or --help to show this help.
Usage: ./main.sh [-p|--path <optional path to generate files to>] [-c|--cpu | -g|--gpu | -b|--motherboard]
If no argument is given, then this script will interactively guide you to run the PERACOTTA data
gathering package.
Alternatively, you can choose to pass either the path to the directory where you want the files
to be generated, the gpu location, or both.
In this case, the script will only become interactive when needed, and it won't ask you anything
if you pass both the path and the gpu location.
This script is interactive, so you'll just need to run it with ./main_with_gui.py
.
The GUI is also available from extract_data.py
with the -i
or --gui
option.
This will create some txt files with data related to the computer, that will be parsed by launching
extract_data.py
. The hard work is powered by the many read_X.py
scripts, which are the actual
parsers.
Install dependencies on Debian-based distributions (Debian, Ubuntu, Xubuntu, etc):
sudo apt install pciutils i2c-tools mesa-utils smartmontools dmidecode
These are the actual programs that generate the files that we parse.
Note: You can run this script after running sudo ./generate_files.sh
, but it's quicker and easier if you just run ./main.sh
. No sudo
required.
You can pass as the path argument the directory where generate_files.sh dropped its files. By default (i.e. if you don't give any arguments
to generate_files.sh
) it will output the files in the current directory. Since this may clutter the working directory
with txt files, it's best to make a new directory (e.g. mkdir tmp
) and pass it to the file generator (e.g. generate_files.sh tmp
).
You can then pass this path to this script so that it knows where to find the txt files (e.g. ./extract_data.py -g tmp
).
This is done automatically by the GUI version.
You can find the usage below, but keep in mind that the two most important arguments are:
- the path to the txt files (if none given, it will default to the current directory)
-g | -c | -b
: one of these is required to tell the script where the GPU (or graphics card if it's not integrated) is located
usage: extract_data.py [-h] (-g | -c | -b) [-s | -l | -i] [-v] [path]
Parse the files generated with generate_files.sh and get all the possible info
out of them
positional arguments:
path path to directory with txt files generated by
generate_files.sh - defaults to current directory
optional arguments:
-h, --help show this help message and exit
-v, --verbose print some warning messages
GPU Location (one argument required):
-g, --gpu computer has dedicated GPU
-c, --cpu GPU is integrated inside the CPU
-b, --motherboard GPU is integrated inside the motherboard
With or without GUI (one argument optional):
-s, --short enabled by default, this is the option you want if you
want to copy-paste this output into the TARALLO 'Bulk
Add' page
-l, --long print longer output
-i, --gui launch GUI instead of using the terminal version
There are many read_something.py scripts: these are used internally by the other scripts. They can also be launched from the command line. They can also be imported as libraries.
This is the GUI icon.
Yes, it's a pear emoji. ๐