Make the most important dependency mandatory

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2021-03-25 00:00:01 +00:00
parent 3aa1a670b7
commit 956adffe40
6 changed files with 32 additions and 17 deletions

View File

@@ -2,4 +2,5 @@
# with a volume. # with a volume.
* *
.* .*
!requirements.txt
!setup !setup

View File

@@ -1,5 +1,6 @@
# https://cirosantilli.com/linux-kernel-module-cheat#docker # https://cirosantilli.com/linux-kernel-module-cheat#docker
FROM ubuntu:20.04 FROM ubuntu:20.04
COPY setup / COPY setup /
COPY requirements.txt /
RUN /setup -y RUN /setup -y
CMD bash CMD bash

View File

@@ -91,6 +91,7 @@ Reserve 12Gb of disk and run:
.... ....
git clone https://github.com/cirosantilli/linux-kernel-module-cheat git clone https://github.com/cirosantilli/linux-kernel-module-cheat
cd linux-kernel-module-cheat cd linux-kernel-module-cheat
./setup
./build --download-dependencies qemu-buildroot ./build --download-dependencies qemu-buildroot
./run ./run
.... ....
@@ -146,6 +147,7 @@ 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: It is super easy to build for different <<cpu-architecture,CPU architectures>>, just use the `--arch` option:
.... ....
./setup
./build --arch aarch64 --download-dependencies qemu-buildroot ./build --arch aarch64 --download-dependencies qemu-buildroot
./run --arch aarch64 ./run --arch aarch64
.... ....
@@ -628,6 +630,7 @@ 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: If you haven't built Buildroot yet for <<qemu-buildroot-setup>>, you can build from the beginning with:
.... ....
./setup
./build --download-dependencies gem5-buildroot ./build --download-dependencies gem5-buildroot
./run --emulator gem5 ./run --emulator gem5
.... ....
@@ -843,6 +846,7 @@ Or to run a baremetal example instead:
Be saner and use our custom built QEMU instead: Be saner and use our custom built QEMU instead:
.... ....
./setup
./build --download-dependencies qemu ./build --download-dependencies qemu
./run ./run
.... ....
@@ -1099,6 +1103,7 @@ You can install those libraries with:
.... ....
cd linux-kernel-module-cheat cd linux-kernel-module-cheat
./setup
./build --download-dependencies userland-host ./build --download-dependencies userland-host
.... ....
@@ -1277,6 +1282,7 @@ 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: For example, to run link:baremetal/arch/aarch64/dump_regs.c[] in QEMU do:
.... ....
./setup
./build --arch aarch64 --download-dependencies qemu-baremetal ./build --arch aarch64 --download-dependencies qemu-baremetal
./run --arch aarch64 --baremetal baremetal/arch/aarch64/dump_regs.c ./run --arch aarch64 --baremetal baremetal/arch/aarch64/dump_regs.c
.... ....
@@ -1360,6 +1366,7 @@ You can run all the baremetal examples in one go and check that all assertions p
To use gem5 instead of QEMU do: To use gem5 instead of QEMU do:
.... ....
./setup
./build --download-dependencies gem5-baremetal ./build --download-dependencies gem5-baremetal
./run --arch aarch64 --baremetal userland/c/hello.c --emulator gem5 ./run --arch aarch64 --baremetal userland/c/hello.c --emulator gem5
.... ....
@@ -1437,6 +1444,7 @@ For development, you will want to do a more controlled build with extra error ch
For the initial build do: For the initial build do:
.... ....
./setup
./build --download-dependencies docs ./build --download-dependencies docs
.... ....
@@ -3925,7 +3933,7 @@ Then, from inside that image:
sudo apt-get install git sudo apt-get install git
git clone https://github.com/cirosantilli/linux-kernel-module-cheat git clone https://github.com/cirosantilli/linux-kernel-module-cheat
cd linux-kernel-module-cheat cd linux-kernel-module-cheat
sudo ./setup -y ./setup -y
.... ....
and then proceed exactly as in <<prebuilt>>. and then proceed exactly as in <<prebuilt>>.
@@ -27584,6 +27592,7 @@ For other Linux distros, everything will likely also just work if you install th
Find out the packages that we install with: Find out the packages that we install with:
.... ....
cat ./setup
./build --download-dependencies --dry-run <some-target> | less ./build --download-dependencies --dry-run <some-target> | less
.... ....

14
build
View File

@@ -1,20 +1,19 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import re
import os
import cli_function
import collections import collections
import common
import copy import copy
import itertools import itertools
import math import math
import os
import re
import subprocess import subprocess
import cli_function
import common
import lkmc
import shell_helpers import shell_helpers
from shell_helpers import LF from shell_helpers import LF
import lkmc
class _Component: class _Component:
''' '''
Yes, we are re-inventing a crappy dependency resolution system, Yes, we are re-inventing a crappy dependency resolution system,
@@ -498,7 +497,6 @@ Which components to build. Default: qemu-buildroot
# Core requirements for this repo. # Core requirements for this repo.
'git', 'git',
'moreutils', # ts 'moreutils', # ts
'python3-pip',
'rr', 'rr',
'squashfs-tools', 'squashfs-tools',
'tmux', 'tmux',

View File

@@ -28,11 +28,9 @@ import urllib
import urllib.request import urllib.request
from shell_helpers import LF from shell_helpers import LF
try: # https://cirosantilli.com/china-dictatorship/#mirrors
# Let's not make it mandatory for now. import china_dictatorship
import china_dictatorship assert "Tiananmen Square protests" in china_dictatorship.get_data()
except ImportError:
pass
import cli_function import cli_function
import path_properties import path_properties
import shell_helpers import shell_helpers

14
setup
View File

@@ -1,12 +1,20 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Minimum requirements to run ./build --download-dependencies # Minimum requirements to run ./build --download-dependencies
y=
if [ $# -eq 1 ]; then if [ $# -eq 1 ]; then
y=-y y=-y
else
y=
fi fi
apt-get update if [ -f /.dockerenv ]; then
apt-get install $y \ sudo=
else
sudo=sudo
fi
$sudo apt-get update
$sudo apt-get install $y \
git \ git \
python3 \ python3 \
python3-pip \
python3-distutils \ python3-distutils \
; ;
python3 -m pip install --user -r requirements.txt