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.
*
.*
!requirements.txt
!setup

View File

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

View File

@@ -91,6 +91,7 @@ Reserve 12Gb of disk and run:
....
git clone https://github.com/cirosantilli/linux-kernel-module-cheat
cd linux-kernel-module-cheat
./setup
./build --download-dependencies qemu-buildroot
./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:
....
./setup
./build --arch aarch64 --download-dependencies qemu-buildroot
./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:
....
./setup
./build --download-dependencies gem5-buildroot
./run --emulator gem5
....
@@ -843,6 +846,7 @@ Or to run a baremetal example instead:
Be saner and use our custom built QEMU instead:
....
./setup
./build --download-dependencies qemu
./run
....
@@ -1099,6 +1103,7 @@ You can install those libraries with:
....
cd linux-kernel-module-cheat
./setup
./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:
....
./setup
./build --arch aarch64 --download-dependencies qemu-baremetal
./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:
....
./setup
./build --download-dependencies gem5-baremetal
./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:
....
./setup
./build --download-dependencies docs
....
@@ -3925,7 +3933,7 @@ 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
sudo ./setup -y
./setup -y
....
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:
....
cat ./setup
./build --download-dependencies --dry-run <some-target> | less
....

14
build
View File

@@ -1,20 +1,19 @@
#!/usr/bin/env python3
import re
import os
import cli_function
import collections
import common
import copy
import itertools
import math
import os
import re
import subprocess
import cli_function
import common
import lkmc
import shell_helpers
from shell_helpers import LF
import lkmc
class _Component:
'''
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.
'git',
'moreutils', # ts
'python3-pip',
'rr',
'squashfs-tools',
'tmux',

View File

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

14
setup
View File

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