docs: create virtualenv

Newer Ubuntu does not allow global package installs, it is so annoying!
This commit is contained in:
Ciro Santilli
2022-07-19 20:21:19 +00:00
parent 972463301b
commit 20bc64cd69
3 changed files with 24 additions and 36 deletions

1
.gitignore vendored
View File

@ -21,6 +21,7 @@ gitignore.*
# Python trash.
*.pyc
__pycache__
.venv
# Accidents.
/core

View File

@ -37,6 +37,8 @@ toc::[]
The most important functionality of this repository is the `--china` option, sample usage:
....
python3 -m venv .venv
. .venv/bin/activate
./setup
./run --china > index.html
firefox index.html
@ -121,6 +123,8 @@ Reserve 12Gb of disk and run:
....
git clone https://github.com/cirosantilli/linux-kernel-module-cheat
cd linux-kernel-module-cheat
python3 -m venv .venv
. .venv/bin/activate
./setup
./build --download-dependencies qemu-buildroot
./run
@ -177,6 +181,8 @@ All available modules can be found in the link:kernel_modules[] directory.
It is super easy to build for different <<cpu-architecture,CPU architectures>>, just use the `--arch` option:
....
python3 -m venv .venv
. .venv/bin/activate
./setup
./build --arch aarch64 --download-dependencies qemu-buildroot
./run --arch aarch64
@ -660,6 +666,8 @@ For the most part, if you just add the `--emulator gem5` option or `*-gem5` suff
If you haven't built Buildroot yet for <<qemu-buildroot-setup>>, you can build from the beginning with:
....
python3 -m venv .venv
. .venv/bin/activate
./setup
./build --download-dependencies gem5-buildroot
./run --emulator gem5
@ -726,6 +734,8 @@ For example, to do a <<qemu-buildroot-setup>> inside Docker, run:
....
sudo apt-get install docker
python3 -m venv .venv
. .venv/bin/activate
./setup
./run-docker create && \
./run-docker sh -- ./build --download-dependencies qemu-buildroot
@ -877,6 +887,8 @@ Or to run a baremetal example instead:
Be saner and use our custom built QEMU instead:
....
python3 -m venv .venv
. .venv/bin/activate
./setup
./build --download-dependencies qemu
./run
@ -1134,6 +1146,8 @@ You can install those libraries with:
....
cd linux-kernel-module-cheat
python3 -m venv .venv
. .venv/bin/activate
./setup
./build --download-dependencies userland-host
....
@ -1313,6 +1327,8 @@ Every `.c` file inside link:baremetal/[] and `.S` file inside `baremetal/arch/<a
For example, to run link:baremetal/arch/aarch64/dump_regs.c[] in QEMU do:
....
python3 -m venv .venv
. .venv/bin/activate
./setup
./build --arch aarch64 --download-dependencies qemu-baremetal
./run --arch aarch64 --baremetal baremetal/arch/aarch64/dump_regs.c
@ -1397,6 +1413,8 @@ You can run all the baremetal examples in one go and check that all assertions p
To use gem5 instead of QEMU do:
....
python3 -m venv .venv
. .venv/bin/activate
./setup
./build --download-dependencies gem5-baremetal
./run --arch aarch64 --baremetal userland/c/hello.c --emulator gem5
@ -1475,6 +1493,8 @@ For development, you will want to do a more controlled build with extra error ch
For the initial build do:
....
python3 -m venv .venv
. .venv/bin/activate
./setup
./build --download-dependencies docs
....
@ -3964,6 +3984,8 @@ Then, from inside that image:
sudo apt-get install git
git clone https://github.com/cirosantilli/linux-kernel-module-cheat
cd linux-kernel-module-cheat
python3 -m venv .venv
. .venv/bin/activate
./setup -y
....
@ -26926,41 +26948,6 @@ https://www.samsung.com/semiconductor/dram/module/M471A2K43BB1-CRC/ (http://web.
https://www.amazon.co.uk/Samsung-DDR4-16-GB-DDR4-2400-MHz-Memory-Module/dp/B016N24XKQ (http://web.archive.org/web/20181224203214/https://www.amazon.co.uk/Samsung-DDR4-16-GB-DDR4-2400-MHz-Memory-Module/dp/B016N24XKQ[archive]) 355.43 UK Pounds for 2x 16 GiB.
===== Samsung MZVLB512HAJQ-000L7 512GB SSD
PCIe TLC OPAL2.
https://www.samsung.com/semiconductor/ssd/client-ssd/MZVLB512HAJQ/ (http://web.archive.org/web/20181224225400/https://www.samsung.com/semiconductor/ssd/client-ssd/MZVLB512HAJQ/[archive]).
https://www.samsung.com/semiconductor/global.semi/file/resource/2018/05/PM981_M.2_SSD_Datasheet_v1.3_for_General.pdf | http://web.archive.org/web/20181224225410/https://www.samsung.com/semiconductor/global.semi/file/resource/2018/05/PM981_M.2_SSD_Datasheet_v1.3_for_General.pdf
`sudo hdparm -Tt /dev/nvme0n1p5` on Ubuntu 20.04:
....
Timing cached reads: 29812 MB in 1.99 seconds = 15007.00 MB/sec
HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
Timing buffered disk reads: 6328 MB in 3.00 seconds = 2109.00 MB/sec
....
Nominal maximum sequential read speed: 3,000 MB/s
===== Seagate ST1000LM035-1RK1 1TB hard disk
1TB.
https://www.disctech.com/Seagate-ST1000LM035-1TB-SATA-Hard-Drive 80 USD | http://web.archive.org/web/20181224201408/https://www.disctech.com/Seagate-ST1000LM035-1TB-SATA-Hard-Drive
https://www.seagate.com/www-content/datasheets/pdfs/mobile-hddDS1861-2-1603-en_US.pdf | http://web.archive.org/web/20181225095438/https://www.seagate.com/www-content/datasheets/pdfs/mobile-hddDS1861-2-1603-en_US.pdf
`sudo hdparm -Tt /dev/sda3` on Ubuntu 20.04:
....
Timing cached reads: 29594 MB in 1.99 seconds = 14893.89 MB/sec
Timing buffered disk reads: 386 MB in 3.01 seconds = 128.07 MB/sec
....
Nominal maximum speed: 140MB/s
===== NVIDIA Quadro M1200 4GB GDDR5 GPU
=== Benchmark Internets

2
setup
View File

@ -27,4 +27,4 @@ $sudo apt-get install $y \
python3-pip \
python3-distutils \
;
python3 -m pip install --user -r requirements.txt
python3 -m pip install -r requirements.txt